mihaibudiu commented on code in PR #4691:
URL: https://github.com/apache/calcite/pull/4691#discussion_r2635847076
##########
core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java:
##########
@@ -673,7 +673,7 @@ public TrimResult trimFields(
// Build new filter with trimmed input and condition.
relBuilder.push(newInput)
- .filter(filter.getVariablesSet(), newConditionExpr);
+ .filter(correlationIds, newConditionExpr);
Review Comment:
As @julianhyde frequently says, the root of the problem is the lack of a
precise specification of the structure of Rel programs that contain
correlations. In the absence of a specification there is no way to decide what
is a legal program and what its meaning is. In the paragraph above @silundong
has tried to write a part of a specification.
I think that this is the first step that should be made: write a spec of cor
variables and variableSet, probably as a long JavaDoc comment, get it reviewed.
Then write a second validator for Rel trees, which enforces these rules. That
validator could be part of the builder API. Finally, once these rules are
established, it will be much easier to decide where the problems lie with
specific bugs.
I will file a new JIRA issue about this.
--
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]