Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive, mail # user - Generic UDFs and named parameters

Copy link to this message
Generic UDFs and named parameters
Roberto Congiu 2013-09-17, 02:00
Hey guys,
I wrote a generic UDF that takes a variable name of arrays and returns an
array of structs built with the input arrays, something like:

structify(array1,array2,array3) -> returns an array of structs structarray
where structarray[0] = [{ array1[0],array2[0],array3[0]}, {array1[1],
array2[1], array3[1]}, ... etc ]

now, I'd like to pass somehow the name of the struct fields so I was
thinking it would be nice to have something like
structify(array1 AS myfield, array2 AS myotherfield ..  ) and have the
generic UDF optionally receive a String[]  with all the parameter names
passed with AS.

I may try to code a patch for it, would anybody be interested, or better,
already worked on this ?


Good judgement comes with experience.
Experience comes with bad judgement.
Roberto Congiu - Data Engineer - OpenX
tel: +1 626 466 1141