-1

I cannot get this script to work:

raw = LOAD 's3://xxxxxxxxx/*' AS (name:chararray, year:float, occurrences:float, books:float);
B = GROUP raw BY name;
C = FOREACH B GENERATE B.name, (SUM(B.occurrences) / SUM(B.books)) AS average;
D = ORDER C BY average DESC;
E = LIMIT D 10;
STORE E INTO 's3://xxxxxx';
o-90
  • 17,045
  • 10
  • 39
  • 63

1 Answers1

0

The statement C is not right, you can't access the variable name,occurrences and books using Relation B. This should be accessible only by relation raw. Can you change your stmt C something like this?

C = FOREACH B GENERATE group, SUM(raw.occurrences)/SUM(raw.books) AS average;

here group refer to variable name

If you face any other issues, please paste your error logs.

Sivasakthi Jayaraman
  • 4,724
  • 3
  • 17
  • 27