You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Dmitry Sysolyatin (Jira)" <ji...@apache.org> on 2022/06/17 19:02:00 UTC

[jira] [Commented] (CALCITE-5160) ANY, SOME operators should support scalar arrays

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

Dmitry Sysolyatin commented on CALCITE-5160:
--------------------------------------------

I managed to make it work for scalar arrays and multisets. But I don't know how to make it work with array column. For example:
{code}
SELECT 3 = some(x.t)
FROM "bookstore"."authors" au
INNER JOIN (SELECT ARRAY[1,2,3,4] as t) as x ON true
{code}
throws:
{code}
index (4) must be less than size (1)
{code}
from convertMultiset method.

Can someone help ? Commit - https://github.com/dssysolyatin/calcite/commit/0f45d7b5cc5967a87c6d6247256e3ffabde40dae

> ANY, SOME operators 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)