-
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
chore: partition-by primitive key support #4098
chore: partition-by primitive key support #4098
Conversation
First of a few commits to start introducing support for primitive keys in different query types. This commit opens the door for CT/CS statements with primitive keys, (`STRING`, `INT`, `BIGINT`, `BOOLEAN` and `DOUBLE`), and for using those sources in non-join, non-aggregate and non-partition-by queries.
Fixes: confluentinc#4092 WIP: This commit gets `PARTITION BY` clauses working with primitive key types. However, it does disable a couple of join until confluentinc#4094 has been completed. BREAKING CHANGE: A `PARTITION BY` now changes the SQL type of `ROWKEY` in the output schema of a query. For example, consider: ```sql CREATE STREAM INPUT (ROWKEY STRING KEY, ID INT) WITH (...); CREATE STREAM OUTPUT AS SELECT ROWKEY AS NAME FROM INPUT PARTITION BY ID; ``` Previously, the above would have resulted in an output schema of `ROWKEY STRING KEY, NAME STRING`, where `ROWKEY` would have stored the string representation of the integer from the `ID` column. With this commit the output schema will be `ROWKEY INT KEY, NAME STRING`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
final LogicalSchema sourceSchema, | ||
final StreamSelectKey step | ||
) { | ||
final ExpressionTypeManager expressionTypeManager = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this out of this class? Ideally this class should just be routing to something else that owns the schema transformation. We can move it to the step builder for now.
Description
NOTE: This was stacked on top of #4096
Fixes: #4092
WIP: This commit gets
PARTITION BY
clauses working with primitive key types. However, it does disable a couple of join until #4094 has been completed.BREAKING CHANGE: A
PARTITION BY
now changes the SQL type ofROWKEY
in the output schema of a query.For example, consider:
Previously, the above would have resulted in an output schema of
ROWKEY STRING KEY, NAME STRING
, whereROWKEY
would have stored the string representation of the integer from theID
column. With this commit the output schema will beROWKEY INT KEY, NAME STRING
.Testing done
Suitable QTT tests added / updated.
Reviewer checklist