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

Julian Hyde commented on CALCITE-5334:
--------------------------------------

A lot of cases don't matter in practice because of data types. There may be 
several interpretations of an expression (depending on operator precedence) but 
only one makes sense. Especially when many operators return BOOLEAN. People are 
never going to write "x IN y LIKE z".

If there are any meaningful expressions that contain operators with similar 
precedence, it's worthwhile having tests for these. I think there are a few 
already in SqlParserTest. Then document what we have and move on. If people 
strongly feel that the operator precedence is wrong, we can reconsider in a 
separate Jira case.

> The precedence for CONTAINS/OVERLAPS is inconsistent with doc
> -------------------------------------------------------------
>
>                 Key: CALCITE-5334
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5334
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.32.0
>            Reporter: Benchao Li
>            Assignee: Benchao Li
>            Priority: Major
>
> In the document, we says that {{CONTAINS}}/{{OVERLAPS}}'s precedence is the 
> same as {{IN}}/{{LIKE}} etc. 
> https://github.com/apache/calcite/blob/2c30a56158cdd351d35725006bc1f76bb6aac75b/site/_docs/reference.md?plain=1#L1216
> However, the actual precedence for {{IN}}/{{LIKE}} is 32, and 
> {{CONTAINS}}/{{OVERLAPS}} is 30.
> Hence the below SQL will fail due to this:
> {code:sql}
> select (date '2020-01-01', date '2020-12-31') contains (date 
> '2020-11-01',date '2020-12-01') in (true, true);
> {code}



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

Reply via email to