-
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
feat: klip-14 - rowtime as pseduocolumn #5150
feat: klip-14 - rowtime as pseduocolumn #5150
Conversation
fixes: confluentinc#3734 implements [KLIP 14 - ROWTIME as Pseudocolumn](https://github.com/confluentinc/ksql/blob/master/design-proposals/klip-14-rowtime-as-pseudocolumn.md) BREAKING CHANGE: Select star, i.e. `select *`, no longer expands to include `ROWTIME` column(s). Instead, `ROWTIME` is only included in the results of queries if explicitly included in the projection, e.g. `select rowtime, *`. This only affects new statements. Any view previously created via a `CREATE STREAM AS SELECT` or `CREATE TABLE AS SELECT` statement is unaffected.
@@ -30,7 +30,8 @@ | |||
public class FieldInfo { | |||
|
|||
public enum FieldType { | |||
SYSTEM, KEY | |||
SYSTEM, // To be removed in the future. 0.9 saw this value no longer used. |
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.
Kept SYSTEM
around for now, so that using a later CLI with old server doesn't result in a deserialization error.
Not strictly necessary, but simple to do.
@@ -39,6 +40,7 @@ private EntityUtil() { | |||
|
|||
public static List<FieldInfo> buildSourceSchemaEntity(final LogicalSchema schema) { | |||
final List<FieldInfo> allFields = schema.columns().stream() | |||
.filter(f -> f.namespace() != Namespace.META) |
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.
This filters ROWTIME
from the schema returned by DESCRIBE
etc.
@@ -55,7 +55,6 @@ public static LogicalSchema buildSchema( | |||
} | |||
|
|||
return builder | |||
.valueColumns(schema.metadata()) |
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.
These changes remove ROWTIME
from pull queries that use select *
.
final Stream<Column> keys = columns.stream() | ||
.filter(c -> schema.isKeyColumn(c.name())); | ||
|
||
final List<Column> all = partitioned.get(true); | ||
all.addAll(partitioned.get(false)); | ||
return all.stream().map(Column::name); | ||
final Stream<Column> windowBounds = columns.stream() | ||
.filter(c -> SchemaUtil.isWindowBound(c.name())); | ||
|
||
final Stream<Column> values = columns.stream() | ||
.filter(c -> !SchemaUtil.isWindowBound(c.name())) | ||
.filter(c -> !schema.isKeyColumn(c.name())) | ||
.filter(c -> !schema.isMetaColumn(c.name())); | ||
|
||
return Streams.concat(keys, windowBounds, values).map(Column::name); |
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.
This change excludes ROWTIME
from push / persistent queries that use *
in the projection.
Conflicting files ksqldb-rest-app/src/test/java/io/confluent/ksql/rest/server/resources/streaming/WebSocketSubscriberTest.java
Conflicting files ksqldb-engine/src/test/java/io/confluent/ksql/planner/plan/DataSourceNodeTest.java
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, thanks for the update!
Description
fixes: #3734
implements KLIP 14 - ROWTIME as Pseudocolumn
BREAKING CHANGE:
Select star, i.e.
select *
, no longer expands to includeROWTIME
column(s). Instead,ROWTIME
is only included in the results of queries if explicitly included in the projection, e.g.select rowtime, *
.This only affects new statements. Any view previously created via a
CREATE STREAM AS SELECT
orCREATE TABLE AS SELECT
statement is unaffected.Reviewing notes:
PR broken down into separate commits:
Testing done
usual.
Reviewer checklist