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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to