rubenada commented on code in PR #3159:
URL: https://github.com/apache/calcite/pull/3159#discussion_r1170995157
##########
core/src/main/java/org/apache/calcite/rel/rules/SubQueryRemoveRule.java:
##########
@@ -241,21 +247,21 @@ private static RexNode rewriteSome(RexSubQuery e,
Set<CorrelationId> variablesSe
builder.aggregateCall(minMax, builder.field(0)).as("m"),
builder.count(false, "c"),
builder.count(false, "d", builder.field(0)))
- .as("q")
+ .as(qAlias)
.join(JoinRelType.INNER);
caseRexNode =
builder.call(SqlStdOperatorTable.CASE,
- builder.equals(builder.field("q", "c"), builder.literal(0)),
+ builder.equals(builder.field(qAlias, "c"), builder.literal(0)),
literalFalse,
builder.call(SqlStdOperatorTable.IS_TRUE,
builder.call(RexUtil.op(op.comparisonKind),
- e.operands.get(0), builder.field("q", "m"))),
+ e.operands.get(0), builder.field(qAlias, "m"))),
literalTrue,
- builder.greaterThan(builder.field("q", "c"),
- builder.field("q", "d")),
+ builder.greaterThan(builder.field(qAlias, "c"),
+ builder.field(qAlias, "d")),
Review Comment:
Uhm... I think that might be a sensitive, breaking change. I'm not sure
about it.
In any case, I think that should be discussed in a separated thread/ticket,
and is out of the scope of the current PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]