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 encoding requirement: 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 whoever enables RLI on such a table, 
XTable or a later indexer, hits the default-config throw unless they know about 
the internal key, which is one more reason to derive the encoding rather than 
document it.
   
   (Edited: the description has since been reworded and no longer says XTable 
sets it; the first version of this comment quoted that line.)
   



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