[CALCITE-3244] RelDecorrelator unable to decorrelate expression with …#1417
Closed
danny0405 wants to merge 3 commits intoapache:masterfrom
Closed
[CALCITE-3244] RelDecorrelator unable to decorrelate expression with …#1417danny0405 wants to merge 3 commits intoapache:masterfrom
danny0405 wants to merge 3 commits intoapache:masterfrom
Conversation
hsyuan
reviewed
Aug 27, 2019
| final LogicalAggregate aggregate = (LogicalAggregate) e.rel; | ||
| if (aggregate.getGroupSet().isEmpty() | ||
| && aggregate.getAggCallList().stream() | ||
| .anyMatch(c -> c.getAggregation() instanceof SqlCountAggFunction)) { |
Member
There was a problem hiding this comment.
It doesn't need to be count, any agg function with empty groupset will always generate 1 row.
Contributor
Author
There was a problem hiding this comment.
Yeah, but only count agg doesn't output nulls.
Contributor
There was a problem hiding this comment.
You should be able to trust the aggregate function to derive its own nullability.
For example, SUM knows that even when applied to a not-null column x, if the groupSet is empty it may return null. COUNT knows that it never returns null.
So maybe just look at the rowType of Aggregate, and look at whether the columns are NOT NULL.
Contributor
Author
There was a problem hiding this comment.
Thanks, Julian, let me have a try :)
77b144a to
fc2cecc
Compare
80f411d to
ca27fe9
Compare
Contributor
Author
|
Close this PR because i have no idea how to fix it probably now. |
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
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.
…filter and aggregate on top