Nissan 370Z Forum

Nissan 370Z Forum (http://www.the370z.com/)
-   The Lounge (Off Topic) (http://www.the370z.com/lounge-off-topic/)
-   -   Anyone know PIG/Hive queries? (http://www.the370z.com/lounge-off-topic/86346-anyone-know-pig-hive-queries.html)

DIGItonium 03-04-2014 04:04 PM

Anyone know PIG/Hive queries?
 
I'm trying to do something relatively simple in PIG, but it's tough. Basically I want to load time series data with known schema (flat csv list of values), and a list of value pairs. For each item in the list, I want to filter down the data based on it's ID, and then call a function to decode and generate each tuple. I'm having trouble trying to filter, and it might be caused by a bug in PIG or something.

/* Input */
data // Time series data (year:int, month:int, day:int..., param_id:int, value:chararray)
parm // (id:int, sub_id:int)

/* Get rows target parameter */
out = FOREACH parm
{
p_tar = FILTER data BY param_id == id;
--GENERATE FLATTEN(p_tar.(year, month, day, hour, minute, second, millisecond, model, serial)), id AS id, sub_id AS sub_id, GetValue(p_tar, parm.id, parm.sub_id) as val:double;
}
dump out;


All times are GMT -5. The time now is 05:26 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 PL2