fix: name the failing file in native Parquet scan errors #7788
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.46) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 478 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.369
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #7788"
general
weight: 0.35
comphead
Which issue does this PR close?
Closes #7213.
Closes #4316.
Rationale for this change
When the native Parquet scan fails on a file, Spark's error should name that file. Today it often doesn't:
ParquetError. It is classified asCannotReadFilethere, after the file's identity is gone, so the path is empty. The JVM then fills it with every file of the task, joined by commas. For a task readinghealthy.parquetandcorrupt.parquet, the error names both.ParquetSchemaConvertis raised by the schema adapter, which has no file identity, so the message readsEncountered error while reading file .with an empty path.ParquetErrorContextalready keeps each file's original Spark path beside that file's planners and streams. It only used the path forParquetTimestampOverflow, and it was only installed when checked timestamp conversion was on.What changes are included in this PR?
with_scan_file_pathinjni-bridge/src/errors.rsnames a file in an error raised while scanning it:- A bare
ParquetSchemaConvert,ParquetMissingFieldIdsorCannotReadFilewithout a path gets the file's path. A path the error already carries is kept.-
ParquetTimestampOverflowalways takes the scan's original Spark path, as before.- An unclassified read failure is classified with the same
try_classify_file_read_errorused at the JNI boundary, so only its path changes. Missing files, predicate failures inside the reader (ParquetError::External(ArrowError)), other Spark errors, and errors with query context surface unchanged.ParquetErrorContextapplies it to a file's planning errors (where footer reads fail), its pending planners, and its stream.ParquetErrorContext, not only those with checked timestamp conversion. The dynamic-filter code that rebuilds sources already looks through the wrapper and re-wraps.SparkErrorConverterstays as a safety net for read failures raised outside a per-file scan. Its comment is updated.How are these changes tested?
ParquetReadSuite:- "native scan read failure names only the corrupt file of a multi-file task": a healthy, larger file and a corrupt one in the same task. The
FAILED_READ_FILEerror'spathmust be the corrupt file. On main it ishealthy.parquet,corrupt.parquet.- "native scan schema conversion error names the file that cannot be converted": an INT file and a STRING file read as
a intin one task. The error must name the STRING file and not the other. On main it readsEncountered error while reading file ..- Both fail against main's native library and pass with this change (Spark 4.1).
-
file_error_context.rs: a corrupt footer during planning and a corrupt page during streaming both becomeCannotReadFilenaming the file; a schema conversion names its file.-
errors.rs: paths fill only where missing, timestamp overflow takes the scan's path, and non-file errors are untouched.ParquetSource. They now useconcrete_parquet_source, which looks through the wrapper.-
cargo fmtandcargo clippy --all-targets -D warningson the touched crates.- The
datafusion-comettests matchingparquetanddynamic_filter(460 passed).- The
jni-bridgelib tests. Four JVM-backed panic tests fail the same way on unmodified main without the JVM test classes on the classpath.-
ParquetReadV1Suite("native scan" and "TIMESTAMP_MILLIS" tests),CometExecSuite"native parquet read" tests, andSparkErrorConverterSuite.