Skip to content
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: primitive keys for simple queries #4096

Merged

Conversation

big-andy-coates
Copy link
Contributor

@big-andy-coates big-andy-coates commented Dec 10, 2019

Description

fixes: #3534

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.

Testing done

Example queries added to key-schemas.json, which is a good place to start reviewing.

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

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.
@big-andy-coates big-andy-coates requested a review from a team as a code owner December 10, 2019 11:26
Copy link
Contributor

@purplefox purplefox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@stevenpyzhang stevenpyzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are copy paste errors in the exception messages.

@@ -93,6 +94,10 @@ public JoinNode(
: KeyField.of(leftKeyCol.ref());

this.schema = JoinParamsFactory.createSchema(left.getSchema(), right.getSchema());

if (schema.key().get(0).type().baseType() != SqlBaseType.STRING) {
throw new KsqlException("GROUP BY is not supported with non-STRING keys");
Copy link
Member

@stevenpyzhang stevenpyzhang Dec 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "JOIN is not supported"?

@@ -45,6 +47,10 @@ public RepartitionNode(
this.source = Objects.requireNonNull(source, "source");
this.partitionBy = Objects.requireNonNull(partitionBy, "partitionBy");
this.keyField = Objects.requireNonNull(keyField, "keyField");

if (source.getSchema().key().get(0).type().baseType() != SqlBaseType.STRING) {
throw new KsqlException("GROUP BY is not supported with non-STRING keys");
Copy link
Member

@stevenpyzhang stevenpyzhang Dec 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "PARTITION BY is not supported"?

Copy link
Member

@stevenpyzhang stevenpyzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, you fixed the error messages in the stacked #4098
LGTM then

@big-andy-coates big-andy-coates merged commit 8dbfbb7 into confluentinc:master Dec 10, 2019
@big-andy-coates big-andy-coates deleted the simple_primitive branch December 10, 2019 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Primitive keys: Support INT, BIGINT, DOUBLE and STRING in simple queries
3 participants