[ 
https://issues.apache.org/jira/browse/CALCITE-1829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16037536#comment-16037536
 ] 

MinJi Kim edited comment on CALCITE-1829 at 6/5/17 8:44 PM:
------------------------------------------------------------

Thanks for the review, [~julianhyde].  I will fix the VisitorDataContext as you 
suggested and update the pull request later today.  I didn't know about the 
RexLiteral.getValueAs(), that's really nice!



The test for SqlToRelConverterTest was added while I was just testing the 
changes in VisitorDataContext, and I wanted to see if subquery conversion will 
go through this code for timestamps.  As you said it doesn't go through the 
VisitorDataContext since we generate ISNULL operator which has special 
handling.  I will remove it.


was (Author: minjikim):
Thanks for the review, [~julianhyde].  I will fix the VisitorDataContext as you 
suggested and update the pull request later today.

The test for SqlToRelConverterTest was added while I was just testing the 
changes in VisitorDataContext, and I wanted to see if subquery conversion will 
go through this code for timestamps.  As you said it doesn't go through the 
VisitorDataContext since we generate ISNULL operator which has special 
handling.  I will remove it.

> Add TIME/TIMESTAMP/DATE datatype handling to RexImplicationChecker
> ------------------------------------------------------------------
>
>                 Key: CALCITE-1829
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1829
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: MinJi Kim
>            Assignee: Julian Hyde
>
> In RexImplicationChecker, we support a lot of operators and types, but it 
> looks like time/timestamp/date datatypes are not supported.  For example:
> {code}
> select hiredate from emp where hiredate IN [TIMESTAMP '2017-01-01 10:11:12', 
> TIMESTAMP '2015-01-01 10:11:12']
> {code}
> should imply
> {code}
> select hiredate from emp where hiredate <= TIMESTAMP '2017-12-01 01:02:03'
> {code}
> 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.
> {code}
> RexImplicationCheckerTest.testSimpleDate
> RexImplicationCheckerTest.testSimpleTime
> RexImplicationCheckerTest.testSimpleTimestamp
> {code}
> Running these ignored tests, I get the following error messages.
> {code}
> 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
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to