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

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

                Author: ASF GitHub Bot
            Created on: 07/Apr/22 09:48
            Start Date: 07/Apr/22 09:48
    Worklog Time Spent: 10m 
      Work Description: pvary commented on code in PR #3131:
URL: https://github.com/apache/hive/pull/3131#discussion_r844939837


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/IcebergAcidUtil.java:
##########
@@ -0,0 +1,128 @@
+/*
+ * 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.iceberg.mr.hive;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import org.apache.hadoop.hive.ql.io.PositionDeleteInfo;
+import org.apache.iceberg.MetadataColumns;
+import org.apache.iceberg.Schema;
+import org.apache.iceberg.Table;
+import org.apache.iceberg.data.GenericRecord;
+import org.apache.iceberg.data.Record;
+import org.apache.iceberg.deletes.PositionDelete;
+import org.apache.iceberg.relocated.com.google.common.collect.Lists;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.types.Types;
+import org.apache.iceberg.util.StructProjection;
+
+public class IcebergAcidUtil {
+
+  private IcebergAcidUtil() {
+  }
+
+  private static final Types.NestedField PARTITION_STRUCT_META_COL = null; // 
placeholder value in the map
+  private static final Map<Types.NestedField, Integer> 
DELETE_FILEREAD_META_COLS = Maps.newLinkedHashMap();
+
+  static {
+    DELETE_FILEREAD_META_COLS.put(MetadataColumns.SPEC_ID, 0);
+    DELETE_FILEREAD_META_COLS.put(PARTITION_STRUCT_META_COL, 1);
+    DELETE_FILEREAD_META_COLS.put(MetadataColumns.FILE_PATH, 2);
+    DELETE_FILEREAD_META_COLS.put(MetadataColumns.ROW_POSITION, 3);
+  }
+
+  private static final Types.NestedField PARTITION_HASH_META_COL = 
Types.NestedField.required(
+      MetadataColumns.PARTITION_COLUMN_ID, 
MetadataColumns.PARTITION_COLUMN_NAME, Types.LongType.get());
+  private static final Map<Types.NestedField, Integer> DELETE_SERDE_META_COLS 
= Maps.newLinkedHashMap();
+
+  static {
+    DELETE_SERDE_META_COLS.put(MetadataColumns.SPEC_ID, 0);

Review Comment:
   Maybe use ImmutableMap?





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

    Worklog Id:     (was: 753934)
    Time Spent: 9h  (was: 8h 50m)

> 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: 9h
>  Remaining Estimate: 0h
>




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

Reply via email to