You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Krisztian Kasa (Jira)" <ji...@apache.org> on 2025/01/15 14:03:00 UTC
[jira] [Created] (CALCITE-6787) Simplification process fails to remove the 'is not null' predicate
Krisztian Kasa created CALCITE-6787:
---------------------------------------
Summary: Simplification process fails to remove the 'is not null' predicate
Key: CALCITE-6787
URL: https://issues.apache.org/jira/browse/CALCITE-6787
Project: Calcite
Issue Type: Bug
Components: core
Reporter: Krisztian Kasa
Let's have the following expression:
{code}
AND(IS NOT NULL($0), <=(0, $0), <=($0, 100))
{code}
{{$0}} is a {{nullable integer}} column
The expression is a filter condition coming from a where clause in a query
In Calcite 1.25 this expression is simplified to
{code}
AND(>=($0, 0), >=(100, $0))
{code}
So the {{IS NOT NULL($2)}} predicate is removed.
In Calcite 1.33
{code}
SEARCH($0, Sarg[[0..100]; NULL AS FALSE])
{code}
and with {{RexUtil.searchShuttle}} it is transformed to
{code}
AND(IS NOT NULL($0), AND(>=($0, 0), <=($0, 100)))
{code}
I bumped into this behaviour change when upgrading Calcite in Hive from 1.25 to 1.33 or higher.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)