Nissan 370Z Forum  

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

Go Back   Nissan 370Z Forum > Nissan 370Z General Area > The Lounge (Off Topic)


Reply
 
LinkBack Thread Tools Display Modes
Old 03-04-2014, 04:04 PM   #1 (permalink)
A True Z Fanatic
 
DIGItonium's Avatar
 
Join Date: Jan 2009
Location: Kansas
Posts: 3,800
Drives: 09 Z34-TT 6MT
Rep Power: 42
DIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond repute
Question 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;
__________________
http://www.the370z.com/image.php?type=sigpic&userid=950&dateline=13162988  42
DIGItonium is offline   Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 03:41 AM.


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