You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2021/08/25 00:58:19 UTC
[GitHub] [gobblin] ZihanLi58 commented on a change in pull request #3372: [GOBBLIN-1521] Create local mode of streaming kafka job to help user quickly onboard
ZihanLi58 commented on a change in pull request #3372:
URL: https://github.com/apache/gobblin/pull/3372#discussion_r695313863
##########
File path: gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaStreamingExtractor.java
##########
@@ -323,8 +323,10 @@ public KafkaStreamingExtractor(WorkUnitState state) {
@Override
public S getSchema() {
try {
- Schema schema = (Schema) this._schemaRegistry.get().getLatestSchemaByTopic(this.topicPartitions.get(0).getTopicName());
- return (S) schema;
+ if(this._schemaRegistry.isPresent()) {
+ return (S)(Schema) this._schemaRegistry.get().getLatestSchemaByTopic(this.topicPartitions.get(0).getTopicName());
+ }
+ return (S) this.topicPartitions.iterator().next().getTopicName();
Review comment:
It's because many converter does not accept null in convertSchema() method. And simply return null will cause issue there. I just use the same behavior as KafkaSimpleStreamingExtractor where if the schema registry is null, we just return topic name as schema
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org