Merge from 1.0

This commit is contained in:
Brandon Williams 2012-02-14 14:19:47 -06:00
commit 3a4459f0a6
2 changed files with 6 additions and 4 deletions

View File

@ -47,7 +47,7 @@ examples/pig$ bin/pig_cassandra -x local
Once the 'grunt>' shell has loaded, try a simple program like the
following, which will determine the top 50 column names:
grunt> rows = LOAD 'cassandra://MyKeyspace/MyColumnFamily' USING CassandraStorage() AS (key, columns: bag {T: tuple(name, value)});
grunt> rows = LOAD 'cassandra://MyKeyspace/MyColumnFamily' USING CassandraStorage();
grunt> cols = FOREACH rows GENERATE flatten(columns);
grunt> colnames = FOREACH cols GENERATE $0;
grunt> namegroups = GROUP colnames BY (chararray) $0;
@ -57,7 +57,7 @@ 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() AS (key, columns: bag {T: tuple(name, value)});
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'
@ -68,3 +68,5 @@ grunt> STORE rows into 'cassandra://MyKeyspace/MyColumnFamily' USING CassandraSt
Which will copy the ColumnFamily. Note that the destination ColumnFamily must
already exist for this to work.
See the example in test/ to see how schema is inferred.

View File

@ -1,8 +1,8 @@
rows = LOAD 'cassandra://MyKeyspace/MyColumnFamily' USING CassandraStorage() AS (key, columns: bag {T: tuple(name, value)});
rows = LOAD 'cassandra://MyKeyspace/MyColumnFamily' USING CassandraStorage();
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;
topnames = LIMIT orderednames 50;
dump topnames;
dump topnames;