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

Serge Harnyk commented on CALCITE-1167:
---------------------------------------

>From SQL 1999
http://web.cecs.pdx.edu/~len/sql1999.pdf, 8.12 <overlaps predicate>, page 
316-317, General rules:

3)   If D1 is the null value or if E1<D1, then let S1=E1 and let T1=D1.  
Otherwise, let S1=D1 and let T1=E1.

> OVERLAPS doesnt swap operands
> -----------------------------
>
>                 Key: CALCITE-1167
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1167
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Serge Harnyk
>            Assignee: Julian Hyde
>            Priority: Minor
>
> If second date in interval is earlier than first OVERLAPS doesnt swap them.
> Example:
> select 1 from "TEST"."tdt" where (date '1999-12-01' , date '2001-12-31' ) 
> overlaps ( date '2001-01-01' , date '2002-11-11' );
> +------------+
> |   EXPR$0   |
> +------------+
> | 1          |
> | 1          |
> | 1          |
> | 1          |
> +------------+
> select 1 from "TEST"."tdt" where ( date '2001-12-31', date '1999-12-01' ) 
> overlaps ( date '2001-01-01' , date '2002-11-11' );
> +------------+
> |   EXPR$0   |
> +------------+



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to