Smallfu666 opened a new pull request, #12741:
URL: https://github.com/apache/gluten/pull/12741

   ## What changes are proposed in this pull request?
   
   This records a non-merge boundary exposed while reviewing PR #12653.
   
   PR #12653 added FILTER-clause support to `MergeTwoPhasesHashBaseAggregate`. 
Its code comment used the single-distinct case as rationale for positional 
alignment over `resultId` matching. However, single-distinct + FILTER is 
outside this merge rule's scope: `planAggregateWithOneDistinct` inserts an 
exchange between the partial and final stages, breaking the direct parent-child 
relationship the rule requires.
   
   This PR:
   1. Corrects the comment — removes the `resultId` rationale, keeps only the 
positional-alignment invariant.
   2. Adds two boundary characterization tests verifying that distinct + FILTER 
is not merged into a single aggregate and that FILTER is preserved through the 
unmerged stages (results match vanilla Spark).
   
   These tests would pass on `main` before #12653 was merged — distinct 
aggregates were never merged because of the exchange. This PR records a 
non-merge boundary, not a correctness regression fixed by #12653.
   
   ## How was this patch tested?
   
   Verified on Spark 3.4 + Scala 2.12 (AEOn + AEOff, 6/6 tests pass) on the 
existing `MergeTwoPhasesHashBaseAggregateSuite`. Both new cases use 
`compareResultsAgainstVanillaSpark` (which checks Gluten result against vanilla 
Spark oracle and verifies no fallback).
   
   ## Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 4.1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to