-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stream created with 'PARTITION BY CAST(...' cannot be inserted into #5053
Comments
cc @agavra this was the issue I mentioned to you via Slack. |
cc @big-andy-coates who recently changed the partition by semantics and has the most fresh context. This seems like a bug in evaluating expressions in the |
This may help #4952 |
Ack |
tl;dr: this will be fixed in master once #5363 is merged, hence closing the issue. So the issue here is around the checking of the 'key field' of the source the INSERT INTO is targetting. The 'key field' a column in the value that is a duplicate of the data stored in the key. The INSERT INTO is failing because of a mismatch between the 'key field' in target stream and the query. TBH, I'm not even sure why This will be fixed in master / 0.10.0 as soon as #5363 is merged, as this PR completely removes the concept of a 'key field'. |
For anyone reading this who's still using 0.9.0, another work-around is to cast the partitioning field as string, even if it's already a string: |
When creating a stream, if you can partition by a value that exists exactly as required in the source stream (
PARTITION BY x
) and runDESCRIBE EXTENDED
against that stream, you'll see x defined as the ROWKEY. This stream can now have additional streams of data folded into it usingINSERT INTO..
provided they have a conforming schema.If you create a stream and need to partition by a re-casted value from the source stream (
PARTITION BY CAST(x AS STRING)
) and runDESCRIBE EXTENDED
, the stream does not have a defined / named ROWKEY. For joining purposes, this doesn't prevent the stream from being joined to another stream, using the defined key.However you are prevented from running
INSERT INTO...
this second kind of stream, even if the additional source of data has a conforming schema:and the stream to insert into it -
But, if KS_ALL_CATEGORIES is created in a way that it does have an explicitly defined ROWKEY -
it can now be inserted into -
Using ksqlDB 0.8
The text was updated successfully, but these errors were encountered: