jonvex commented on code in PR #11649:
URL: https://github.com/apache/hudi/pull/11649#discussion_r1690063607


##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/HiveHoodieReaderContext.java:
##########
@@ -89,41 +84,17 @@ public class HiveHoodieReaderContext extends 
HoodieReaderContext<ArrayWritable>
   private final String recordKeyField;
 
   protected 
HiveHoodieReaderContext(HoodieFileGroupReaderBasedRecordReader.HiveReaderCreator
 readerCreator,
-                                    InputSplit split,
-                                    JobConf jobConf,
-                                    Reporter reporter,
-                                    Schema writerSchema,
-                                    Map<String, String[]> hosts,
-                                    HoodieTableMetaClient metaClient) {
+                                    String tableName,
+                                    String recordKeyField,
+                                    List<String> partitionCols) {
     this.readerCreator = readerCreator;
-    this.split = split;
-    this.jobConf = jobConf;
-    this.reporter = reporter;
-    this.writerSchema = writerSchema;
-    this.hosts = hosts;
-    this.partitionCols = getPartitionFieldNames(jobConf).stream().filter(n -> 
writerSchema.getField(n) != null).collect(Collectors.toList());
+    this.partitionCols = partitionCols;
     this.partitionColSet = new HashSet<>(this.partitionCols);
-    String tableName = metaClient.getTableConfig().getTableName();
-    recordKeyField = getRecordKeyField(metaClient);
-    this.objectInspectorCache = 
HoodieArrayWritableAvroUtils.getCacheForTable(tableName, writerSchema, jobConf);
+    this.recordKeyField = recordKeyField;
+    this.objectInspectorCache = 
HoodieArrayWritableAvroUtils.getCacheForTable(tableName);
     this.columnTypeMap = objectInspectorCache.getColumnTypeMap();
   }
 
-  /**
-   * If populate meta fields is false, then getRecordKeyFields()
-   * should return exactly 1 recordkey field.
-   */
-  private static String getRecordKeyField(HoodieTableMetaClient metaClient) {

Review Comment:
   moved to filegroup reader record reader



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to