hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Furcy Pin <>
Subject Re: One column into multiple column.
Date Thu, 24 Aug 2017 08:39:17 GMT

You can use the split(string, pattern) UDF, that returns an array.
You can compute this array in a subquery, and then assign a[0], a[1], a[2]
... to each column.
The split UDF will only be called once per row.

On Thu, Aug 24, 2017 at 12:11 AM, Deepak Khandelwal <> wrote:

> Can someone tell the best way to implement below in hive.
>  how can we take input from column c1 from tab Such that c1 has multiple
> values delimited by pipe. Each of the delimited value from col c1 of table
> t1 needs to be inserted into separate column in table t2.
> I can write a UDF for this but this udf I have to call 10 times to
> retrieve 10 delimited values from c1 of table t1 and then insert them into
> 10 separate cols of table t2. I am just trying to find out if there is a
> better way to do this so that I don't have to call udf 10 times
>  Thanks

View raw message