I'm using the python & hive UDF to unpivot data. 'python.py' unpivots the data but I want to run this on Hive. I'm not able to get a handle on items that contain space and period.
Is there a good way to get around it?
My starting table looks like:
store item flavor ------- ----------------- ------------ 1 cupcake chocolate 1 cake pops red velvet 1 ice cream vanilla 1 cookies/candies lemon 2 cupcake red velvet 2 cake pops vanilla 2 ice cream chocolate 2 cookies/candies chocolate
I'm using inner code to obtain:
store cupcake cake pops ice cream cookies/candies ------- ------------ ------------ ----------- ----------------- 1 chocolate red velvet vanilla lemon 2 red velvet vanilla chocolate chocolate
using:
SELECT TRANSFORM(store, item, flavor) USING ‘python.py’
AS (store, cupcake, cake pops, ice cream, cookies/candies) FROM mytable;
gives an error: "Error while compiling statement: FAILED: ParseException line 3:25 mismatched input 'pops' expecting ) near 'cake' in transform clause"