docs: explain ANSI errors skipped by Comet filters and projections #7723
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.40) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 319 lines diff across 3 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.345
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #7723"
general
weight: 0.35
viirya
Which issue does this PR close?
Closes #7480 via the documentation option in the issue.
Rationale for this change
With ANSI mode enabled, Spark's generated code can divide by zero on a row that Comet skips. The issue gives two Parquet examples and accepts documenting the difference. I found no separate report of a workload that requires these particular errors.
Reordering evaluation in Comet can expose an error on a row the caller never reads. For example, PySpark's
df.rdd.take(1)can use the same physical plan ascollect(). The plan cannot tell Comet how much of the batch the caller needs. Spark's decision to evaluate a shared expression early also depends on the version and code generation settings. PySpark RDD conversionWhat changes are included in this PR?
The compatibility guide shows both reported queries and a Spark 4.2 filter with two false Boolean guards. It explains how code generation affects evaluation order and why a Parquet scan with row-filter pushdown can either skip the zero divisor or raise an error itself. It also covers malformed casts, the per-operator settings for running a filter or projection in Spark, and the setting for running the whole query in Spark. The section follows the existing discussion of ANSI errors on rows skipped by
LIMIT.How are these changes tested?
This is a documentation-only change. The examples use the results reported in #7480 and the evaluation order in Spark's generated filters and projections, Spark 4.2 filter subexpression elimination and Comet's Boolean short-circuit evaluation. For the scan behavior, Comet enables predicate reordering with row filtering, and DataFusion orders the predicates by estimated cost. Ran
git diff --check.