witty-butcher-82399
12/23/2022, 10:29 AMTopicName and TopicRecordName strategy are covered (the second in a sort of best-effort mode).
However, when testing, we have found that we miss many schemas that follow the TopicRecordName strategy.
We had a look to the code here https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/src/datahub/ingestion/source/confluent_schema_registry.py#L72-L78
# Subject name format when the schema registry subject name strategy is
# (a) TopicNameStrategy(default strategy): <topic name>-<key/value>
# (b) TopicRecordNameStrategy: <topic name>-<fully-qualified record name>-<key/value>
for subject in self.known_schema_registry_subjects:
if subject.startswith(topic) and subject.endswith(subject_key_suffix):
return subject
return None
and we think there is a mistake. The code assumes the -(key|value) suffix also exists for TopicRecordName strategy, however this is not true; we have plenty of topics with the following format <topic name>-<fully-qualified record name> for the TopicRecordName strategy.
Is there any serializer supporting this <topic name>-<fully-qualified record name>-<key/value> format?
For example, Confluent AVRO serializer doesn’t https://docs.confluent.io/platform/6.1.2/clients/confluent-kafka-python/html/_modules/confluent_kafka/schema_registry/avro.html
As a mitigation, schema resolution may first try exact match for TopicNameStrategy and if not, do a search only with startswith (no endswith ). But I think that may bring many false positives and no way to differentiate key and value schemas.
So from my understanding, fetching schemas only works for TopicName strategy. I’m raising the concern here in case I’m missing something or if someone else has an idea to fix TopicRecordName strategy. Thanks!
🧵witty-butcher-82399
12/23/2022, 10:34 AMbig-carpet-38439
12/23/2022, 5:44 PMastonishing-answer-96712
01/03/2023, 6:13 PMwitty-butcher-82399
01/09/2023, 2:57 PMTopicRecordNameStrategy strategy has the -(key|value) suffix.
So, AFAIK this is not true.
# (b) TopicRecordNameStrategy: <topic name>-<fully-qualified record name>-<key/value>
Instead it should be:
# (b) TopicRecordNameStrategy: <topic name>-<fully-qualified record name>
This results in DataHub Kafka connector not fetching schemas for topics following that strategy.
I’m just reporting the issue. Additionally, I find it hard to fix since the lack of suffix makes impossible to decide whether found schema (just based on topic name prefix matching) is for the key or for the value.astonishing-answer-96712
01/10/2023, 6:04 PMastonishing-answer-96712
01/10/2023, 6:05 PM