Repository navigation
Window function on msq #15470
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
Merged
Merged
Window function on msq #15470
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
4ef900d
Initial code
somu-imply 5e8dab1
Merge remote-tracking branch 'upstream/master' into windowFunctionOnMSQ
somu-imply 9ea01fc
Hacky way of atleast getting things to work
somu-imply 9c4ac74
Temp unfinished changes
somu-imply 54f9ac3
Converting rac back to frames
somu-imply d6cef47
Working UTs
somu-imply 40a18f1
Fixing running window function in console
somu-imply 3ecc96a
Merge remote-tracking branch 'upstream/master' into windowFunctionOnMSQ
somu-imply 7e34aa8
Adding shuffle spec and separating out stages for each window
somu-imply f5a1f59
serde stuff by adding ops to proc factory
somu-imply ab6e317
Updating for first set of reviews
somu-imply f1efec3
Changes for partition boundary detection
somu-imply 1dae450
cleaning up some code, adding some tests
somu-imply ccfe473
Fixing up shuffle in group by if window afterwards
somu-imply 500f54f
Merge remote-tracking branch 'upstream/master' into windowFunctionOnMSQ
somu-imply 98f4ba5
fix after merge
somu-imply ee61333
More updates and ignoring the insert cases FOR NOW..
somu-imply 8f8bfdc
A possible fix for the insert case
somu-imply ec1f164
Support for leaf operators in window functions in MSQ
somu-imply 465598a
in case of MSQ engine planning the query with leafOperator as a windo…
somu-imply d490d78
Removing inspection profile
somu-imply 836b693
Revert "Removing inspection profile"
somu-imply aee40ba
Merge remote-tracking branch 'upstream/master' into windowFunctionOnMSQ
somu-imply 3f3d1b0
Updating inspection profile
somu-imply aa1b753
Updating scan query kit to handle shuffle for next window
somu-imply 634d5bc
Merge remote-tracking branch 'upstream/master' into windowFunctionOnMSQ
somu-imply bd5f27b
Some comments addressed
somu-imply 5338b76
Merge remote-tracking branch 'upstream/master' into windowFunctionOnMSQ
somu-imply b688755
Throwing exceptions in 2 cases
somu-imply ceff35d
Moving examples to a new file and adding new examples with join
somu-imply fc2e2b6
Merge remote-tracking branch 'upstream/master' into windowFunctionOnMSQ
somu-imply 751e947
More tests now window functions over unnest
somu-imply d7840a3
Addressing review commets part 1
somu-imply 681ee1b
Merge remote-tracking branch 'upstream/master' into windowFunctionOnMSQ
somu-imply b487d2a
Changes to frame processor to move from base leaf to frame processor …
somu-imply c3baa1d
Some more refactoring and addressing comments
somu-imply 9768da2
Updating more tests
somu-imply 584fa8f
Making build pass
somu-imply 0813cc8
Merge remote-tracking branch 'upstream/master' into windowFunctionOnMSQ
somu-imply d3755e1
Addressing latest set of comments part 1
somu-imply c0c74a0
Addressing latest review comments part 2
somu-imply 60c6290
Minor refactoring and new tests after review
somu-imply 91edf9e
Adding guardrails for materialization and avoiding partition bossting…
somu-imply 399a78c
Adding more javadocs, guardrails and tests
somu-imply 806c801
Merge remote-tracking branch 'upstream/master' into windowFunctionOnMSQ
somu-imply 04424d7
Changes to one test case
somu-imply f0946b1
More fixes around guardrails and addressing last set of review comments
somu-imply ea7882c
Merge remote-tracking branch 'upstream/master' into windowFunctionOnMSQ
somu-imply 83c96b9
Fixing a testcase after the merge
somu-imply cfca6a5
Fixing a test by using correct in filters for sql compat mode
somu-imply c3e2c29
Not documenting context flag and 1 more test change
somu-imply 1464dae
Merge remote-tracking branch 'upstream/master' into windowFunctionOnMSQ
somu-imply 520ab4e
New test for inner limit on group by
somu-imply 16b75ce
Adding to known issues
somu-imply File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
91 changes: 91 additions & 0 deletions
91
...ge-query/src/main/java/org/apache/druid/msq/indexing/error/TooManyRowsInAWindowFault.java
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| package org.apache.druid.msq.indexing.error; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonCreator; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import com.fasterxml.jackson.annotation.JsonTypeName; | ||
| import org.apache.druid.msq.util.MultiStageQueryContext; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| @JsonTypeName(TooManyRowsInAWindowFault.CODE) | ||
| public class TooManyRowsInAWindowFault extends BaseMSQFault | ||
| { | ||
|
|
||
| static final String CODE = "TooManyRowsInAWindow"; | ||
|
|
||
| private final int numRows; | ||
| private final int maxRows; | ||
|
|
||
| @JsonCreator | ||
| public TooManyRowsInAWindowFault( | ||
| @JsonProperty("numRows") final int numRows, | ||
| @JsonProperty("maxRows") final int maxRows | ||
| ) | ||
| { | ||
| super( | ||
| CODE, | ||
| "Too many rows in a window (requested = %d, max = %d). " | ||
| + " Try creating a window with a higher cardinality column or change the query shape." | ||
| + " Or you can change the max using query context param %s ." | ||
| + " Use it carefully as a higher value can lead to OutOfMemory errors. ", | ||
| numRows, | ||
| maxRows, | ||
| MultiStageQueryContext.MAX_ROWS_MATERIALIZED_IN_WINDOW | ||
| ); | ||
| this.numRows = numRows; | ||
| this.maxRows = maxRows; | ||
| } | ||
|
|
||
| @JsonProperty | ||
| public int getNumRows() | ||
| { | ||
| return numRows; | ||
| } | ||
|
|
||
| @JsonProperty | ||
| public int getMaxRows() | ||
| { | ||
| return maxRows; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) | ||
| { | ||
| if (this == o) { | ||
| return true; | ||
| } | ||
| if (o == null || getClass() != o.getClass()) { | ||
| return false; | ||
| } | ||
| if (!super.equals(o)) { | ||
| return false; | ||
| } | ||
| TooManyRowsInAWindowFault that = (TooManyRowsInAWindowFault) o; | ||
| return numRows == that.numRows && maxRows == that.maxRows; | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() | ||
| { | ||
| return Objects.hash(super.hashCode(), numRows, maxRows); | ||
| } | ||
| } |
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.