Details
-
Bug
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
None
-
None
-
None
Description
The following query implicitly converts a character literal to a date literal; it passes validation but fails during code generation.
select * from "scott".emp WHERE hiredate = '1980-12-17'; +-------+-------+-------+------+------------+--------+------+--------+ | EMPNO | ENAME | JOB | MGR | HIREDATE | SAL | COMM | DEPTNO | +-------+-------+-------+------+------------+--------+------+--------+ | 7369 | SMITH | CLERK | 7902 | 1980-12-17 | 800.00 | | 20 | +-------+-------+-------+------+------------+--------+------+--------+ (1 row) !ok
throws
Error while compiling generated Java code: at org.apache.calcite.avatica.Helper.wrap(Helper.java:37) at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:108) at org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePreparingStmt.implement(CalcitePrepareImpl.java:1261) at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:330) at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:229) at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:786) at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:640) at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:610) at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:221) at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:603) at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:638) at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:149) ... 9 more Caused by: org.codehaus.commons.compiler.CompileException: Line 17, Column 46: Incomparable types 'java.lang.Integer' and 'java.lang.String' at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:10092) at org.codehaus.janino.UnitCompiler.compileBoolean2(UnitCompiler.java:3080)
I have added the test case to misc.iq.
Attachments
Issue Links
- is related to
-
KYLIN-3126 Query fails with "Error while compiling generated Java code" when equality condition is used, and works when equivalent IN clause is specified
- Open
-
CALCITE-613 Implicitly convert character values in comparisons
- Closed