mihaibudiu commented on code in PR #4066:
URL: https://github.com/apache/calcite/pull/4066#discussion_r1861393832
##########
core/src/main/java/org/apache/calcite/sql2rel/ConvertToChecked.java:
##########
@@ -50,13 +51,18 @@ public ConvertToChecked(RexBuilder builder) {
* Visitor which rewrites an expression tree such that all
* arithmetic operations that produce numeric values use checked arithmetic.
*/
- static class ConvertRexToChecked extends RexShuttle {
+ class ConvertRexToChecked extends RexShuttle {
private final RexBuilder builder;
ConvertRexToChecked(RexBuilder builder) {
this.builder = builder;
}
+ @Override public RexNode visitSubQuery(RexSubQuery subQuery) {
+ RelNode result = subQuery.rel.accept(ConvertToChecked.this);
Review Comment:
The test in the issue fails without this change: `SELECT -CAST(-32768 AS
SMALLINT)`
Turns out that because of the way Prepare works, this is a RexSubquery at
the point where this visitor is invoked.
--
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]