You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Wang Yanlin (Jira)" <ji...@apache.org> on 2019/10/31 10:00:00 UTC

[jira] [Created] (CALCITE-3464) RexSimplify simplifies plan having filter with NULL to empty values

Wang Yanlin created CALCITE-3464:
------------------------------------

             Summary: RexSimplify simplifies plan having filter with NULL to empty values
                 Key: CALCITE-3464
                 URL: https://issues.apache.org/jira/browse/CALCITE-3464
             Project: Calcite
          Issue Type: Bug
            Reporter: Wang Yanlin


When filter by  comparing to null in sql, the plan will get empty result

{code:java}
@Test public void testSimplifyItemEqualNull() {
    String query = "select * from sales.customer as t1 where name = NULL";
    sql(query)
        .withTester(t -> createDynamicTester())
        .withRule(ReduceExpressionsRule.FILTER_INSTANCE)
        .check();
  }
{code}

The plan after optimization is like this
{code:java}
LogicalProject(**=[$1])
  LogicalValues(tuples=[[]])
{code}

The optimized plan will get empty result, is this the result we want?




--
This message was sent by Atlassian Jira
(v8.3.4#803005)