voonhous commented on code in PR #19869:
URL: https://github.com/apache/hudi/pull/19869#discussion_r3967063689


##########
hudi-common/src/main/java/org/apache/hudi/metadata/BaseFileRecordParsingUtils.java:
##########
@@ -67,7 +69,9 @@ public static Iterator<HoodieRecord> 
generateRLIMetadataHoodieRecordsForBaseFile
                                                                                
    boolean isPartitionedRLI) {
     String partition = writeStat.getPartitionPath();
     String latestFileName = FSUtils.getFileNameFromPath(writeStat.getPath());
-    String fileId = FSUtils.getFileId(latestFileName);
+    // a file written outside Hudi keeps its own name, which may contain 
underscores, so the file id is parsed from the marker
+    String fileId = 
FileNameParser.parseBaseFile(latestFileName).map(FileNameParser.BaseFileName::getFileId)

Review Comment:
   One more data point on the "XTable already sets it" line in the description: 
XTable's `HudiConversionTarget` does not set `_hoodie.writes.fileid.encoding` 
(it does not enable the record index either; it pins table version 6 and only 
turns on column stats for unpartitioned tables). So the writer this PR targets 
would hit the default-config throw the moment RLI is enabled, which is one more 
reason to derive the encoding rather than document it.
   



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