Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
Sub-task targets on following issue.
(1)Validation phase allows a wide range of operand types, but the runtime implementation does not cover all cases.
For example, SqlFunction(MOD) adopts OperandTypes.EXACT_NUMERIC_EXACT_NUMERIC.
@Test public void test0() { final String sql = "SELECT mod(12.5, cast(1 as bigint))"; CalciteAssert.that() .query(sql) .returns("EXPR$0=0.5\n"); }
We will get:
java.lang.RuntimeException: while resolving method 'mod[class java.math.BigDecimal, long]' in class class org.apache.calcite.runtime.SqlFunctions at org.apache.calcite.linq4j.tree.Types.lookupMethod(Types.java:323) at org.apache.calcite.linq4j.tree.Expressions.call(Expressions.java:445) at org.apache.calcite.adapter.enumerable.RexImpTable$MethodNameImplementor.implement(RexImpTable.java:2253) at org.apache.calcite.adapter.enumerable.RexImpTable.implementCall(RexImpTable.java:1195)
Attachments
Issue Links
- links to