-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: Initial support for grouped join pushdown #9032
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9032 +/- ##
==========================================
+ Coverage 82.85% 83.14% +0.29%
==========================================
Files 222 225 +3
Lines 78828 80300 +1472
==========================================
+ Hits 65309 66767 +1458
- Misses 13519 13533 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
mcheshkov
changed the title
feast: Initial support for grouped join pushdown
feat: Initial support for grouped join pushdown
Dec 11, 2024
mcheshkov
force-pushed
the
initial-grouped-join-pushdown
branch
2 times, most recently
from
December 18, 2024 22:18
18417aa
to
739fdc6
Compare
waralexrom
approved these changes
Jan 9, 2025
mcheshkov
force-pushed
the
initial-grouped-join-pushdown
branch
2 times, most recently
from
January 13, 2025 18:57
fe62c0f
to
9440876
Compare
paveltiunov
approved these changes
Jan 13, 2025
…s a cube join condition
…mpty_tail) for empty joins in rules
They would be used later as a way to allow replacers to handle column from grouped subquery in join
Non-flatten rules will gain support for joins with grouped-grouped joins SQL generation support in WrappedSelect
mcheshkov
force-pushed
the
initial-grouped-join-pushdown
branch
from
January 14, 2025 18:12
9440876
to
e34feec
Compare
This was referenced Jan 14, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check List
Description of Changes Made (if issue reference is not provided)
With this
BaseQuery
will add grouped subqueries to SQL after subquery dimensions and join tree partswrapper_pullup_replacer
injoin
position ofwrapped_select
, but still mostly with empty list inside. Notable exception is aggregation flattening - it is allowed to try to flatten aggregation into WrappedSelect with non-empty joins.wrapped_select_join
and over listWrappedSelectJoins
listgrouped_subqueries
in a context, it is used to track qualifiers of grouped subqueries, to allow rewriting of column expressions referencing grouped subquery with push-to-cube activeSELECT * FROM (ungrouped) JOIN (grouped);
, this would allow to prefer representation without join, but with wrapper. Without this cost change join representation would have higherast_size_outside_wrapper
component, but it is less important thenwrapper_nodes
, so wrapper representation would be more expensive.WrappedSelectNode
will generate each grouped subquery separately, generate member expressions for join conditions and push all that to Cubepush_to_cube=false
query as grouped, which is incorrect, as we may drop push-to-Cube when wrappingWrappedSelect
with another layer, even if innerWrappedSelect
is projection. This is covered by check in SQL generation: onlyCubeScan(grouped=true)
are allowed. This require new flag in wrapper replacers to fix.Supporting changes:
CubeScanWrappedSqlNode
fromCubeScanWrapperNode
. Both a logical plan nodes for now,Wrapper
is generated during rewrites, andWrappedSql
stores SQL, generated generated duringevaluate_wrapped_sql
__cubeJoinField
join check to function, and make it stricter, onlyleft.__cubeJoinField = right.__cubeJoinField
is allowedfind_column_by_alias
and__cubeJoinField
join checkPushToCubeContext
in SQL generation code, used to track everything necessary to generate SQL for push-to-Cube case. For now it contains ungroupedCubeScanNode
that whould be pushed into, and qualifiers and generated SQL for all grouped subqueries. Qualifiers are necessary to generate column expressions on top of ungrouped-grouped join.copy_value!
macro, to extendcopy_flag!
, allows to copy single value between different unary language variants