You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Gary Zhao <ga...@gmail.com> on 2013/09/29 01:46:23 UTC

Question on LATERAL VIEW explode

Hello

Do you know if my scenario is supported or not, or how I may do it.
Basically, I have an array in a recode, like

[1, 2, 3]

What I want is to explode it twice so I can have the following output:

1 2
1 3
2 1
2 3
3 1
3 2

I tried a few queries but couldn't make it succeed.

Thanks
Gary

Re: Question on LATERAL VIEW explode

Posted by Rajesh Nagaraju <ra...@gmail.com>.
Hi Gary

I would say write an UDF

Thanks and Regards
Rajesh


On Sun, Sep 29, 2013 at 5:16 AM, Gary Zhao <ga...@gmail.com> wrote:

> Hello
>
> Do you know if my scenario is supported or not, or how I may do it.
> Basically, I have an array in a recode, like
>
> [1, 2, 3]
>
> What I want is to explode it twice so I can have the following output:
>
> 1 2
> 1 3
> 2 1
> 2 3
> 3 1
> 3 2
>
> I tried a few queries but couldn't make it succeed.
>
> Thanks
> Gary
>
>