[ 
https://issues.apache.org/jira/browse/CALCITE-3464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16963892#comment-16963892
 ] 

Wang Yanlin commented on CALCITE-3464:
--------------------------------------

Hi, [~zabetak] and [~kgyrtkirk], very thanks for your fast reply.

At first I thought filter condition like *name <> NULL* will just filter out 
rows that have null value for name column.
But I checked filter by null on mysql. It's really returns an empty result.
So, that's no problem here. I'll just close this jira.

 !pics.jpg! 

> 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
>            Priority: Major
>         Attachments: pics.jpg
>
>
> 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)

Reply via email to