hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shayne Grant <>
Subject UDTF returning dynamic number of output columns
Date Fri, 26 Jun 2015 18:31:13 GMT
I am trying to create a HIVE UDTF like the following:

select MyUDFT(parm1, parm2) from MyTable;

I would like to use the value of parm1 to determine how many columns of out= put the UDTF
should have.  The way I understand UDTFs, the initialize() met= hod has to define all the
output columns before the process() method is inv= oked, however the initialize() method is
not given the value of the paramet= ers.  I have many possible values for parm1 and each value
will dictate how=  many output columns are needed.  It's not possible for me to code all poss=
ibilities for parm1 within my UDTF.  Can someone confirm that I can only se= t the output
columns in the initialize() method and whether there is any wa= y for me to achieve having
a dynamic number of output columns using the val= ue of a parameter to the UDTF?


View raw message