[
https://issues.apache.org/jira/browse/CALCITE-2675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16692243#comment-16692243
]
Jesus Camacho Rodriguez commented on CALCITE-2675:
--------------------------------------------------
I have been going through code and call seems redundant indeed. Also
simplification seemed out of place as [~kgyrtkirk] mentioned.
Fixed in
[d32ee5c32|http://git-wip-us.apache.org/repos/asf/calcite/commit/d32ee5c32],
thanks [~kgyrtkirk].
> Type validation error as ReduceExpressionRule fails to preserve type
> 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
> Fix For: 1.18.0
>
>
> 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)