[
https://issues.apache.org/jira/browse/CALCITE-3464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16963839#comment-16963839
]
Zoltan Haindrich commented on CALCITE-3464:
-------------------------------------------
[~zabetak] you are fast :D
[~yanlin-Lynn] if you want to check that a field is null; use "x IS NULL" there
is also spaceship (<=>) which compares null as equal
> 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
>
> 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)