wangyum opened a new pull request, #12567: URL: https://github.com/apache/gluten/pull/12567
## What changes are proposed in this pull request? Fix `BatchScanExecTransformer.doCanonicalize()` and `BatchScanExecTransformerBase.hashCode()` to include `keyGroupedPartitioning`. Currently `doCanonicalize()` normalizes `output`, `runtimeFilters`, and `pushDownFilters` but skips `keyGroupedPartitioning`. And `hashCode()` computes `Objects.hashCode(batch, runtimeFilters, pushDownFilters)` — also missing `keyGroupedPartitioning`. This is inconsistent with `equals()`, which (via `super.equals()` → `AbstractBatchScanExec.equals()`) compares `spjParams` that contains `keyGroupedPartitioning`. **Impact:** 1. **Broken exchange reuse (AQE):** Two semantically identical `BatchScanExecTransformer` instances with different expression IDs in `keyGroupedPartitioning` are not equalized after `doCanonicalize()`, preventing AQE from reusing the exchange — resulting in a redundant shuffle. 2. **equals/hashCode contract violation:** `equals()` compares `keyGroupedPartitioning` (via `spjParams`) but `hashCode()` does not include it. ## How was this patch tested? Existing tests. The fix aligns `hashCode()` and `doCanonicalize()` with the existing `equals()` behavior — no new test cases needed. Closes #12566. --- ### Was this patch authored or co-authored using generative AI tooling? No -- 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]
