mihaibudiu commented on code in PR #4713:
URL: https://github.com/apache/calcite/pull/4713#discussion_r2653615492
##########
core/src/main/java/org/apache/calcite/sql/validate/SelectScope.java:
##########
@@ -222,4 +222,15 @@ public boolean existingWindowName(String winName) {
public void setExpandedSelectList(@Nullable List<SqlNode> selectList) {
expandedSelectList = selectList;
}
+
+ @Override public boolean isWithin(SqlValidatorScope scope2) {
+ if (this == scope2) {
+ return true;
+ }
+ // go from the JOIN to the enclosing SELECT
+ if (scope2 instanceof JoinScope) {
Review Comment:
is this the only case that needs to be handled?
##########
core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java:
##########
@@ -3395,6 +3395,18 @@ private void convertJoin(Blackboard bb, SqlJoin join) {
joinRel =
createJoin(fromBlackboard, leftRel, rightRel, condition,
convertJoinType(joinType));
+ final CorrelationUse p = getCorrelationUse(bb, joinRel);
Review Comment:
why not fix the createJoin API to build the right result?
##########
core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java:
##########
@@ -233,6 +233,58 @@ protected TrimResult trimChild(
return dispatchTrimFields(input, fieldsUsedBuilder.build(), extraFields);
}
+ /**
+ * Trims the fields of an input relational expression for RelNode with
multiple inputs.
+ *
+ * @param rel Relational expression
+ * @param input Input relational expression, whose fields to trim
+ * @param startIndex Start index of the field range to process
+ * @param endIndex End index of the field range to process (exclusive)
+ * @param fieldsUsed Bitmap of fields needed by the consumer
+ * @return New relational expression and its field mapping
+ */
+ protected TrimResult trimChild(
Review Comment:
is there a reason to have this protected?
--
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]