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

Julian Hyde commented on CALCITE-6116:
--------------------------------------

[~hongyuguo], I'll review your [PR 
3502|https://github.com/apache/calcite/pull/3502] in CALCITE-3679, because it 
fixes both issues.

> Add EXISTS function (enabled in Spark library)
> ----------------------------------------------
>
>                 Key: CALCITE-6116
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6116
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.36.0
>            Reporter: hongyu guo
>            Assignee: hongyu guo
>            Priority: Major
>             Fix For: 1.37.0
>
>
> exists(expr, pred) - Tests whether a predicate holds for one or more elements 
> in the array.
> {code:sql}
> > SELECT `EXISTS`(array(1, 2, 3), x -> x % 2 == 0);
>  true
> > SELECT `EXISTS`(array(1, 2, 3), x -> x % 2 == 10);
>  false
> > SELECT `EXISTS`(array(1, null, 3), x -> x % 2 == 0);
>  NULL
> > SELECT `EXISTS`(array(0, null, 2, 3, null), x -> x IS NULL);
>  true
> > SELECT `EXISTS`(array(1, 2, 3), x -> x IS NULL);
>  false
> {code}
> In Calcite, EXISTS is a keyword, so we need to specify the function with back 
> quotes.
> Moreover, `EXISTS` is a higher-order function, and if we want to support 
> higher-order functions in Calcite, we must first support lambda expressions



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

Reply via email to