You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@parquet.apache.org by "1fanwang (via GitHub)" <gi...@apache.org> on 2026/09/20 00:19:31 UTC
[PR] MINOR: Include local file paths in reader diagnostics [parquet-java]
1fanwang opened a new pull request, #3804:
URL: https://github.com/apache/parquet-java/pull/3804
### Rationale for this change
When a local Parquet file is invalid, the error shows a Java object ID instead of the filename. Callers cannot identify the failing input.
Related to https://github.com/apache/parquet-java/issues/3354. This fixes the built-in local input implementation, not the third-party input in that report.
### What changes are included in this PR?
Return the stored path from the local input's string representation, as Hadoop-backed inputs already do.
### Are these changes tested?
#### Testing Done
On Java 17, the same program opens a real ten-byte file through the Parquet reader.
Before, at 2df8d02678dab4bb8b926a0d3221cc652984c7ab:
```text
org.apache.parquet.io.LocalInputFile@6bffbc6d is not a Parquet file (length is too low: 10)
```
After:
```text
invalid.parquet is not a Parquet file (length is too low: 10)
```
Run from either checkout:
```bash
mvn -q -pl parquet-hadoop -am -DskipTests package dependency:build-classpath -Dmdep.outputFile=target/runtime-classpath
java -cp "parquet-common/target/classes:parquet-hadoop/target/classes:$(cat parquet-hadoop/target/runtime-classpath)" target/InvalidLocalFileProbe.java invalid.parquet
```
<details>
<summary>Reproducer source</summary>
Save this as target/InvalidLocalFileProbe.java after the build:
```java
import java.nio.file.Files;
import java.nio.file.Path;
import org.apache.parquet.hadoop.ParquetFileReader;
import org.apache.parquet.io.LocalInputFile;
class InvalidLocalFileProbe {
public static void main(String[] args) throws Exception {
Path path = Files.write(Path.of(args[0]), new byte[10]);
try (ParquetFileReader ignored = ParquetFileReader.open(new LocalInputFile(path))) {
throw new AssertionError("Invalid file was accepted");
} catch (RuntimeException exception) {
System.out.println(exception.getMessage());
}
}
}
```
</details>
### Are there any user-facing changes?
Local-file errors and reader file identifiers now show the supplied path. File contents and read behavior are unchanged.
--
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: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org
Re: [PR] MINOR: Include local file paths in reader diagnostics [parquet-java]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac merged PR #3804:
URL: https://github.com/apache/parquet-java/pull/3804
--
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: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org
Re: [PR] MINOR: Include local file paths in reader diagnostics [parquet-java]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac commented on PR #3804:
URL: https://github.com/apache/parquet-java/pull/3804#issuecomment-5787447820
Thanks @1fanwang for fixing this and @divjotarora for the review!
--
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: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org