Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a Rule to evaluate aggregation over constant Values #24370

Open
raunaqmorarka opened this issue Dec 4, 2024 · 0 comments
Open

Implement a Rule to evaluate aggregation over constant Values #24370

raunaqmorarka opened this issue Dec 4, 2024 · 0 comments

Comments

@raunaqmorarka
Copy link
Member

E.g. In the below plan evaluating the aggregation should allow simplification of this plan to just a scan with a static filter

Output[columnNames = [my_partition]]
                │   Layout: [my_partition:varchar]
                └─ Aggregate[type = FINAL, keys = [my_partition]]
                   │   Layout: [my_partition:varchar]
                   └─ LocalExchange[partitioning = HASH, arguments = [my_partition::varchar]]
                      │   Layout: [my_partition:varchar]
                      └─ RemoteExchange[type = REPARTITION]
                         │   Layout: [my_partition:varchar]
                         └─ Aggregate[type = PARTIAL, keys = [my_partition]]
                            │   Layout: [my_partition:varchar]
                            └─ InnerJoin[criteria = (my_partition = max), distribution = REPLICATED]
                               │   Layout: [my_partition:varchar]
                               │   Distribution: REPLICATED
                               │   maySkipOutputDuplicates = true
                               │   dynamicFilterAssignments = {max -> #df_472}
                               ├─ ScanFilter[table = dice:rtblogs.no_bids$data@4508291383134783039, dynamicFilters = {my_partition = #df_472}]
                               │      Layout: [my_partition:varchar]
                               │      my_partition := 9:my_partition:varchar
                               └─ LocalExchange[partitioning = HASH, arguments = [max::varchar]]
                                  │   Layout: [max:varchar]
                                  └─ RemoteExchange[type = REPLICATE]
                                     │   Layout: [max:varchar]
                                     └─ Aggregate[]
                                        │   Layout: [max:varchar]
                                        │   max := max(my_partition_8)
                                        └─ Values[]
                                               Layout: [my_partition_8:varchar]
                                               (varchar '2024-10-12T09:00:00Z')
                                               (varchar '2024-10-12T09:00:00Z')
                                               (varchar '2024-10-12T09:00:00Z')
                                               (varchar '2024-10-12T09:00:00Z')
                                               (varchar '2024-10-12T09:00:00Z')
                                               (varchar '2024-10-12T09:00:00Z')
                                               (varchar '2024-10-12T09:00:00Z')
                                               (varchar '2024-10-12T09:00:00Z')
                                               (varchar '2024-10-12T09:00:00Z')
                                               (varchar '2024-10-12T09:00:00Z')
                                               (... 1112124 more rows ...)

cc: @martint @kasiafi

@raunaqmorarka raunaqmorarka changed the title Implement a Rule to evaluate aggregation over Values Implement a Rule to evaluate aggregation over constant Values Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant