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

Retrieve key schemas from the schema registry #4462

Closed
big-andy-coates opened this issue Feb 6, 2020 · 1 comment
Closed

Retrieve key schemas from the schema registry #4462

big-andy-coates opened this issue Feb 6, 2020 · 1 comment

Comments

@big-andy-coates
Copy link
Contributor

big-andy-coates commented Feb 6, 2020

One we support Avro (/Json) key formats in KSQL we'll need to be able to get their schemas from the schema registry.

@big-andy-coates big-andy-coates added this to Backlog in Primitive Keys via automation Feb 6, 2020
big-andy-coates added a commit to big-andy-coates/ksql that referenced this issue Feb 7, 2020
ksqlDB now supports the following primitive key types: `INT`, `BIGINT`, `DOUBLE` as well as the existing `STRING` type.

The key type can be defined in the CREATE TABLE or CREATE STREAM statement by including a column definition for `ROWKEY` in the form `ROWKEY <primitive-key-type> KEY,`, for example:

```sql
CREATE TABLE USERS (ROWKEY BIGINT KEY, NAME STRING, RATING DOUBLE) WITH (kafka_topic='users', VALUE_FORMAT='json');
```

ksqlDB currently requires the name of the key column to be `ROWKEY`. Support for arbitrary key names is tracked by confluentinc#3536.

ksqlDB currently requires keys to use the `KAFKA` format. Support for additional formats is tracked by https://github.com/confluentinc/ksql/projects/3.

Schema inference currently only works with `STRING` keys, Support for additional key types is tracked by confluentinc#4462. (Schema inference is where ksqlDB infers the schema of a CREATE TABLE and CREATE STREAM statements from the schema registered in the Schema Registry, as opposed to the user supplying the set of columns in the statement).

Apache Kafka Connect can be configured to output keys in the `KAFKA` format by using a Converter, e.g. `"key.converter": "org.apache.kafka.connect.converters.IntegerConverter"`. Details of which converter to use for which key type can be found here: https://docs.confluent.io/current/ksql/docs/developer-guide/serialization.html#kafka in the `Connect Converter` column.

@rmoff has written an introductory blog about primitive keys: https://rmoff.net/2020/02/07/primitive-keys-in-ksqldb/

BREAKING CHANGE: existing queries that perform a PARTITION BY or GROUP BY on a single column of one of the above supported primitive key types will now set the key to the appropriate type, not a `STRING` as previously.
@big-andy-coates big-andy-coates moved this from Backlog to To do in Primitive Keys Feb 7, 2020
@apurvam apurvam added the P0 Denotes must-have for a given milestone label Feb 7, 2020
@apurvam apurvam added this to the 0.8.0 milestone Feb 7, 2020
big-andy-coates added a commit that referenced this issue Feb 7, 2020
* feat: primitive key support

ksqlDB now supports the following primitive key types: `INT`, `BIGINT`, `DOUBLE` as well as the existing `STRING` type.

The key type can be defined in the CREATE TABLE or CREATE STREAM statement by including a column definition for `ROWKEY` in the form `ROWKEY <primitive-key-type> KEY,`, for example:

```sql
CREATE TABLE USERS (ROWKEY BIGINT KEY, NAME STRING, RATING DOUBLE) WITH (kafka_topic='users', VALUE_FORMAT='json');
```

ksqlDB currently requires the name of the key column to be `ROWKEY`. Support for arbitrary key names is tracked by #3536.

ksqlDB currently requires keys to use the `KAFKA` format. Support for additional formats is tracked by https://github.com/confluentinc/ksql/projects/3.

Schema inference currently only works with `STRING` keys, Support for additional key types is tracked by #4462. (Schema inference is where ksqlDB infers the schema of a CREATE TABLE and CREATE STREAM statements from the schema registered in the Schema Registry, as opposed to the user supplying the set of columns in the statement).

Apache Kafka Connect can be configured to output keys in the `KAFKA` format by using a Converter, e.g. `"key.converter": "org.apache.kafka.connect.converters.IntegerConverter"`. Details of which converter to use for which key type can be found here: https://docs.confluent.io/current/ksql/docs/developer-guide/serialization.html#kafka in the `Connect Converter` column.

@rmoff has written an introductory blog about primitive keys: https://rmoff.net/2020/02/07/primitive-keys-in-ksqldb/

BREAKING CHANGE: existing queries that perform a PARTITION BY or GROUP BY on a single column of one of the above supported primitive key types will now set the key to the appropriate type, not a `STRING` as previously.
@apurvam apurvam removed the P0 Denotes must-have for a given milestone label Mar 11, 2020
@vcrfxia vcrfxia modified the milestones: 0.8.0, 0.9.0 Mar 18, 2020
@big-andy-coates big-andy-coates moved this from To do to Backlog in Primitive Keys Apr 6, 2020
@spena spena modified the milestones: 0.9.0, 0.10.0 Apr 27, 2020
@big-andy-coates big-andy-coates modified the milestones: 0.10.0, 0.11.0 May 14, 2020
@big-andy-coates big-andy-coates removed this from the 0.11.0 milestone Jun 23, 2020
@big-andy-coates
Copy link
Contributor Author

Closing as a duplicate of #6222

Primitive Keys automation moved this from Backlog to Done Sep 30, 2020
@big-andy-coates big-andy-coates removed this from Done in Primitive Keys Sep 30, 2020
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

4 participants