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

Json keys #6292

Merged
merged 8 commits into from
Sep 30, 2020
Merged

Json keys #6292

merged 8 commits into from
Sep 30, 2020

Conversation

big-andy-coates
Copy link
Contributor

@big-andy-coates big-andy-coates commented Sep 24, 2020

Description

part of: #6215
fixes: #6214

First pass of adding QTT tests around the JSON key format, including adding tests for DECIMAL and BOOLEAN types, which is the first time they've been used as a key column type.

Commit includes a fix in SerdeOptionsFactory to ensure no key unwrapping is set if there is no key, plus refactored SerdeOptionsFactory, combining the two public methods.

Testing done

usual

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 #")

wip: confluentinc#6215
fixes: confluentinc#6214

First pass of adding QTT tests around the JSON key format, including adding tests for `DECIMAL` and `BOOLEAN` types, which is the first time they've been used as a key column type.

The test around a JSON `DOUBLE` key is currently disabled, due to a limitation of QTT which reads doubles as `BigDecimal`.  Code works, just need to enhance QTT to do the right thing.

Commit includes a fix in `SerdeOptionsFactory` to ensure no key unwrapping is set if there is no key, plus refactored `SerdeOptionsFactory`, combining the two public methods.
@big-andy-coates big-andy-coates requested a review from a team as a code owner September 24, 2020 10:11
Copy link
Contributor

@vcrfxia vcrfxia left a comment

Choose a reason for hiding this comment

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

LGTM though I think it's worth adding a few QTTs for converting between different key formats, both positive and negative such as validating what happens if I start with a JSON boolean key and try converting the key format to KAFKA.

Conflicting files
ksqldb-engine/src/main/java/io/confluent/ksql/ddl/commands/CreateSourceFactory.java
ksqldb-engine/src/main/java/io/confluent/ksql/planner/LogicalPlanner.java
ksqldb-engine/src/main/java/io/confluent/ksql/schema/ksql/inference/SchemaRegisterInjector.java
ksqldb-engine/src/main/java/io/confluent/ksql/serde/SerdeOptionsFactory.java
ksqldb-engine/src/main/java/io/confluent/ksql/structured/SchemaKGroupedStream.java
ksqldb-engine/src/test/java/io/confluent/ksql/serde/SerdeOptionsFactoryTest.java
ksqldb-engine/src/test/java/io/confluent/ksql/structured/SchemaKGroupedStreamTest.java
ksqldb-functional-tests/src/main/java/io/confluent/ksql/test/tools/TestCaseBuilderUtil.java
@big-andy-coates
Copy link
Contributor Author

big-andy-coates commented Oct 1, 2020

LGTM though I think it's worth adding a few QTTs for converting between different key formats, both positive and negative such as validating what happens if I start with a JSON boolean key and try converting the key format to KAFKA.

See #6345 for a test on converting between formats and where the key SQL type isn't supported by the sink key schema.

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.

[JSON Support]: Support DECIMAL and BOOLEAN key types
2 participants