Type cast from integer to long?

I created a stream in KSQLDB with data type as BIGINT. I am inserting some rows into this stream with hard coded values e.g., -1, 100, etc. It seems, the INSERT considers these hard coded values as INT and therefore, the INSERT fails. The error message is Incompatible schema between results and sink.. I can see that, the resulting schema from the INSERT statement shows INT whereas, the source schema i.e. the stream schema as BIGINT (as intended).

Therefore, is there a way to BIGINT(-1) in the INSERT statement? Or, what is the guidance to insert hard coded integer values into a BIGINT column?

1 Like

CAST(-1 AS BIGINT) worked. Copilot helped me. :smiley:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.