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

Add TIME/TIMESTAMP/DATE datatype handling to RexImplicationChecker

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.13.0
    • None
    • None

    Description

      In RexImplicationChecker, we support a lot of operators and types, but it looks like time/timestamp/date datatypes are not supported. For example:

      select hiredate from emp where hiredate IN [TIMESTAMP '2017-01-01 10:11:12', TIMESTAMP '2015-01-01 10:11:12']
      

      should imply

      select hiredate from emp where hiredate <= TIMESTAMP '2017-12-01 01:02:03'
      

      since both timestamps in the first query's filter condition is stronger than the second query's filter condition.

      In RexImplicationCheckerTest, there are tests for each of the aforementioned datatypes, but are disabled.

      RexImplicationCheckerTest.testSimpleDate
      RexImplicationCheckerTest.testSimpleTime
      RexImplicationCheckerTest.testSimpleTimestamp
      

      Running these ignored tests, I get the following error messages.

      2017-06-02 17:13:10,028 [main] WARN  - Exception thrown while checking if => >=($8, 2017-06-03): java.sql.Date cannot be cast to java.lang.Integer
      2017-06-02 17:13:10,075 [main] WARN  - Exception thrown while checking if => <=($9, 00:13:10): java.util.GregorianCalendar cannot be cast to java.lang.Long
      2017-06-02 17:13:10,100 [main] WARN  - Exception thrown while checking if => <=($9, 2017-06-03 00:13:10): java.util.GregorianCalendar cannot be cast to java.lang.Long
      

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            minjikim MinJi Kim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: