Hello, 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 < dkhandelwal....@gmail.com> 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 >