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

fix: support partial schemas #4625

Merged

Conversation

big-andy-coates
Copy link
Contributor

Description

fixes: #4566

With this change users can now supply just the key schema and use schema inference to get the value columns. For example, if the key is an INT serialized using Kafka's IntegerSerializer and the value is an Avro record with the schema stored in the Scheme Registry, then such a stream can be registered in ksqlDB with a statement such as:

-- note: only the key columns are provided between the first set of brackets
-- the value columns will be inferred from the Avro schema in the Schema Registry
CREATE STREAM users (ROWKEY INT KET) WITH (kafka_topic='users', value_format='avro');

Testing done

QTT tests added.

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

fixes: confluentinc#4566

With this change users can now supply just the key schema and use schema inference to get the value columns. For example, if the key is an `INT` serialized using Kafka's `IntegerSerializer` and the value is an Avro record with the schema stored in the Scheme Registry, then such a stream can be registered in ksqlDB with a statement such as:

```sql
-- note: only the key columns are provided between the first set of brackets
-- the value columns will be inferred from the Avro schema in the Schema Registry
CREATE STREAM users (ROWKEY INT KET) WITH (kafka_topic='users', value_format='avro');
```
@big-andy-coates big-andy-coates requested a review from a team as a code owner February 25, 2020 17:33
Copy link
Contributor

@agavra agavra left a comment

Choose a reason for hiding this comment

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

LGTM! it'll be neat when we also support schema inference for keys :)

@agavra
Copy link
Contributor

agavra commented Feb 25, 2020

Should this target 5.5.x?

@big-andy-coates
Copy link
Contributor Author

Should this target 5.5.x?

I'll merge to 5.5.x once its in. I fundamentally disagree with working in release branches.

@big-andy-coates big-andy-coates merged commit 4f1ce8a into confluentinc:master Feb 26, 2020
@big-andy-coates big-andy-coates deleted the partial_schema_inference branch February 26, 2020 13:15
big-andy-coates added a commit that referenced this pull request Feb 26, 2020
fixes: #4566

With this change users can now supply just the key schema and use schema inference to get the value columns. For example, if the key is an `INT` serialized using Kafka's `IntegerSerializer` and the value is an Avro record with the schema stored in the Scheme Registry, then such a stream can be registered in ksqlDB with a statement such as:

```sql
-- note: only the key columns are provided between the first set of brackets
-- the value columns will be inferred from the Avro schema in the Schema Registry
CREATE STREAM users (ROWKEY INT KET) WITH (kafka_topic='users', value_format='avro');
```

(cherry picked from commit 4f1ce8a)
@big-andy-coates
Copy link
Contributor Author

Merged to 5.5.x

colinhicks pushed a commit that referenced this pull request Feb 27, 2020
fixes: #4566

With this change users can now supply just the key schema and use schema inference to get the value columns. For example, if the key is an `INT` serialized using Kafka's `IntegerSerializer` and the value is an Avro record with the schema stored in the Scheme Registry, then such a stream can be registered in ksqlDB with a statement such as:

```sql
-- note: only the key columns are provided between the first set of brackets
-- the value columns will be inferred from the Avro schema in the Schema Registry
CREATE STREAM users (ROWKEY INT KET) WITH (kafka_topic='users', value_format='avro');
```

(cherry picked from commit 4f1ce8a)
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.

Support partial schemas in CT/CS statements
2 participants