calcite
calcite copied to clipboard
[CALCITE-3332] Query failed with AssertionError: cannot cast null as class java.math.BigDecima
Calcite runtime can process null semantic. However, the null literal is not properly handled when figuring out SqlMonotonicity, as demonstrated in CALCITE-3332.
In current code of SqlOperatorBinding#isOperandNull
, the doc for param of allowCast is like below
* @param allowCast whether to regard CAST(constant) as a constant
Shall we update it and update 'constant' with 'null' in this PR ? That will be more clear. I'm not sure if this PR could include such change.
Thanks for your fix @DonnyZone and it's good for me overall ~ I left minor comments and you can check if they are valid.
According to the current semantics in SqlUtil#isNullLiteral
, we can replace the word "constant" with "null" here.