Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
None
-
None
Description
In current code, when we query like below
@Test public void test() { CalciteAssert.model(HR_FKUK_MODEL) .query("select * from \"events\" where \"eventid\"='123'") .returns(CalciteAssert.outputResult()); }
Where eventid is of INTEGER type, Calcite will throw exception as below
Caused by: org.codehaus.commons.compiler.CompileException: Line 13, Column 100: Cannot compare types "int" and "java.lang.String" at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:12211) at org.codehaus.janino.UnitCompiler.compileBoolean2(UnitCompiler.java:4239) at org.codehaus.janino.UnitCompiler.access$6600(UnitCompiler.java:215) at org.codehaus.janino.UnitCompiler$14.visitBinaryOperation(UnitCompiler.java:3957) at org.codehaus.janino.UnitCompiler$14.visitBinaryOperation(UnitCompiler.java:3935) at org.codehaus.janino.Java$BinaryOperation.accept(Java.java:4864) at org.codehaus.janino.UnitCompiler.compileBoolean(UnitCompiler.java:3935) at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2475)
It's kind of hard to understand for user to refine the sql
Attachments
Issue Links
- is related to
-
CALCITE-2302 Implicit type cast support
- Closed
- links to