← Back to Pull requests

docs: explain ANSI errors skipped by Comet filters and projections #7723

Open
unknown opened this pull request with 319 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 20, 2026 22:26 UTC
Author

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 as collect(). 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 conversion

What 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.

Diff: 319 lines (+239 / -80) across 3 files Reviewer: viirya Review duration: 15562m
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
0.40
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 40.4% (MEDIUM) · Higher = larger blast radius
40.4%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 21.6% · Safe to merge
21.6%