fix: fall back to Spark for timestamp arrays when Parquet encryption is configured #7720
All Vouch review confidence checks passed
Residual risk 0.35 = Change Risk (0.65) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.65 · 324 lines diff across 4 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.346
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.065
Real PR Conversation Timeline
1 comments
"Review active on #7720"
general
weight: 0.35
viirya
Which issue does this PR close?
Part of #7029. I suggest landing #7148 first. It fixes the reported legacy list layouts for scans without Parquet modular encryption configured. This PR covers scans with modular encryption configured. On rebase after #7148, this PR can remove the warning for those layouts from “Reads that differ from Spark” and link the fallback entry directly to #7029.
Rationale for this change
In a legacy list, Spark can store an INT96 timestamp at
at.bag.array. DataFusion 55.2.0 looks forat.list.array, misses the leaf, and decodes it as nanoseconds. A value such as9999-12-31 23:59:59overflows before Comet can cast it to microseconds.The footer rewrite in #7148 would drop the file decryptor, so that PR skips the rewrite whenever the reader has decryption properties. Comet supplies those properties for every file when modular encryption is configured.
DataFusion fixed the lookup on
mainin apache/datafusion#26464. The 56.0.0 release targeted by #7249 still assumes a.list.path. I found no request for a 56.x backport on the DataFusion GitHub tracker. We can remove the fallback once Comet pins a release containing the fix. DataFusion 56.0.0 lookupWhat changes are included in this PR?
CometScanRuleleaves the scan with Spark when modular encryption is configured and the required schema includes a timestamp beneath an array. The check looks through structs, nested arrays and map keys and values, for bothtimestampandtimestamp_ntz. Pruning the affected field allows Comet to scan other columns in the same file.The planner sees the projected Spark types before it knows each file's encoding. The fallback therefore also covers standard arrays, INT64 timestamp encodings and plaintext files in these scans. The user guide records that scope.
How are these changes tested?
A new
ParquetEncryptionITCasetest writes a uniformly encrypted Parquet file with Spark's legacy list layout and INT96 encoding. It verifies the encrypted footer, compares a year-9999 timestamp nested in a map of arrays of structs with Spark, and checks the fallback reason. A second projection of the same file reads a scalar timestamp and an integer array, checks the values against Spark, and requiresCometNativeScanExec.git diff --checkpassed. The regression runs in the hosted Linux scan suite. Fork CI