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

James Taylor commented on PHOENIX-953:
--------------------------------------

This should work:
{code}
select p from a where p IN ( select unnest(k) from a )
{code}
[~julianhyde] - do you know where UNNEST is allowed to be used?

[~ram_krish] - a good guide is what Postgres allows.

Also, UNNEST should accept multiple arguments to return multiple columns as 
described here: 
http://www.toadworld.com/platforms/ibmdb2/w/wiki/7791.sql-pl-array-functions-unnest

[~maryannxue] - any advice for Ram & Dumindu? I've also seen examples of UNNEST 
used in joins, like this: 
http://stackoverflow.com/questions/8760419/postgresql-unnest-with-element-number.
 Should we support any simple variation for this? 

> Support UNNEST for ARRAY
> ------------------------
>
>                 Key: PHOENIX-953
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-953
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: James Taylor
>            Assignee: Dumindu Buddhika
>         Attachments: PHOENIX-953-v1.patch
>
>
> The UNNEST built-in function converts an array into a set of rows. This is 
> more than a built-in function, so should be considered an advanced project.
> For an example, see the following Postgres documentation: 
> http://www.postgresql.org/docs/8.4/static/functions-array.html
> http://www.anicehumble.com/2011/07/postgresql-unnest-function-do-many.html
> http://tech.valgog.com/2010/05/merging-and-manipulating-arrays-in.html
> So the UNNEST is a way of converting an array to a flattened "table" which 
> can then be filtered on, ordered, grouped, etc.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to