You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Juhwan Kim (JIRA)" <ji...@apache.org> on 2019/03/01 18:39:00 UTC

[jira] [Created] (CALCITE-2888) Enhance RexImplicationChecker to better handle filters with CAST

Juhwan Kim created CALCITE-2888:
-----------------------------------

             Summary: Enhance RexImplicationChecker to better handle filters with CAST
                 Key: CALCITE-2888
                 URL: https://issues.apache.org/jira/browse/CALCITE-2888
             Project: Calcite
          Issue Type: Improvement
          Components: core
            Reporter: Juhwan Kim
            Assignee: Juhwan Kim


I saw some cases where RexImplicationChecker gave an AssertionError when CAST was involved in the filters.

For example, if a filter is
'>(CAST(SOME_VHARCHAR_INPUT_REF, DATE), SOME_DATE_LITERAL)',
currently, it removes CAST first and tries to convert DATE literal to VARCHAR type,
which is not supported, and runtime AssertionError is thrown during implication checking.

I think the issue can be solved by using RexExecutor's reduce function before removing cast from literal side. Also, allowing other implementations of RexExecutor would make it more flexible. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)