mayankshriv commented on a change in pull request #5238: Evaluate schema 
transform expressions during ingestion
URL: https://github.com/apache/incubator-pinot/pull/5238#discussion_r408210748
 
 

 ##########
 File path: 
pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroRecordExtractor.java
 ##########
 @@ -18,18 +18,31 @@
  */
 package org.apache.pinot.plugin.inputformat.avro;
 
-import org.apache.avro.generic.GenericData;
-import org.apache.pinot.spi.data.FieldSpec;
-import org.apache.pinot.spi.data.Schema;
-import org.apache.pinot.spi.data.readers.AbstractBaseRecordExtractor;
+import java.util.List;
+import javax.annotation.Nullable;
+import org.apache.avro.generic.GenericRecord;
 import org.apache.pinot.spi.data.readers.GenericRow;
+import org.apache.pinot.spi.data.readers.RecordExtractor;
+import org.apache.pinot.spi.data.readers.RecordExtractorConfig;
+
+
+/**
+ * Extractor for Avro Records
+ */
+public class AvroRecordExtractor implements RecordExtractor<GenericRecord> {
+  private List<String> _fields;
+
+  @Override
+  public void init(List<String> fields, @Nullable RecordExtractorConfig 
recordExtractorConfig) {
+    _fields = fields;
+  }
 
-public class AvroRecordExtractor extends 
AbstractBaseRecordExtractor<GenericData.Record> {
   @Override
-  public GenericRow extract(Schema schema, GenericData.Record from, GenericRow 
to) {
-    for (FieldSpec fieldSpec : schema.getAllFieldSpecs()) {
-      FieldSpec incomingFieldSpec = getFieldSpecToUse(schema, fieldSpec);
-      AvroUtils.extractField(incomingFieldSpec, from, to);
+  public GenericRow extract(GenericRecord from, GenericRow to) {
 
 Review comment:
   So we no longer need source 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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to