hudi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-hudi] pratyakshsharma commented on a change in pull request #765: [WIP] Fix KafkaAvroSource to use the latest schema
Date Mon, 10 Feb 2020 10:29:28 GMT
pratyakshsharma commented on a change in pull request #765: [WIP] Fix KafkaAvroSource to use
the latest schema
URL: https://github.com/apache/incubator-hudi/pull/765#discussion_r376978928
 
 

 ##########
 File path: hoodie-utilities/src/main/java/com/uber/hoodie/utilities/sources/SourceSchemaKafkaAvroDecoder.java
 ##########
 @@ -0,0 +1,66 @@
+package com.uber.hoodie.utilities.sources;
+
+import com.uber.hoodie.common.util.TypedProperties;
+import com.uber.hoodie.utilities.UtilHelpers;
+import com.uber.hoodie.utilities.schema.SchemaProvider;
+import io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer;
+import io.confluent.kafka.serializers.KafkaAvroDeserializerConfig;
+import java.io.IOException;
+import java.util.Map.Entry;
+import java.util.Objects;
+import java.util.Properties;
+import kafka.serializer.Decoder;
+import kafka.utils.VerifiableProperties;
+import org.apache.avro.Schema;
+import org.apache.kafka.common.errors.SerializationException;
+
+/** A Kafka decoder that uses the source schema for read. */
+public class SourceSchemaKafkaAvroDecoder extends AbstractKafkaAvroDeserializer
+    implements Decoder<Object> {
+
+  private static final String SCHEMA_PROVIDER_CLASS_PROP = "hoodie.deltastreamer.schemaprovider.class";
+
+  private final Schema sourceSchema;
+
+  public SourceSchemaKafkaAvroDecoder(VerifiableProperties props) {
+    this.configure(new KafkaAvroDeserializerConfig(props.props()));
+
+    TypedProperties typedProperties = new TypedProperties();
+    copyProperties(typedProperties, props.props());
 
 Review comment:
   can we do away with this function? 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message