pvary commented on code in PR #3131:
URL: https://github.com/apache/hive/pull/3131#discussion_r844948586


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/mapreduce/IcebergInputFormat.java:
##########
@@ -484,10 +500,35 @@ private static Schema readSchema(Configuration conf, 
Schema tableSchema, boolean
 
       String[] selectedColumns = InputFormatConfig.selectedColumns(conf);
       if (selectedColumns == null) {
-        return tableSchema;
+        return table.schema();
+      }
+
+      readSchema = caseSensitive ? table.schema().select(selectedColumns) :
+          table.schema().caseInsensitiveSelect(selectedColumns);
+
+      // for DELETE queries, add additional metadata columns into the read 
schema
+      if (HiveIcebergStorageHandler.isDelete(conf, conf.get(Catalogs.NAME))) {
+        readSchema = 
IcebergAcidUtil.createFileReadSchemaForDelete(readSchema.columns(), table);
       }
 
-      return caseSensitive ? tableSchema.select(selectedColumns) : 
tableSchema.caseInsensitiveSelect(selectedColumns);
+      return readSchema;
+    }
+
+    private Schema schemaWithoutConstantsAndMeta(Schema readSchema, 
Map<Integer, ?> idToConstant) {

Review Comment:
   Could this be a static method?



-- 
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]


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

Reply via email to