Quantcast
Channel: Hortonworks » All Replies
Viewing all articles
Browse latest Browse all 3435

Reply To: Tutorial 2: ERROR 2106: Error executing an algebraic function

$
0
0

Thanks @Philippe Back
This updated code from the tutorial runs perfect now. The whole issue was about casting (chararray)$0 as playerID, (int)$1 as year, (int)$8 as runs;

batting = load ‘Batting.csv’ using PigStorage(‘,’);
runs = FOREACH batting GENERATE (chararray)$0 as playerID, (int)$1 as year, (int)$8 as runs;
describe runs;
grp_data = GROUP runs by (year);
max_runs = FOREACH grp_data GENERATE group as grp,MAX(runs.runs) as max_runs;
describe max_runs;
join_max_runs = JOIN max_runs by ($0, max_runs), runs by (year, runs);
describe join_max_runs;
join_data = FOREACH join_max_runs GENERATE $0 as year, $2 as playerID, $1 as runs;
describe join_data
dump join_data;


Viewing all articles
Browse latest Browse all 3435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>