pvary commented on a change in pull request #2246:
URL: https://github.com/apache/iceberg/pull/2246#discussion_r577590629



##########
File path: mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergSerDe.java
##########
@@ -88,18 +88,24 @@ public void initialize(@Nullable Configuration 
configuration, Properties serDePr
       }
     }
 
-    configuration.setBoolean(InputFormatConfig.CASE_SENSITIVE, false);
-    String[] selectedColumns = 
ColumnProjectionUtils.getReadColumnNames(configuration);
-    // When same table is joined multiple times, it is possible some selected 
columns are duplicated,
-    // in this case wrong recordStructField position leads wrong value or 
ArrayIndexOutOfBoundException
-    String[] distinctSelectedColumns = 
Arrays.stream(selectedColumns).distinct().toArray(String[]::new);
-    Schema projectedSchema = distinctSelectedColumns.length > 0 ?
-            tableSchema.caseInsensitiveSelect(distinctSelectedColumns) : 
tableSchema;
-    // the input split mapper handles does not belong to this table
-    // it is necessary to ensure projectedSchema equals to tableSchema,
-    // or we cannot find selectOperator's column from inspector
-    if (projectedSchema.columns().size() != distinctSelectedColumns.length) {
+    Schema projectedSchema;
+    if (serDeProperties.get(HiveIcebergStorageHandler.WRITE_KEY) != null) {
+      // when writing out data, we should not do projection pushdown
       projectedSchema = tableSchema;
+    } else {
+      configuration.setBoolean(InputFormatConfig.CASE_SENSITIVE, false);

Review comment:
       I think we should leave this config setting outside the if statement




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



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

Reply via email to