Skip to content
Browse files

Minor correction in pig readme/example.

Patch by Fabian Rousseau, reviewed by brandonwilliams for CASSANDRA-4301
  • Loading branch information...
1 parent 25c7a71 commit d71250349d250c37d4d40261694a9a047f75a468 @driftx driftx committed May 31, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 examples/pig/README.txt
  2. +1 −1 examples/pig/example-script.pig
View
4 examples/pig/README.txt
@@ -52,12 +52,12 @@ grunt> cols = FOREACH rows GENERATE flatten(columns);
grunt> colnames = FOREACH cols GENERATE $0;
grunt> namegroups = GROUP colnames BY (chararray) $0;
grunt> namecounts = FOREACH namegroups GENERATE COUNT($1), group;
-grunt> orderednames = ORDER namecounts BY $0;
+grunt> orderednames = ORDER namecounts BY $0 DESC;
grunt> topnames = LIMIT orderednames 50;
grunt> dump topnames;
Slices on columns can also be specified:
-grunt> rows = LOAD 'cassandra://MyKeyspace/MyColumnFamily&slice_start=C2&slice_end=C4&limit=1&reversed=true' USING CassandraStorage();
+grunt> rows = LOAD 'cassandra://MyKeyspace/MyColumnFamily?slice_start=C2&slice_end=C4&limit=1&reversed=true' USING CassandraStorage();
Binary values for slice_start and slice_end can be escaped such as '\u0255'
View
2 examples/pig/example-script.pig
@@ -3,6 +3,6 @@ cols = FOREACH rows GENERATE flatten(columns);
colnames = FOREACH cols GENERATE $0;
namegroups = GROUP colnames BY (chararray) $0;
namecounts = FOREACH namegroups GENERATE COUNT($1), group;
-orderednames = ORDER namecounts BY $0;
+orderednames = ORDER namecounts BY $0 DESC;
topnames = LIMIT orderednames 50;
dump topnames;

0 comments on commit d712503

Please sign in to comment.
Something went wrong with that request. Please try again.