You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2018/11/19 19:54:00 UTC
[jira] [Updated] (CALCITE-2675) ReduceExpressionRule may throw type
validation error as it may fail to preserve nullability
[ https://issues.apache.org/jira/browse/CALCITE-2675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jesus Camacho Rodriguez updated CALCITE-2675:
---------------------------------------------
Summary: ReduceExpressionRule may throw type validation error as it may fail to preserve nullability (was: ReduceExpressionRule may leave behind altered types w.r.t nullability)
> ReduceExpressionRule may throw type validation error as it may fail to preserve nullability
> -------------------------------------------------------------------------------------------
>
> Key: CALCITE-2675
> URL: https://issues.apache.org/jira/browse/CALCITE-2675
> Project: Calcite
> Issue Type: Bug
> Reporter: Zoltan Haindrich
> Assignee: Zoltan Haindrich
> Priority: Major
>
> If a simplification could happen after some [ReduceExpression rewrite|https://github.com/apache/calcite/blob/fcc8bf7f44f92efb3c9a1e1f51ffc1a09cab27b9/core/src/main/java/org/apache/calcite/rel/rules/ReduceExpressionsRule.java#L794]; the simplification result may have a slightly different type in nullability.
> {code}
> @Test public <T> void testReduceCaseNullabilityChange() throws Exception {
> HepProgram program = new HepProgramBuilder()
> .addRuleInstance(ReduceExpressionsRule.FILTER_INSTANCE)
> .addRuleInstance(ReduceExpressionsRule.PROJECT_INSTANCE)
> .build();
> try (Hook.Closeable a = Hook.REL_BUILDER_SIMPLIFY.add(Hook.propertyJ(false))) {
> checkPlanning(program,
> "select case when empno = 1 then 1 when 1 IS NOT NULL then 2 else null end as qx "
> + "from emp");
> }
> {code}
> Exposed by CALCITE-1413 changes; I'm not sure if there is any other variations for which the same could happen.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)