hannerwang commented on code in PR #2838:
URL: https://github.com/apache/calcite/pull/2838#discussion_r904471969
##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -6661,6 +6661,11 @@ static class ExtendedExpander extends Expander {
SqlIdentifier sid = (SqlIdentifier) expr;
final SqlIdentifier fqId = getScope().fullyQualify(sid).identifier;
expr = expandDynamicStar(sid, fqId);
+ } else {
+ requireNonNull(expr, "expr");
+ SqlNode exprCopy = expr.clone(expr.getParserPosition());
Review Comment:
In SqlValidatorImpl, node type will be cached into
nodeToTypeMap(IdentityHashMap), so if calcite doesn't create a copy for 'empno
/ 2' in CUBE, the 'empno / 2' in SELECT LIST will **reuse** the type in CUBE
which is **Integer not null** but it should be **nullable**.
--
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]