My schema name is different than the topic name

Hi, I am trying to create a streams from some topics. All the topics use the same schema because the only difference is in which region US/EU/ASIA they were created. So the schema name and topic name do not match. It seems that the schema name needs to match the topic name plus subffix “-value”. I have not seem a way to specify the schema name in the create statement. Here is my create stream command:
CREATE STREAM stream_dev_agg_impressions_eu3 WITH ( KAFKA_TOPIC = ‘dev-agg_impressions_eu3’, VALUE_FORMAT = ‘AVRO’);
The error I get is Schema for message values on topic ‘dev-_agg_impressions_eu3’ does not exist in the Schema Registry.
Subject: dev-agg_impressions_eu3-value

The actual subject is consolidated-view-gen-source-value

Your observations is correct.

The good new is, this issue is fixed in upcoming 0.24 release via KLIP-56. It will allow you to specify a schema-id in the WITH clause to fetch a schema from a different subject.

The docs will contain a new section with all the details after the release. If you want to get peak preview, checkout ksql/ at a5bb05d6b31294d1d6f9f1e4ae888d37e505643b · confluentinc/ksql · GitHub

For now, you would need to re-register the schema manually for the expected/correct subject name or explicitly specify the schema in your CREATE STREAM statement.

Thanks for the info. How can I map version 0.24 to the versions on Confluent download page, currently it is 7.0.1.

You can find the mapping in the docs: Supported Versions and Interoperability | Confluent Documentation

Not sure right now if 7.1 will ship with 0.24 release. Stay tuned.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.