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

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

                Author: ASF GitHub Bot
            Created on: 10/May/22 11:41
            Start Date: 10/May/22 11:41
    Worklog Time Spent: 10m 
      Work Description: lcspinter commented on code in PR #3270:
URL: https://github.com/apache/hive/pull/3270#discussion_r869133563


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergMetaHook.java:
##########
@@ -336,6 +336,30 @@ public void 
preAlterTable(org.apache.hadoop.hive.metastore.api.Table hmsTable, E
       // that users can change data types or reorder columns too with this 
alter op type, so its name is misleading..)
       assertNotMigratedTable(hmsTable.getParameters(), "CHANGE COLUMN");
       handleChangeColumn(hmsTable);
+    } else if (AlterTableType.ADDPROPS.equals(currentAlterTableOp)) {
+      assertNotThirdPartyMetadataLocationChange(hmsTable.getParameters());
+    }
+  }
+
+  /**
+   * Perform a check on the current iceberg table whether a metadata change 
can be performed. A table is eligible if
+   * the current metadata uuid and the new metadata uuid matches.
+   * @param tblParams hms table properties, must be non-null
+   */
+  private void assertNotThirdPartyMetadataLocationChange(Map<String, String> 
tblParams) {
+    if 
(tblParams.containsKey(BaseMetastoreTableOperations.METADATA_LOCATION_PROP)) {
+      Preconditions.checkArgument(icebergTable != null,

Review Comment:
   Sure, that can be done. I will add a unit test as well.





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

    Worklog Id:     (was: 768440)
    Time Spent: 1.5h  (was: 1h 20m)

> Implement alter iceberg table metadata location
> -----------------------------------------------
>
>                 Key: HIVE-26203
>                 URL: https://issues.apache.org/jira/browse/HIVE-26203
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: László Pintér
>            Assignee: László Pintér
>            Priority: Major
>              Labels: iceberg, pull-request-available
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to