You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/05/21 09:16:34 UTC

[GitHub] [hive] pvary commented on a change in pull request #2298: HIVE-25139: Filter out null table properties in HiveIcebergMetaHook

pvary commented on a change in pull request #2298:
URL: https://github.com/apache/hive/pull/2298#discussion_r636767202



##########
File path: iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergMetaHook.java
##########
@@ -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());

Review comment:
       nit: Why not
   ```
   hmsTable.getParameters().entrySet().stream().filter(e -> e.getKey() != null && e.getValue() != null).forEach((key, value) -> {
   ```
   and then we do not need these changes? Is it nicer or easier to read?




-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org