Mihai Budiu created CALCITE-7418:
------------------------------------

             Summary: SqlOperalsOperator does not reject some illegal 
comparisons (e.g., TIME vs DATE)
                 Key: CALCITE-7418
                 URL: https://issues.apache.org/jira/browse/CALCITE-7418
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.41.0
            Reporter: Mihai Budiu


Comparing a TIME against a DATE is rejected by the validator:
{code:java}
SELECT TIME '10:00:00' < DATE '2004-01-01' {code}
produces:
{code:java}
Cannot apply '<' to arguments of type '<TIME(0)> < <DATE>'. Supported form(s): 
'<COMPARABLE_TYPE> < <COMPARABLE_TYPE>' {code}
However:
{code:java}
SELECT (DATE '2020-06-21', DATE '2020-06-21' + INTERVAL '1' YEAR) CONTAINS TIME 
'12:00:00' {code}
is accepted without error by the validator, and later desugared by the standard 
convertlet table into a comparison between a DATE and a TIME.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to