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/07/25 20:34:18 UTC

[GitHub] [hudi] vinothchandar commented on a diff in pull request #6113: [HUDI-4400] Fix missing bloom filters in metadata table in non-partitioned table

vinothchandar commented on code in PR #6113:
URL: https://github.com/apache/hudi/pull/6113#discussion_r929275152


##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieTableMetadataUtil.java:
##########
@@ -409,8 +409,11 @@ public static HoodieData<HoodieRecord> convertMetadataToBloomFilterRecords(
         LOG.error("Failed to find path in write stat to update metadata table " + hoodieWriteStat);
         return Collections.emptyListIterator();
       }
-      int offset = partition.equals(NON_PARTITIONED_NAME) ? (pathWithPartition.startsWith("/") ? 1 : 0) :
-          partition.length() + 1;
+
+      // For partitioned table, "partition" contains the relative partition path;
+      // for non-partitioned table, "partition" is empty
+      int offset = StringUtils.isNullOrEmpty(partition)

Review Comment:
   Fetching a file name from full path and partition path, should a helper on FSUtils? Move this logic there? better yet, Can't we just String.replace the first occurrence of partition path within the full path and we are done without the index/offset business?



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