You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/08/26 04:10:22 UTC

[GitHub] [hudi] honeyaya commented on a diff in pull request #6347: [HUDI-4582] Support batch synchronization of partition to hive metastore to avoid timeout with --sync-mode="hms" and use-jdbc=false

honeyaya commented on code in PR #6347:
URL: https://github.com/apache/hudi/pull/6347#discussion_r955632261


##########
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/ddl/HMSDDLExecutor.java:
##########
@@ -192,18 +194,31 @@ public void addPartitionsToTable(String tableName, List<String> partitionsToAdd)
     LOG.info("Adding partitions " + partitionsToAdd.size() + " to table " + tableName);
     try {
       StorageDescriptor sd = client.getTable(databaseName, tableName).getSd();
-      List<Partition> partitionList = partitionsToAdd.stream().map(partition -> {
+      if (syncConfig.getIntOrDefault(HIVE_BATCH_SYNC_PARTITION_NUM) <= 0) {
+        throw new HoodieHiveSyncException("batch-sync-num for sync hive table must be greater than 0, pls check your parameter");
+      }

Review Comment:
   thanks for your comment. 
   
   ValidationUils is a good suggestion, already done. 
   
   But because the property: HIVE_BATCH_SYNC_PARTITION_NUM is an optional param, if the user does not set it, then we will use the default value, then the sync config level(HiveSyncConfig.java) might not fit. 
   



-- 
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-unsubscribe@hudi.apache.org

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