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/03/29 22:29:00 UTC
UDF for transforming a collection of arrays into an array of structs
Hi,
I am working on ingesting some legacy data that is denormalized in hive
somewhat like the following:
CREATE TABLE mytable (
order_id int,
product_id array<int>,
product_name array<string>,
product_price array<bigint>
....
)
As you see, the product_* fields would better be represented as a
struct<int,string,bigint>.
Is there an UDF that can take a group of arrays and, assuming they're all
the same size, return an array of structs instead ?
I know it's not difficult to implement using generic UDFs, but I was
wondering if anybody had already done it, and if not, if anybody was
actually interested in something like that.
R.
--
----------------------------------------------------------
Good judgement comes with experience.
Experience comes with bad judgement.
----------------------------------------------------------
Roberto Congiu - Data Engineer - OpenX
tel: +1 626 466 1141