xiarixiaoyao commented on a change in pull request #4533:
URL: https://github.com/apache/hudi/pull/4533#discussion_r780270395



##########
File path: 
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HiveSyncTool.java
##########
@@ -251,10 +251,8 @@ private boolean syncSchema(String tableName, boolean 
tableExists, boolean useRea
         LOG.info("Schema difference found for " + tableName);
         hoodieHiveClient.updateTableDefinition(tableName, schema);
         // Sync the table properties if the schema has changed
-        if (cfg.tableProperties != null) {
-          hoodieHiveClient.updateTableProperties(tableName, tableProperties);
-          LOG.info("Sync table properties for " + tableName + ", table 
properties is: " + cfg.tableProperties);
-        }
+        hoodieHiveClient.updateTableProperties(tableName, tableProperties);
+        LOG.info("Sync table properties for " + tableName + ", table 
properties is: " + cfg.tableProperties);

Review comment:
       cfg.tableProperties ?,  i think it should be tableProperties

##########
File path: 
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HiveSyncTool.java
##########
@@ -251,10 +251,8 @@ private boolean syncSchema(String tableName, boolean 
tableExists, boolean useRea
         LOG.info("Schema difference found for " + tableName);
         hoodieHiveClient.updateTableDefinition(tableName, schema);
         // Sync the table properties if the schema has changed
-        if (cfg.tableProperties != null) {
-          hoodieHiveClient.updateTableProperties(tableName, tableProperties);
-          LOG.info("Sync table properties for " + tableName + ", table 
properties is: " + cfg.tableProperties);
-        }
+        hoodieHiveClient.updateTableProperties(tableName, tableProperties);
+        LOG.info("Sync table properties for " + tableName + ", table 
properties is: " + cfg.tableProperties);

Review comment:
       how about change this code to:
           if (cfg.tableProperties != null || cfg.syncAsSparkDataSourceTable) {
             hoodieHiveClient.updateTableProperties(tableName, tableProperties);
             LOG.info("Sync table properties for " + tableName + ", table 
properties is: "
                     + (cfg.tableProperties == null ? "" : 
cfg.tableProperties));
           }

##########
File path: 
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HiveSyncTool.java
##########
@@ -251,10 +251,8 @@ private boolean syncSchema(String tableName, boolean 
tableExists, boolean useRea
         LOG.info("Schema difference found for " + tableName);
         hoodieHiveClient.updateTableDefinition(tableName, schema);
         // Sync the table properties if the schema has changed
-        if (cfg.tableProperties != null) {
-          hoodieHiveClient.updateTableProperties(tableName, tableProperties);
-          LOG.info("Sync table properties for " + tableName + ", table 
properties is: " + cfg.tableProperties);
-        }
+        hoodieHiveClient.updateTableProperties(tableName, tableProperties);
+        LOG.info("Sync table properties for " + tableName + ", table 
properties is: " + cfg.tableProperties);

Review comment:
       no need to use chemaDiff.getAddColumnTypes().isEmpty().  your modify is 
ok, just 
   pay attention to that: cfg.tableProperties maybe null and only if sync 
DataSourceTable we need these logical




-- 
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: commits-unsubscr...@hudi.apache.org

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


Reply via email to