cdmikechen commented on a change in pull request #3391:
URL: https://github.com/apache/hudi/pull/3391#discussion_r776160563



##########
File path: 
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/avro/HudiAvroParquetReader.java
##########
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.hadoop.avro;
+
+import org.apache.avro.generic.GenericData;
+import org.apache.avro.generic.GenericRecord;
+import org.apache.hadoop.io.ArrayWritable;
+import org.apache.hadoop.mapreduce.InputSplit;
+import org.apache.hadoop.mapreduce.RecordReader;
+import org.apache.hadoop.mapreduce.TaskAttemptContext;
+import org.apache.hudi.hadoop.utils.HoodieRealtimeRecordReaderUtils;
+import org.apache.parquet.avro.AvroReadSupport;
+import org.apache.parquet.filter2.compat.FilterCompat;
+import org.apache.parquet.hadoop.ParquetRecordReader;
+
+import java.io.IOException;
+
+public class HudiAvroParquetReader extends RecordReader<Void, ArrayWritable> {
+
+  private final ParquetRecordReader<GenericData.Record> parquetRecordReader;
+
+  public HudiAvroParquetReader(FilterCompat.Filter filter) {
+    parquetRecordReader = new ParquetRecordReader<>(new AvroReadSupport<>(), 
filter);
+  }
+
+  @Override
+  public void initialize(InputSplit split, TaskAttemptContext context) throws 
IOException, InterruptedException {
+    parquetRecordReader.initialize(split, context);
+  }
+
+  @Override
+  public boolean nextKeyValue() throws IOException, InterruptedException {
+    return parquetRecordReader.nextKeyValue();
+  }
+
+  @Override
+  public Void getCurrentKey() throws IOException, InterruptedException {
+    return parquetRecordReader.getCurrentKey();
+  }
+
+  @Override
+  public ArrayWritable getCurrentValue() throws IOException, 
InterruptedException {
+    GenericRecord record = parquetRecordReader.getCurrentValue();
+    return (ArrayWritable) 
HoodieRealtimeRecordReaderUtils.avroToArrayWritable(record, record.getSchema());

Review comment:
       @vinothchandar 
   I have been running the fork for several months. At present, it does not 
cause too many additional problems. This may be related to the small amount of 
data processed by my hive and the insufficient impact of memory.
   
   At present, the parsing of avro data by hudi spark in 
`org.apache.hudi.AvroConversionHelper` or hive itself in 
`org.apache.hadoop.hive.serde2.avro.AvroGenericRecordWritable` both wrapper 
around an Avro GenericRecord. Normally,  I think data processing should not 
cause serious overhead .




-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to