danny0405 commented on a change in pull request #1355: [CALCITE-3228] Error
while applying rule ProjectScanRule: interpreter
URL: https://github.com/apache/calcite/pull/1355#discussion_r311372569
##########
File path: core/src/main/java/org/apache/calcite/rel/core/Project.java
##########
@@ -282,7 +282,12 @@ public RelWriter explainTerms(RelWriter pw) {
if (!(exp.e instanceof RexInputRef)) {
return null;
}
- mapping.set(((RexInputRef) exp.e).getIndex(), exp.i);
+
+ int source = ((RexInputRef) exp.e).getIndex();
+ if (mapping.getTargetOpt(source) != -1) {
+ return null;
Review comment:
In a project, multiple source mapping to one target should never happen, i
think this is an necessary check.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services