[CALCITE-6706] Checked arithmetic does not take effect in subqueries#4066
[CALCITE-6706] Checked arithmetic does not take effect in subqueries#4066mihaibudiu merged 1 commit intoapache:mainfrom
Conversation
|
@NobiGo, I invited you to review since you commented on the issue. I have added the tests you suggested. |
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java
Outdated
Show resolved
Hide resolved
|
|
||
| @Override public RexNode visitSubQuery(RexSubQuery subQuery) { | ||
| RelNode result = subQuery.rel.accept(ConvertToChecked.this); | ||
| return subQuery.clone(result); |
There was a problem hiding this comment.
Why is clone necessary? I understand that clone should be avoided if it can be avoided.
There was a problem hiding this comment.
This is not the Java Object.clone() method, that one has no arguments.
You can see the JavaDoc for the clone methods for RexCall in RexCall.clone().
/**
* Creates a new call to the same operator with different operands.
*
* @param type Return type
* @param operands Operands to call
* @return New call
*/
public RexCall clone(RelDataType type, List<RexNode> operands) {
There was a problem hiding this comment.
If result==subQuery.rel, do we still need to clone it?
There was a problem hiding this comment.
Sorry, didn't see this until too late, if this is redundant I will fix it in a subsequent PR.
Have to find out whether clone makes the check or not.
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
4ac5c9d to
7473aae
Compare
|



No description provided.