gaborkaszab commented on code in PR #12461:
URL: https://github.com/apache/iceberg/pull/12461#discussion_r1995470121


##########
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCatalog.java:
##########
@@ -1048,6 +1050,8 @@ public void testSetSnapshotSummary() throws Exception {
   @Test
   public void testNotExposeTableProperties() {
     Configuration conf = new Configuration();
+    long maxHiveTablePropertySize =
+        conf.getLong(HIVE_TABLE_PROPERTY_MAX_SIZE, 
HIVE_TABLE_PROPERTY_MAX_SIZE_DEFAULT);

Review Comment:
   We seem to set the "iceberg.hive.table-property-max-size" conf to null, but 
in this line we also populate a variable for this purpose. I don't think that 
we need to se the conf anymore, since this is an input param into 
setSnapshotStats() now.
   Can't you just set long 'maxHiveTablePropertySize = <some value>'?



##########
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCatalog.java:
##########
@@ -1028,7 +1030,7 @@ public void testSetSnapshotSummary() throws Exception {
     }
     
assertThat(JsonUtil.mapper().writeValueAsString(summary).length()).isLessThan(4000);
     Map<String, String> parameters = Maps.newHashMap();
-    ops.setSnapshotSummary(parameters, snapshot);
+    ops.getIcebergTableConverter().setSnapshotSummary(parameters, snapshot);

Review Comment:
   Haven't you removed getIcebergTableConverter()? Does this code compile?



##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HMSTablePropertyHelper.java:
##########
@@ -0,0 +1,189 @@
+/*
+ * 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.hive;
+
+import java.util.Locale;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import org.apache.hadoop.hive.common.StatsSetupConst;
+import org.apache.hadoop.hive.metastore.api.Table;
+import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants;
+import 
org.apache.hive.iceberg.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.iceberg.BaseMetastoreTableOperations;
+import org.apache.iceberg.PartitionSpecParser;
+import org.apache.iceberg.Schema;
+import org.apache.iceberg.SchemaParser;
+import org.apache.iceberg.Snapshot;
+import org.apache.iceberg.SnapshotSummary;
+import org.apache.iceberg.SortOrderParser;
+import org.apache.iceberg.TableMetadata;
+import org.apache.iceberg.TableProperties;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
+import org.apache.iceberg.relocated.com.google.common.collect.BiMap;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableBiMap;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.util.JsonUtil;
+import org.apache.parquet.hadoop.ParquetOutputFormat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.apache.iceberg.TableProperties.GC_ENABLED;
+
+public class HMSTablePropertyHelper {
+  private static final Logger LOG = 
LoggerFactory.getLogger(HMSTablePropertyHelper.class);
+
+  private static final String HIVE_ICEBERG_METADATA_REFRESH_MAX_RETRIES = 
"iceberg.hive.metadata-refresh-max-retries";
+  private static final int HIVE_ICEBERG_METADATA_REFRESH_MAX_RETRIES_DEFAULT = 
2;
+  public static final String TABLE_TYPE_PROP = "table_type";
+  public static final String ICEBERG_TABLE_TYPE_VALUE = "iceberg";
+
+  private static final BiMap<String, String> ICEBERG_TO_HMS_TRANSLATION = 
ImmutableBiMap.of(
+      // gc.enabled in Iceberg and external.table.purge in Hive are meant to 
do the same things
+      // but with different names
+      GC_ENABLED, "external.table.purge", TableProperties.PARQUET_COMPRESSION, 
ParquetOutputFormat.COMPRESSION,
+      TableProperties.PARQUET_ROW_GROUP_SIZE_BYTES, 
ParquetOutputFormat.BLOCK_SIZE);
+
+
+  public static void setHmsTableParameters(String newMetadataLocation, Table 
tbl, TableMetadata metadata,
+      Set<String> obsoleteProps, boolean hiveEngineEnabled, long 
maxHiveTablePropertySize) {
+    Map<String, String> parameters = 
Optional.ofNullable(tbl.getParameters()).orElseGet(Maps::newHashMap);
+    Map<String, String> summary = 
Optional.ofNullable(metadata.currentSnapshot()).map(Snapshot::summary)
+        .orElseGet(ImmutableMap::of);
+    // push all Iceberg table properties into HMS
+    metadata.properties().entrySet().stream()
+        .filter(entry -> 
!entry.getKey().equalsIgnoreCase(HiveCatalog.HMS_TABLE_OWNER)).forEach(entry -> 
{
+          String key = entry.getKey();
+          // translate key names between Iceberg and HMS where needed
+          String hmsKey = ICEBERG_TO_HMS_TRANSLATION.getOrDefault(key, key);
+          parameters.put(hmsKey, entry.getValue());
+        });
+    if (metadata.uuid() != null) {
+      parameters.put(TableProperties.UUID, metadata.uuid());
+    }
+
+    // remove any props from HMS that are no longer present in Iceberg table 
props
+    if (obsoleteProps != null) {
+      obsoleteProps.forEach(parameters::remove);
+    }
+    parameters.put(TABLE_TYPE_PROP, 
ICEBERG_TABLE_TYPE_VALUE.toUpperCase(Locale.ENGLISH));
+    parameters.put(BaseMetastoreTableOperations.METADATA_LOCATION_PROP, 
newMetadataLocation);
+
+
+    setStorageHandler(parameters, hiveEngineEnabled);
+
+    // Set the basic statistics
+    if (summary.get(SnapshotSummary.TOTAL_DATA_FILES_PROP) != null) {
+      parameters.put(StatsSetupConst.NUM_FILES, 
summary.get(SnapshotSummary.TOTAL_DATA_FILES_PROP));
+    }
+    if (summary.get(SnapshotSummary.TOTAL_RECORDS_PROP) != null) {
+      parameters.put(StatsSetupConst.ROW_COUNT, 
summary.get(SnapshotSummary.TOTAL_RECORDS_PROP));
+    }
+    if (summary.get(SnapshotSummary.TOTAL_FILE_SIZE_PROP) != null) {
+      parameters.put(StatsSetupConst.TOTAL_SIZE, 
summary.get(SnapshotSummary.TOTAL_FILE_SIZE_PROP));
+    }
+
+    setSnapshotStats(metadata, parameters, maxHiveTablePropertySize);
+    setSchema(metadata.schema(), parameters, maxHiveTablePropertySize);
+    setPartitionSpec(metadata, parameters, maxHiveTablePropertySize);
+    setSortOrder(metadata, parameters, maxHiveTablePropertySize);
+
+    tbl.setParameters(parameters);
+  }
+
+  private static void setStorageHandler(Map<String, String> parameters, 
boolean hiveEngineEnabled) {
+    // If needed set the 'storage_handler' property to enable query from Hive
+    if (hiveEngineEnabled) {
+      parameters.put(hive_metastoreConstants.META_TABLE_STORAGE, 
HiveOperationsBase.HIVE_ICEBERG_STORAGE_HANDLER);
+    } else {
+      parameters.remove(hive_metastoreConstants.META_TABLE_STORAGE);
+    }
+  }
+
+  @VisibleForTesting
+  static void setSnapshotStats(TableMetadata metadata, Map<String, String> 
parameters, long maxHiveTablePropertySize) {
+    parameters.remove(TableProperties.CURRENT_SNAPSHOT_ID);
+    parameters.remove(TableProperties.CURRENT_SNAPSHOT_TIMESTAMP);
+    parameters.remove(TableProperties.CURRENT_SNAPSHOT_SUMMARY);
+
+    Snapshot currentSnapshot = metadata.currentSnapshot();
+    if (exposeInHmsProperties(maxHiveTablePropertySize) && currentSnapshot != 
null) {
+      parameters.put(TableProperties.CURRENT_SNAPSHOT_ID, 
String.valueOf(currentSnapshot.snapshotId()));
+      parameters.put(TableProperties.CURRENT_SNAPSHOT_TIMESTAMP, 
String.valueOf(currentSnapshot.timestampMillis()));
+      setSnapshotSummary(parameters, currentSnapshot, 
maxHiveTablePropertySize);
+    }
+
+    parameters.put(TableProperties.SNAPSHOT_COUNT, 
String.valueOf(metadata.snapshots().size()));
+  }
+
+  @VisibleForTesting
+  static void setSnapshotSummary(Map<String, String> parameters, Snapshot 
currentSnapshot, long maxHiveTablePropertySize) {
+    try {
+      String summary = 
JsonUtil.mapper().writeValueAsString(currentSnapshot.summary());
+      if (summary.length() <= maxHiveTablePropertySize) {
+        parameters.put(TableProperties.CURRENT_SNAPSHOT_SUMMARY, summary);
+      } else {
+        LOG.warn("Not exposing the current snapshot({}) summary in HMS since 
it exceeds {} characters",
+            currentSnapshot.snapshotId(), maxHiveTablePropertySize);
+      }
+    } catch (JsonProcessingException e) {
+      LOG.warn("Failed to convert current snapshot({}) summary to a json 
string", currentSnapshot.snapshotId(), e);
+    }
+  }
+
+  @VisibleForTesting
+  static void setPartitionSpec(TableMetadata metadata, Map<String, String> 
parameters,long maxHiveTablePropertySize) {
+    parameters.remove(TableProperties.DEFAULT_PARTITION_SPEC);
+    if (exposeInHmsProperties(maxHiveTablePropertySize) && metadata.spec() != 
null && metadata.spec().isPartitioned()) {
+      String spec = PartitionSpecParser.toJson(metadata.spec());
+      setField(parameters, TableProperties.DEFAULT_PARTITION_SPEC, spec, 
maxHiveTablePropertySize);
+    }
+  }
+
+  @VisibleForTesting
+  static void setSortOrder(TableMetadata metadata, Map<String, String> 
parameters, long maxHiveTablePropertySize) {
+    parameters.remove(TableProperties.DEFAULT_SORT_ORDER);
+    if (exposeInHmsProperties(maxHiveTablePropertySize) && 
metadata.sortOrder() != null && metadata.sortOrder().isSorted()) {
+      String sortOrder = SortOrderParser.toJson(metadata.sortOrder());
+      setField(parameters, TableProperties.DEFAULT_SORT_ORDER, sortOrder, 
maxHiveTablePropertySize);
+    }
+  }
+
+  static private void setSchema(Schema schema, Map<String, String> 
parameters,long maxHiveTablePropertySize) {
+    parameters.remove(TableProperties.CURRENT_SCHEMA);
+    if (exposeInHmsProperties(maxHiveTablePropertySize) && schema != null) {
+      String jsonSchema = SchemaParser.toJson(schema);
+      setField(parameters, TableProperties.CURRENT_SCHEMA, jsonSchema, 
maxHiveTablePropertySize);
+    }
+  }
+
+  static private void setField(Map<String, String> parameters, String key, 
String value,long maxHiveTablePropertySize) {
+    if (value.length() <= maxHiveTablePropertySize) {
+      parameters.put(key, value);
+    } else {
+      LOG.warn("Not exposing {} in HMS since it exceeds {} characters", key, 
maxHiveTablePropertySize);
+    }
+  }
+
+  static boolean exposeInHmsProperties(long maxHiveTablePropertySize) {

Review Comment:
   All the occurences of this function are moved into this helper class, right? 
Can't you drop the one in HiveOperationsBase?



##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HMSTablePropertyHelper.java:
##########
@@ -0,0 +1,189 @@
+/*
+ * 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.hive;
+
+import java.util.Locale;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import org.apache.hadoop.hive.common.StatsSetupConst;
+import org.apache.hadoop.hive.metastore.api.Table;
+import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants;
+import 
org.apache.hive.iceberg.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.iceberg.BaseMetastoreTableOperations;
+import org.apache.iceberg.PartitionSpecParser;
+import org.apache.iceberg.Schema;
+import org.apache.iceberg.SchemaParser;
+import org.apache.iceberg.Snapshot;
+import org.apache.iceberg.SnapshotSummary;
+import org.apache.iceberg.SortOrderParser;
+import org.apache.iceberg.TableMetadata;
+import org.apache.iceberg.TableProperties;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
+import org.apache.iceberg.relocated.com.google.common.collect.BiMap;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableBiMap;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.util.JsonUtil;
+import org.apache.parquet.hadoop.ParquetOutputFormat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.apache.iceberg.TableProperties.GC_ENABLED;
+
+public class HMSTablePropertyHelper {
+  private static final Logger LOG = 
LoggerFactory.getLogger(HMSTablePropertyHelper.class);
+
+  private static final String HIVE_ICEBERG_METADATA_REFRESH_MAX_RETRIES = 
"iceberg.hive.metadata-refresh-max-retries";
+  private static final int HIVE_ICEBERG_METADATA_REFRESH_MAX_RETRIES_DEFAULT = 
2;
+  public static final String TABLE_TYPE_PROP = "table_type";
+  public static final String ICEBERG_TABLE_TYPE_VALUE = "iceberg";
+
+  private static final BiMap<String, String> ICEBERG_TO_HMS_TRANSLATION = 
ImmutableBiMap.of(
+      // gc.enabled in Iceberg and external.table.purge in Hive are meant to 
do the same things
+      // but with different names
+      GC_ENABLED, "external.table.purge", TableProperties.PARQUET_COMPRESSION, 
ParquetOutputFormat.COMPRESSION,
+      TableProperties.PARQUET_ROW_GROUP_SIZE_BYTES, 
ParquetOutputFormat.BLOCK_SIZE);
+
+
+  public static void setHmsTableParameters(String newMetadataLocation, Table 
tbl, TableMetadata metadata,
+      Set<String> obsoleteProps, boolean hiveEngineEnabled, long 
maxHiveTablePropertySize) {
+    Map<String, String> parameters = 
Optional.ofNullable(tbl.getParameters()).orElseGet(Maps::newHashMap);
+    Map<String, String> summary = 
Optional.ofNullable(metadata.currentSnapshot()).map(Snapshot::summary)
+        .orElseGet(ImmutableMap::of);
+    // push all Iceberg table properties into HMS
+    metadata.properties().entrySet().stream()
+        .filter(entry -> 
!entry.getKey().equalsIgnoreCase(HiveCatalog.HMS_TABLE_OWNER)).forEach(entry -> 
{
+          String key = entry.getKey();
+          // translate key names between Iceberg and HMS where needed
+          String hmsKey = ICEBERG_TO_HMS_TRANSLATION.getOrDefault(key, key);
+          parameters.put(hmsKey, entry.getValue());
+        });
+    if (metadata.uuid() != null) {
+      parameters.put(TableProperties.UUID, metadata.uuid());
+    }
+
+    // remove any props from HMS that are no longer present in Iceberg table 
props
+    if (obsoleteProps != null) {
+      obsoleteProps.forEach(parameters::remove);
+    }
+    parameters.put(TABLE_TYPE_PROP, 
ICEBERG_TABLE_TYPE_VALUE.toUpperCase(Locale.ENGLISH));
+    parameters.put(BaseMetastoreTableOperations.METADATA_LOCATION_PROP, 
newMetadataLocation);
+
+
+    setStorageHandler(parameters, hiveEngineEnabled);
+
+    // Set the basic statistics
+    if (summary.get(SnapshotSummary.TOTAL_DATA_FILES_PROP) != null) {
+      parameters.put(StatsSetupConst.NUM_FILES, 
summary.get(SnapshotSummary.TOTAL_DATA_FILES_PROP));
+    }
+    if (summary.get(SnapshotSummary.TOTAL_RECORDS_PROP) != null) {
+      parameters.put(StatsSetupConst.ROW_COUNT, 
summary.get(SnapshotSummary.TOTAL_RECORDS_PROP));
+    }
+    if (summary.get(SnapshotSummary.TOTAL_FILE_SIZE_PROP) != null) {
+      parameters.put(StatsSetupConst.TOTAL_SIZE, 
summary.get(SnapshotSummary.TOTAL_FILE_SIZE_PROP));
+    }
+
+    setSnapshotStats(metadata, parameters, maxHiveTablePropertySize);
+    setSchema(metadata.schema(), parameters, maxHiveTablePropertySize);
+    setPartitionSpec(metadata, parameters, maxHiveTablePropertySize);
+    setSortOrder(metadata, parameters, maxHiveTablePropertySize);
+
+    tbl.setParameters(parameters);
+  }
+
+  private static void setStorageHandler(Map<String, String> parameters, 
boolean hiveEngineEnabled) {
+    // If needed set the 'storage_handler' property to enable query from Hive
+    if (hiveEngineEnabled) {
+      parameters.put(hive_metastoreConstants.META_TABLE_STORAGE, 
HiveOperationsBase.HIVE_ICEBERG_STORAGE_HANDLER);
+    } else {
+      parameters.remove(hive_metastoreConstants.META_TABLE_STORAGE);
+    }
+  }
+
+  @VisibleForTesting
+  static void setSnapshotStats(TableMetadata metadata, Map<String, String> 
parameters, long maxHiveTablePropertySize) {
+    parameters.remove(TableProperties.CURRENT_SNAPSHOT_ID);
+    parameters.remove(TableProperties.CURRENT_SNAPSHOT_TIMESTAMP);
+    parameters.remove(TableProperties.CURRENT_SNAPSHOT_SUMMARY);
+
+    Snapshot currentSnapshot = metadata.currentSnapshot();
+    if (exposeInHmsProperties(maxHiveTablePropertySize) && currentSnapshot != 
null) {
+      parameters.put(TableProperties.CURRENT_SNAPSHOT_ID, 
String.valueOf(currentSnapshot.snapshotId()));
+      parameters.put(TableProperties.CURRENT_SNAPSHOT_TIMESTAMP, 
String.valueOf(currentSnapshot.timestampMillis()));
+      setSnapshotSummary(parameters, currentSnapshot, 
maxHiveTablePropertySize);
+    }
+
+    parameters.put(TableProperties.SNAPSHOT_COUNT, 
String.valueOf(metadata.snapshots().size()));
+  }
+
+  @VisibleForTesting
+  static void setSnapshotSummary(Map<String, String> parameters, Snapshot 
currentSnapshot, long maxHiveTablePropertySize) {
+    try {
+      String summary = 
JsonUtil.mapper().writeValueAsString(currentSnapshot.summary());
+      if (summary.length() <= maxHiveTablePropertySize) {
+        parameters.put(TableProperties.CURRENT_SNAPSHOT_SUMMARY, summary);
+      } else {
+        LOG.warn("Not exposing the current snapshot({}) summary in HMS since 
it exceeds {} characters",
+            currentSnapshot.snapshotId(), maxHiveTablePropertySize);
+      }
+    } catch (JsonProcessingException e) {
+      LOG.warn("Failed to convert current snapshot({}) summary to a json 
string", currentSnapshot.snapshotId(), e);
+    }
+  }
+
+  @VisibleForTesting
+  static void setPartitionSpec(TableMetadata metadata, Map<String, String> 
parameters,long maxHiveTablePropertySize) {
+    parameters.remove(TableProperties.DEFAULT_PARTITION_SPEC);
+    if (exposeInHmsProperties(maxHiveTablePropertySize) && metadata.spec() != 
null && metadata.spec().isPartitioned()) {
+      String spec = PartitionSpecParser.toJson(metadata.spec());
+      setField(parameters, TableProperties.DEFAULT_PARTITION_SPEC, spec, 
maxHiveTablePropertySize);
+    }
+  }
+
+  @VisibleForTesting
+  static void setSortOrder(TableMetadata metadata, Map<String, String> 
parameters, long maxHiveTablePropertySize) {
+    parameters.remove(TableProperties.DEFAULT_SORT_ORDER);
+    if (exposeInHmsProperties(maxHiveTablePropertySize) && 
metadata.sortOrder() != null && metadata.sortOrder().isSorted()) {
+      String sortOrder = SortOrderParser.toJson(metadata.sortOrder());
+      setField(parameters, TableProperties.DEFAULT_SORT_ORDER, sortOrder, 
maxHiveTablePropertySize);
+    }
+  }
+
+  static private void setSchema(Schema schema, Map<String, String> 
parameters,long maxHiveTablePropertySize) {

Review Comment:
   I've double checked that `setSchema()` and `setField()` functions are part 
of `HiveOperationsBase`, and with this PR they would be duplicated here. I 
don't think we want to introduce code duplication with a refactor change. 
Refactors are meant to clean up code and not introduce duplicate code that 
needs further cleanup.
   
   I hear you opinion on why you copy-pasted them here. However, I think this 
refactor could work in case it leaves the code in a cleaner state than before. 
I checked that these duplicated functions are needed for 
`HiveViewOperations.setHmsTableParameters()`. I propose to move that function 
as well into this helper class, and then these duplicated functions could be 
dropped from `HiveOperationsBase`.



##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java:
##########
@@ -230,12 +220,12 @@ protected void doCommit(TableMetadata base, TableMetadata 
metadata) {
                 .collect(Collectors.toSet());
       }
 
-      Map<String, String> summary =
-          Optional.ofNullable(metadata.currentSnapshot())
-              .map(Snapshot::summary)
-              .orElseGet(ImmutableMap::of);
-      setHmsTableParameters(
-          newMetadataLocation, tbl, metadata, removedProps, hiveEngineEnabled, 
summary);
+      icebergTableConverter.setHmsTableParameters(newMetadataLocation, tbl,
+          metadata, removedProps, hiveEngineEnabled);
+      if (currentMetadataLocation() != null && 
!currentMetadataLocation().isEmpty()) {

Review Comment:
   But now you have a helper class that sets the table properties needed for 
HMS except this one. Hard to argue why this shouldn't go into the helper class. 
When someone will also use the helper class, how would they know that it 
doesn't set everything and they have to set this one separately?



##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HMSTablePropertyHelper.java:
##########
@@ -0,0 +1,189 @@
+/*
+ * 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.hive;
+
+import java.util.Locale;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import org.apache.hadoop.hive.common.StatsSetupConst;
+import org.apache.hadoop.hive.metastore.api.Table;
+import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants;
+import 
org.apache.hive.iceberg.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.iceberg.BaseMetastoreTableOperations;
+import org.apache.iceberg.PartitionSpecParser;
+import org.apache.iceberg.Schema;
+import org.apache.iceberg.SchemaParser;
+import org.apache.iceberg.Snapshot;
+import org.apache.iceberg.SnapshotSummary;
+import org.apache.iceberg.SortOrderParser;
+import org.apache.iceberg.TableMetadata;
+import org.apache.iceberg.TableProperties;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
+import org.apache.iceberg.relocated.com.google.common.collect.BiMap;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableBiMap;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.util.JsonUtil;
+import org.apache.parquet.hadoop.ParquetOutputFormat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.apache.iceberg.TableProperties.GC_ENABLED;
+
+public class HMSTablePropertyHelper {
+  private static final Logger LOG = 
LoggerFactory.getLogger(HMSTablePropertyHelper.class);
+
+  private static final String HIVE_ICEBERG_METADATA_REFRESH_MAX_RETRIES = 
"iceberg.hive.metadata-refresh-max-retries";

Review Comment:
   ni: this line seems too long. Have you run a full build locally to catch all 
the formatting issues?



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to