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/03/25 09:02:07 UTC

[GitHub] [hudi] dongkelun commented on a change in pull request #5051: [Hudi-3643] Fix hive count exception when the table is empty and the path depth is less than 3

dongkelun commented on a change in pull request #5051:
URL: https://github.com/apache/hudi/pull/5051#discussion_r835074474



##########
File path: hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/utils/HoodieHiveUtils.java
##########
@@ -71,7 +71,7 @@
   public static final String DEFAULT_SCAN_MODE = SNAPSHOT_SCAN_MODE;
   public static final int DEFAULT_MAX_COMMITS = 1;
   public static final int MAX_COMMIT_ALL = -1;
-  public static final int DEFAULT_LEVELS_TO_BASEPATH = 3;
+  public static final int DEFAULT_LEVELS_TO_BASEPATH = 0;

Review comment:
       Hello, I know this is only a default value. There is only one place to use it globally, which is the `HoodieInputFormatUtils.getTableMetaClientForBasePathUnchecked` method. Its logic is to use `HoodiePartitionMetadata.getPartitionDepth` get the actual levels, but an empty table without data will not  create `.hoodie_partition_metadata` file,so  It can't get levels, then an exception will be thrown. I think  either change the default value or create `.hoodie_partition_metadata`  file when creating an empty table , and `.hoodie_partition_metadata`  cannot be deleted when `truncate table`.
   I'm not sure if there's any better way. What do you think?
   




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