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.
Which issue does this PR close?
Closes #542 .
Rationale for this change
As stated in #542, datafusion adds
SortExec
andRepartitionExec
based on the window clausespartition by
andorder by
(Seeenforce_distribution.rs
in datafusion andWindowAggExec::required_input_distribution
.From what I can see, this restriction on window functions in ballista was put way back when datafusion was in the same repo as ballista and window function support was still in its infancy. Now that datafusion enforces the right hash distribution by placing repartition nodes, I believe ballista currently already supports window functions.
I have tested partitioned, unpartitioned and sorted window expressions with ballista with this PR and compared them with datafusion, it seems to be working as intended. Parititioned window functions get repartitioned by their partition expressions and are parallelised.
Not sure what is the best way to test this given distribution handling is done by datafusion here.
What changes are included in this PR?
Allow queries with window expressions
Are there any user-facing changes?