Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2888

Enhance RexImplicationChecker to better handle filters with CAST

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • core

    Description

      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. 

      Attachments

        Issue Links

          Activity

            People

              Juhwan Juhwan Kim
              Juhwan Juhwan Kim
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m