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

James Taylor commented on PHOENIX-952:
--------------------------------------

Given that description, I think the most general way of handling ANY/SOME is by 
rewriting the expression during ParseNodeRewriter. You want to pull out the ANY 
and have it wrap the boolean expression in this way:
{code}
    a = ANY(b)
{code}
becomes
{code}
    ANY(a = b[n])
{code}
where the ANY expression loops over each element of b, short-circuiting when 
the inner expression (equality in this example) evaluates to true.

During the rewrite, you'd want to check that b is an ARRAY type and that the 
operator (= in this example) evaluates to a boolean.


> Support ANY and ALL built-ins for ARRAYs
> ----------------------------------------
>
>                 Key: PHOENIX-952
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-952
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 3.0.0, 4.0.0
>            Reporter: James Taylor
>            Assignee: ramkrishna.s.vasudevan
>             Fix For: 3.1, 4.1
>
>         Attachments: Phoenix-932_1.patch, Phoenix-932_2.patch
>
>
> There's currently no good way to search array elements. We should support the 
> ANY and ALL built-ins for our ARRAY type like Postgres does: 
> http://www.postgresql.org/docs/9.1/static/arrays.html#ARRAYS-SEARCHING



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to