Copilot commented on code in PR #17997:
URL: https://github.com/apache/hudi/pull/17997#discussion_r2723243224


##########
hudi-hadoop-common/src/test/java/org/apache/hudi/common/fs/inline/TestParquetInLining.java:
##########
@@ -73,22 +72,33 @@ public void teardown() throws IOException {
         FileSystemTestUtils.deleteFile(filePath);
       }
     }
+    if (tempParquetPath != null) {
+      File tempFile = new 
File(tempParquetPath.toString().substring(tempParquetPath.toString().indexOf(':')
 + 1));

Review Comment:
   The path extraction using substring and indexOf(':') is fragile and could 
fail with more complex URI formats. Consider using 
tempParquetPath.toUri().getPath() instead, which properly handles URI path 
extraction. This pattern is used elsewhere in the codebase (e.g., 
HoodieTestTable.java:907).



##########
hudi-hadoop-common/src/test/java/org/apache/hudi/common/fs/inline/TestParquetInLining.java:
##########
@@ -120,9 +130,10 @@ private long generateOuterFile(Path outerPath, byte[] 
inlineBytes) throws IOExce
     return startOffset;
   }
 
-  private byte[] getBytesToInline(Path outerInMemFSPath) throws IOException {
-    InMemoryFileSystem inMemoryFileSystem = (InMemoryFileSystem) 
outerInMemFSPath.getFileSystem(inMemoryConf);
-    return inMemoryFileSystem.getFileAsBytes();
+  private byte[] getBytesFromTempFile(Path tempPath) throws IOException {
+    String pathStr = tempPath.toString();
+    String filePath = pathStr.substring(pathStr.indexOf(':') + 1);

Review Comment:
   The path extraction using substring and indexOf(':') is fragile and could 
fail with more complex URI formats. Consider using tempPath.toUri().getPath() 
instead, which properly handles URI path extraction. This pattern is used 
elsewhere in the codebase (e.g., HoodieTestTable.java:907).



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