[ 
https://issues.apache.org/jira/browse/HIVE-26102?focusedWorklogId=753977&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-753977
 ]

ASF GitHub Bot logged work on HIVE-26102:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Apr/22 11:00
            Start Date: 07/Apr/22 11:00
    Worklog Time Spent: 10m 
      Work Description: marton-bod commented on code in PR #3131:
URL: https://github.com/apache/hive/pull/3131#discussion_r845001375


##########
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:
   Yes!





Issue Time Tracking
-------------------

    Worklog Id:     (was: 753977)
    Time Spent: 10h 40m  (was: 10.5h)

> Implement DELETE statements for Iceberg tables
> ----------------------------------------------
>
>                 Key: HIVE-26102
>                 URL: https://issues.apache.org/jira/browse/HIVE-26102
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Marton Bod
>            Assignee: Marton Bod
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10h 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to