-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[multistage] Enable runInBroker / useBrokerPruning by Default + Misc. Improvements #16204
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,9 @@ | |
| import org.apache.calcite.rel.RelCollation; | ||
| import org.apache.calcite.rel.RelCollations; | ||
| import org.apache.calcite.rel.RelFieldCollation; | ||
| import org.apache.calcite.rel.RelNode; | ||
| import org.apache.calcite.rel.core.Filter; | ||
| import org.apache.calcite.rel.core.Project; | ||
| import org.apache.commons.collections4.CollectionUtils; | ||
|
|
||
|
|
||
|
|
@@ -90,6 +93,13 @@ public static RelCollation apply(RelCollation relCollation, PinotDistMapping map | |
| return RelCollations.of(newFieldCollations); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. have a question. Is it intentionally to select the newFieldIndices.get(0)?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah that was by design because I wanted to keep it simple at the time. For context, this can occur in scenarios such as follows (which are rare or unlikely): In this case, the project could be said to be ordered by both col1 and col2, but for now I am only preserving one of the indices to keep things simple. But I think it should be okay to add all field indexes too. I can take that up in a follow-up. |
||
| } | ||
|
|
||
| /** | ||
| * If a given RelNode is not guaranteed to preserve the sort order of the input, this returns true. | ||
| */ | ||
| public static boolean doesDropCollation(RelNode relNode) { | ||
| return !(relNode instanceof Project) && !(relNode instanceof Filter); | ||
| } | ||
|
|
||
| /** | ||
| * Consider a node that is partitioned on the key: [1]. If there's a project node on top of this, with project | ||
| * expressions as: [RexInputRef#0, RexInputRef#1, RexInputRef#1], then the project node will have two hash | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for Reviewers: For queries such as
WITH tmp AS (SELECT DISTINCT col1, col2 FROM tbl LIMIT 1000) SELECT ..., at present we were not trimming groups by default which would have meant that the group-by could have grown really huge.For such queries, we can always leverage group-trimming, and this change enables that.