Skip to content

Fix the partial aggregation pushdown for system table for native execution#25041

Merged
kewang1024 merged 1 commit intoprestodb:masterfrom
kewang1024:groupingset-systemtables-native
May 14, 2025
Merged

Fix the partial aggregation pushdown for system table for native execution#25041
kewang1024 merged 1 commit intoprestodb:masterfrom
kewang1024:groupingset-systemtables-native

Conversation

@kewang1024
Copy link
Collaborator

@kewang1024 kewang1024 commented May 5, 2025

Follow up on #21725

containsSystemTableScan will limit all the partial aggregation generation and pushdown
whenever we have a system table for native execution as leaf node.

When we have an aggregation on mix of empty grouping set and non-empty grouping set,
It would be forced to split into a partial aggregation and final aggregation on repartitioned
exchange. The partial aggregation could have been pushed down under the repartitioned
exchange but is not pushed down, due to the above constraint, leading to an invalid plan.

Fix the behavior by more precise check directlyOnSystemTableScan for partial aggregatio
pushdown.

== NO RELEASE NOTE ==

@prestodb-ci prestodb-ci added the from:Meta PR from Meta label May 5, 2025
@kewang1024 kewang1024 force-pushed the groupingset-systemtables-native branch 2 times, most recently from da43a90 to 476d585 Compare May 7, 2025 21:08
@kewang1024 kewang1024 changed the title [Draft] Tight the aggregation pushdown check on system tables for native Fix the aggregation pushdown check on system tables for native May 7, 2025
@kewang1024 kewang1024 force-pushed the groupingset-systemtables-native branch 2 times, most recently from 6b04c43 to 4bf7d53 Compare May 8, 2025 08:41
@kewang1024 kewang1024 changed the title Fix the aggregation pushdown check on system tables for native Fix the partial aggregation pushdown for system table for native execution May 8, 2025
@kewang1024 kewang1024 marked this pull request as ready for review May 8, 2025 08:54
@kewang1024 kewang1024 requested review from a team as code owners May 8, 2025 08:54
@kewang1024 kewang1024 requested a review from ZacBlanco May 8, 2025 08:54
@kewang1024 kewang1024 force-pushed the groupingset-systemtables-native branch 4 times, most recently from 88f2650 to be0a473 Compare May 9, 2025 20:12
arhimondr
arhimondr previously approved these changes May 12, 2025
@kewang1024 kewang1024 force-pushed the groupingset-systemtables-native branch 2 times, most recently from 5f95b9e to 981c377 Compare May 14, 2025 07:12
@kewang1024 kewang1024 force-pushed the groupingset-systemtables-native branch from 981c377 to 5cd05b0 Compare May 14, 2025 07:18
@kewang1024 kewang1024 merged commit 3da0e14 into prestodb:master May 14, 2025
105 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

from:Meta PR from Meta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants