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

Key field incorrect when only ROWKEY appears in projection #2743

Closed
big-andy-coates opened this issue Apr 28, 2019 · 1 comment
Closed

Key field incorrect when only ROWKEY appears in projection #2743

big-andy-coates opened this issue Apr 28, 2019 · 1 comment

Comments

@big-andy-coates
Copy link
Contributor

Given a C*AS statement that contains a projection where the key field of the source is not present AND ROWKEY is THEN the key field of the resultant source stored in the metastore is incorrect.

The net result of this is we miss an opportunity to avoid a repartition step on downstream queries that require the source to be (re-)keyed on the field.

e.g.

Given the SQL statement:

-- given 'input' with keyfield 'foo'...
CREATE STREAM INPUT (foo INT, bar INT) WITH (kafka_topic='input_topic', key='foo', value_format='JSON');

-- given 'output' where 'foo' not in projection but 'rowkey' is:
CREATE STREAM OUTPUT AS SELECT ROWKEY AS ID FROM INPUT;

Expected result: The keyField of OUTPUT should be set to ID as this field always matches the key of the output records

Actual result: the keyField of OUTPUT is set to null.

The same is true for joins.

@big-andy-coates
Copy link
Contributor Author

Closing as we've removing WITH(KEY) anyway. #3537

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

No branches or pull requests

1 participant