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

PERIOD should be a non-reserved keyword #8591

Closed
mikebin opened this issue Jan 12, 2022 · 0 comments
Closed

PERIOD should be a non-reserved keyword #8591

mikebin opened this issue Jan 12, 2022 · 0 comments
Assignees
Labels
bug needs-triage P0 Denotes must-have for a given milestone

Comments

@mikebin
Copy link

mikebin commented Jan 12, 2022

Describe the bug
When upgrading from ksqlDB 5.5.x to 6.0.x+, if an existing query uses a field named PERIOD, ksqlDB fails to parse the query in the command topic in the new version. Upgrades should be able to execute existing queries without any changes. PERIOD was added as a keyword in 6.0.x to support GRACE PERIOD, but was not added a non-reserved word, which leads to this issue.

To Reproduce
ksqlDB version: 6.0.x+

Define the following query in ksqlDB 5.5.x:

create stream s as select level as PERIOD from ksql_processing_log emit changes;

Upgade ksqlDB in place (keeping same command topic) to 6.0.x, and start the server.

Expected behavior
Server starts and executes all existing queries successfully.

Actual behaviour
Exception parsing statement in ksqlDB command topic:

[2022-01-12 13:32:22,465] INFO Incompatible command record detected when processing command topic (io.confluent.ksql.rest.server.computation.CommandRunner:382)
org.apache.kafka.common.errors.SerializationException: com.fasterxml.jackson.databind.JsonMappingException: line 1:10: mismatched input 'PERIOD' expecting {'EMIT', 'CHANGES', 'FINAL', 'ESCAPE', 'INTEGER', 'DATE', 'TIME', 'TIMESTAMP', 'INTERVAL', 'YEAR', 'MONTH', 'DAY', 'HOUR', 'MINUTE', 'SECOND', 'ZONE', 'PARTITION', 'STRUCT', 'EXPLAIN', 'ANALYZE', 'TYPE', 'TYPES', 'SHOW', 'TABLES', 'COLUMNS', 'COLUMN', 'PARTITIONS', 'FUNCTIONS', 'FUNCTION', 'ARRAY', 'MAP', 'SET', 'RESET', 'SESSION', 'KEY', 'SINK', 'SOURCE', 'PRIMARY', 'REPLACE', 'ASSERT', 'ADD', 'ALTER', 'IF', IDENTIFIER, DIGIT_IDENTIFIER, QUOTED_IDENTIFIER, BACKQUOTED_IDENTIFIER, VARIABLE} (through reference chain: io.confluent.ksql.rest.server.computation.Command["plan"]->io.confluent.ksql.engine.KsqlPlanV1["queryPlan"]->io.confluent.ksql.engine.QueryPlan["physicalPlan"]->io.confluent.ksql.execution.plan.StreamSink["source"]->io.confluent.ksql.execution.plan.StreamSelect["selectExpressions"]->java.util.ArrayList[0])
Caused by: com.fasterxml.jackson.databind.JsonMappingException: line 1:10: mismatched input 'PERIOD' expecting {'EMIT', 'CHANGES', 'FINAL', 'ESCAPE', 'INTEGER', 'DATE', 'TIME', 'TIMESTAMP', 'INTERVAL', 'YEAR', 'MONTH', 'DAY', 'HOUR', 'MINUTE', 'SECOND', 'ZONE', 'PARTITION', 'STRUCT', 'EXPLAIN', 'ANALYZE', 'TYPE', 'TYPES', 'SHOW', 'TABLES', 'COLUMNS', 'COLUMN', 'PARTITIONS', 'FUNCTIONS', 'FUNCTION', 'ARRAY', 'MAP', 'SET', 'RESET', 'SESSION', 'KEY', 'SINK', 'SOURCE', 'PRIMARY', 'REPLACE', 'ASSERT', 'ADD', 'ALTER', 'IF', IDENTIFIER, DIGIT_IDENTIFIER, QUOTED_IDENTIFIER, BACKQUOTED_IDENTIFIER, VARIABLE} (through reference chain: io.confluent.ksql.rest.server.computation.Command["plan"]->io.confluent.ksql.engine.KsqlPlanV1["queryPlan"]->io.confluent.ksql.engine.QueryPlan["physicalPlan"]->io.confluent.ksql.execution.plan.StreamSink["source"]->io.confluent.ksql.execution.plan.StreamSelect["selectExpressions"]->java.util.ArrayList[0])

Additional context

@guozhangwang guozhangwang added the P0 Denotes must-have for a given milestone label Jan 12, 2022
@agavra agavra self-assigned this Jan 13, 2022
@agavra agavra closed this as completed Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-triage P0 Denotes must-have for a given milestone
Projects
None yet
Development

No branches or pull requests

3 participants