Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Test:
@Test public void testReduceConstants4() throws Exception { HepProgram program = new HepProgramBuilder() .addRuleInstance(ReduceExpressionsRule.PROJECT_INSTANCE) .addRuleInstance(ReduceExpressionsRule.FILTER_INSTANCE) .addRuleInstance(ReduceExpressionsRule.JOIN_INSTANCE) .build(); String sql = "select e.mgr is not distinct from f.mgr from emp e join emp f on (e.mgr=f.mgr) where e.mgr is null"; sql(sql).with(program) .check(); }
Unfortunately the exception doesn't have a stacktrace by default; just some type:
org.apache.calcite.adapter.enumerable.RexToLixTranslator$AlwaysNull
Translation is not possible at this point: https://github.com/apache/calcite/blob/d32ee5c320938b5c34ce09df2276c9570c27a301/core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java#L746
the underlying rexNode is:
CAST(null):INTEGER NOT NULL
which is problematic
Attachments
Issue Links
- is caused by
-
CALCITE-2675 Type validation error as ReduceExpressionRule fails to preserve type nullability
- Closed
- links to