feat: run admitted native Parquet scans as one local graph #7692
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.43) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 392 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.357
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #7692"
general
weight: 0.35
viirya
Which issue does this PR close?
Part of #6499 (step 2). Builds on #6883.
Rationale for this change
#6883 runs a query as one local DataFusion graph only when its leaf is a range. Step 2 of #6499 admits exchange-free plans over Comet's native Parquet scan (scan, filter, project), judged from the plan
CometExecRuleproduces, whether or not AQE is enabled.What changes are included in this PR?
Admission (
CometLocalRule)CometNativeScanExec. The scan is declined when it reports partitioning (a bucketed or key-grouped scan) or reads encrypted files, since decryption needs the JVM.PlanExpression, for example a scalar subquery or dynamic pruning in a scan's filters) is declined. These are not in the serialized plan, so the existing JVM-callback check on the plan does not see them.CometLocalExecbuilds its spec at execution time, after resolving the scan's subqueries. When there are no partitions, or more than 1024,collectruns as ordinary Comet execution.spark.sql.adaptive.forceApplyfailed with an internal error when AQE made the result its final stage. This also affected range plans from #6883.Native
createQuerytakes each partition's serializedNativeScanwith its files, which is the same data a Spark task receives. A partition's files are injected into a copy of the plan when that partition is planned. The ordinary planner and the protobuf are unchanged.native/localnow plans and starts each partition on the runtime's blocking pool. This is needed because creating an S3 object store blocks on Comet's runtime, which panics on a worker. The started stream is stored from the blocking thread, so cancellation still drops it synchronously.The contributor guide page
local-execution.mdis updated. One known gap is documented there: a local scan reports no task input metrics.How are these changes tested?
native/local: new tests for a partition start that blocks on the runtime, a start that panics, and the partition reported for an error.native/core(local::): each partition reads only its own Parquet files, an empty file group yields an empty partition, and file lists that do not match the plan are rejected.CometLocalExecutionSuite: Parquet scans split into many partitions are compared with Spark's results and row order. Further tests cover:- partition pruning;
- scans of no files or of more than 1024 partitions;
- declined bucketed, encrypted and subquery plans;
- AQE on, off and
forceApply(range and scan);- cached and RDD partition counts;
- a corrupt file named in the error;
- explain before files are listed.