DonnyZone commented on a change in pull request #1448: [CALCITE-3332] Query
failed with AssertionError: cannot cast null as class java.math.BigDecima
URL: https://github.com/apache/calcite/pull/1448#discussion_r323083896
##########
File path: core/src/main/java/org/apache/calcite/sql/SqlBinaryOperator.java
##########
@@ -186,6 +186,10 @@ public RelDataType deriveType(
final SqlMonotonicity mono0 = call.getOperandMonotonicity(0);
final SqlMonotonicity mono1 = call.getOperandMonotonicity(1);
if (mono1 == SqlMonotonicity.CONSTANT) {
+ // e.g., mono / null --> constant (null)
+ if (call.isOperandNull(1, true)) {
+ return SqlMonotonicity.CONSTANT;
+ }
Review comment:
Current runtime processes most SqlBinaryOperators with
`NullPolicy.STRICT`(i.e., returns null when one of its operand is null). Should
we enumerates all cases here?
----------------------------------------------------------------
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