Skip to content
Permalink
Browse files
HIVE-25139: Filter out null table properties in HiveIcebergMetaHook (#…
…2298) (Laszlo Pinter, reviewed by Marton Bod and Peter Vary)
  • Loading branch information
lcspinter committed May 21, 2021
1 parent 0560177 commit 84c82466fcbae9b49d9bb0d7010bb3884ccf0c38
Showing 1 changed file with 6 additions and 3 deletions.
@@ -297,6 +297,9 @@ private void updateHmsTableProperties(org.apache.hadoop.hive.metastore.api.Table
"Table location not set");
}

// Remove null values from hms table properties
hmsTable.getParameters().entrySet().removeIf(e -> e.getKey() == null || e.getValue() == null);

// Remove creation related properties
PARAMETERS_TO_REMOVE.forEach(hmsTable.getParameters()::remove);
}
@@ -315,10 +318,10 @@ private void updateHmsTableProperties(org.apache.hadoop.hive.metastore.api.Table
private static Properties getCatalogProperties(org.apache.hadoop.hive.metastore.api.Table hmsTable) {
Properties properties = new Properties();

hmsTable.getParameters().forEach((key, value) -> {
hmsTable.getParameters().entrySet().stream().filter(e -> e.getKey() != null && e.getValue() != null).forEach(e -> {
// translate key names between HMS and Iceberg where needed
String icebergKey = HiveTableOperations.translateToIcebergProp(key);
properties.put(icebergKey, value);
String icebergKey = HiveTableOperations.translateToIcebergProp(e.getKey());
properties.put(icebergKey, e.getValue());
});

if (properties.get(Catalogs.LOCATION) == null &&

0 comments on commit 84c8246

Please sign in to comment.