0

I Have a data coming from UDF as bag Output:({(http://www.myurl.com 1000 1000)}) How do I generate 3 different fields from this bag as url, height,width.

1 Answers1

0

Use flatten operator,

GENERATE flatten ({(http://www.myurl.com 1000 1000)}) as myTuple

will gives this tuple :

(http://www.myurl.com 1000 1000)

And to get 3 tuples we need STRSPLIT:

STRSPLIT(myTuple,' ',3))as(url:chararray,height:chararray,width:chararray)
54l3d
  • 3,913
  • 4
  • 32
  • 58