stevenzwu commented on code in PR #13859:
URL: https://github.com/apache/iceberg/pull/13859#discussion_r2353404336


##########
spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/data/vectorized/parquet/TestParquetVectorizedReads.java:
##########
@@ -493,6 +496,21 @@ static Stream<Arguments> goldenFilesAndEncodings() {
                                             encoding, e.getKey(), 
e.getValue(), vectorized))));
   }
 
+  private File resourceUrlToLocalFile(URL url) throws IOException, 
URISyntaxException {
+    if ("file".equals(url.getProtocol())) {
+      return Paths.get(url.toURI()).toFile();
+    }
+
+    String name = Paths.get(url.getPath()).getFileName().toString(); // e.g., 
string.parquet
+    String suffix = name.contains(".") ? name.substring(name.lastIndexOf('.')) 
: "";
+    Path tmp = java.nio.file.Files.createTempFile("golden-", suffix);

Review Comment:
   nit: we normally use the junit5 `TempDir`, which would auto deleted after 
the test execution.
   
   ```
   @TempDir private Path temp;
   ...
   File data = File.createTempFile(("golden-", suffix, temp.toFile());
   
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to