[
https://issues.apache.org/jira/browse/CALCITE-5334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17622731#comment-17622731
]
Benchao Li commented on CALCITE-5334:
-------------------------------------
You are right, these operators all returnĀ {{BOOLEAN}} type, and in practice,
it's rare to chain these operators. The most common usage is chaining these
operators with {{{}AND{}}}/{{{}OR{}}}/{{{}NOT{}}}. I cannot come up with
meaningful expressions for now, we can revisit this issue in the future if this
really occurs in practice.
> 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)