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

Julian Hyde commented on CALCITE-5160:
--------------------------------------

{{ANY}} and {{SOME}} are not functions, they are operators that use the syntax 
"expression operator ANY (array expression)". Your description might make 
people think you are referring to the {{ANY}} and {{SOME}} aggregate functions 
(and the related {{EVERY}} aggregate function), which are totally different.

If you implement {{ANY}}/{{SOME}} operators for arrays you should also 
implement {{EVERY}}, and you should also implement for multisets.

Your second example,
{code:java}
SELECT 1 = SOME(<table>.<array_type_field> FROM <table>)
{code}
uses a syntax I am not familiar with, namely {{FROM}} without preceding 
{{SELECT}}. That seems to be to an orthogonal feature, and should be done in a 
separate Jira and PR.

> ANY, SOME functions should support scalar arrays
> ------------------------------------------------
>
>                 Key: CALCITE-5160
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5160
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Dmitry Sysolyatin
>            Priority: Major
>
> At the moment ANY, SOME functions support subquery:
> {code}
> SELECT 1 = SOME (SELECT * FROM UNNEST(ARRAY[1,2,3]))
> {code}
> But if input argument is array, then query fails
> {code}
> SELECT 1 = SOME (ARRAY[1,2,3])
> SELECT 1 = SOME(<table>.<array_type_field> FROM <table>)
> {code}
> [https://www.postgresql.org/docs/current/functions-comparisons.html#id-1.5.8.30.16]
> It is useful for checking if a value exists in an array.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to