eric-maynard commented on code in PR #13859:
URL: https://github.com/apache/iceberg/pull/13859#discussion_r2335591714
##########
spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/data/vectorized/parquet/TestParquetVectorizedReads.java:
##########
@@ -493,6 +496,20 @@ 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:
If you attempt to directly create a file from the URI, as in:
```java
Path goldenResourcePath = Paths.get("encodings", encoding, typeName +
".parquet");
URL goldenFileUrl =
getClass().getClassLoader().getResource(goldenResourcePath.toString());
new File(goldenFileUrl.toURI());
```
You will see an error of the form:
```
URI is not hierarchical java.lang.IllegalArgumentException: URI is not
hierarchical at java.base/java.io.File.<init>(File.java:420)
```
--
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]