-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[CALCITE-5506] RelToSqlConverter should retain the aggregation logic #3052
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
Conversation
Kudos, SonarCloud Quality Gate passed! |
d535a5f
to
73a241f
Compare
…when Project without RexInputRef on the Aggregate
Kudos, SonarCloud Quality Gate passed! |
.stream() | ||
.anyMatch(rex -> RexUtil.containsInputRef(rex)); | ||
final boolean hasAggregate = | ||
input instanceof Aggregate && input.getRowType().getFieldCount() > 0; |
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.
Do you need to add input.getRowType().getFieldCount() > 0
? (I even doubt that we will produce RelNode
which has 0
fields)
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.
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.
But the aggregate in your test actually has 1 column, will it still pass without this change?
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.
No, it failed.
java.lang.AssertionError:
Expected: is "SELECT 42 AS \"C\"\nFROM \"foodmart\".\"product\"\nGROUP BY ()"
but: was "SELECT 42 AS \"C\"\nFROM (SELECT\nFROM \"foodmart\".\"product\"\nGROUP BY ()) AS \"t\""
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.
Sorry that I misunderstood the attention of this condition. Now I think I get your point, and it looks correct (although it may be a little coarse grained, it's ok to me because we have hasInputRef
to narrow down the impact)
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.
+1
.stream() | ||
.anyMatch(rex -> RexUtil.containsInputRef(rex)); | ||
final boolean hasAggregate = | ||
input instanceof Aggregate && input.getRowType().getFieldCount() > 0; |
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.
Sorry that I misunderstood the attention of this condition. Now I think I get your point, and it looks correct (although it may be a little coarse grained, it's ok to me because we have hasInputRef
to narrow down the impact)
RelToSqlConverter should retain the aggregation logic when Project without RexInputRef on the Aggregate.