Skip to content

[AURON #2761] Fix aggregate FILTER binding after a join - #2764

Open
lyne7-sc wants to merge 1 commit into
apache:masterfrom
lyne7-sc:fix/aggregate-filter-column-binding
Open

lyne7-sc wants to merge 1 commit into
apache:masterfrom
lyne7-sc:fix/aggregate-filter-column-binding

Conversation

@lyne7-sc

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #2761.

Rationale for this change

When both sides of a join produce a column with the same name and type, Auron can bind aggregate filters on both sides to the same column and return incorrect results.

What changes are included in this PR?

Resolve aggregate filter references by Spark expression ID during binding and when projecting inputs for partial aggregation. If an ID is stale, match by name and type only when exactly one input attribute matches. Ambiguous matches fall back to Spark.

Are there any user-facing changes?

These queries now return the correct results.

How was this patch tested?

Added AuronQuerySuite regressions with SUM(l.amount) and SUM(l.amount + 1) to cover filter binding and the projection before partial aggregation. Both tests compare results with Spark and check for a native broadcast join and aggregate.

Was this patch authored or co-authored using generative AI tooling?

  • Yes
  • No

Generated-by: OpenAI Codex GPT-6.2

ASF guidance: https://www.apache.org/legal/generative-tooling.html

@github-actions github-actions Bot added the spark label Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Aggregate FILTER can count the wrong rows after a join

1 participant