You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Roberto Congiu <ro...@openx.com> on 2013/09/17 04:00:30 UTC

Generic UDFs and named parameters

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 ?

R.

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