You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2013/11/20 18:56:54 UTC

[2/3] git commit: update pig example scripts Patch by Jeremy Hanna, reviewed by brandonwilliams for CASSANDRA-6239

update pig example scripts
Patch by Jeremy Hanna, reviewed by brandonwilliams for CASSANDRA-6239


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/5f79f532
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/5f79f532
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/5f79f532

Branch: refs/heads/cassandra-2.0
Commit: 5f79f5321bbbbac383b727fbbf60891b4c5e4136
Parents: 026865f
Author: Brandon Williams <br...@apache.org>
Authored: Wed Nov 20 10:19:17 2013 -0600
Committer: Brandon Williams <br...@apache.org>
Committed: Wed Nov 20 10:19:17 2013 -0600

----------------------------------------------------------------------
 examples/pig/example-script-cql.pig | 11 +++++++++++
 examples/pig/example-script.pig     | 14 +-------------
 2 files changed, 12 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5f79f532/examples/pig/example-script-cql.pig
----------------------------------------------------------------------
diff --git a/examples/pig/example-script-cql.pig b/examples/pig/example-script-cql.pig
new file mode 100644
index 0000000..63656a7
--- /dev/null
+++ b/examples/pig/example-script-cql.pig
@@ -0,0 +1,11 @@
+-- CqlStorage
+libdata = LOAD 'cql://libdata/libout' USING CqlStorage();
+book_by_mail = FILTER libdata BY C_OUT_TY == 'BM';
+
+libdata_buildings = FILTER libdata BY SQ_FEET > 0;
+state_flat = FOREACH libdata_buildings GENERATE STABR AS State,SQ_FEET AS SquareFeet;
+state_grouped = GROUP state_flat BY State;
+state_footage = FOREACH state_grouped GENERATE group AS State, SUM(state_flat.SquareFeet) AS TotalFeet:int;
+
+insert_format= FOREACH state_footage GENERATE TOTUPLE(TOTUPLE('year',2011),TOTUPLE('state',State)),TOTUPLE(TotalFeet);
+STORE insert_format INTO 'cql://libdata/libsqft?output_query=UPDATE%20libdata.libsqft%20SET%20sqft%20%3D%20%3F' USING CqlStorage;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5f79f532/examples/pig/example-script.pig
----------------------------------------------------------------------
diff --git a/examples/pig/example-script.pig b/examples/pig/example-script.pig
index 8b69b99..d47fc28 100644
--- a/examples/pig/example-script.pig
+++ b/examples/pig/example-script.pig
@@ -6,16 +6,4 @@ namegroups = GROUP colnames BY (chararray) $0;
 namecounts = FOREACH namegroups GENERATE COUNT($1), group;
 orderednames = ORDER namecounts BY $0 DESC;
 topnames = LIMIT orderednames 50;
-dump topnames;
-
--- CqlStorage
-libdata = LOAD 'cql://libdata/libout' USING CqlStorage();
-book_by_mail = FILTER libdata BY C_OUT_TY == 'BM';
-
-libdata_buildings = FILTER libdata BY SQ_FEET > 0;
-state_flat = FOREACH libdata_buildings GENERATE STABR AS State,SQ_FEET AS SquareFeet;
-state_grouped = GROUP state_flat BY State;
-state_footage = FOREACH state_grouped GENERATE GROUP AS State, SUM(state_flat.SquareFeet) AS TotalFeet:int;
-
-insert_format= FOREACH state_footage GENERATE TOTUPLE(TOTUPLE('year',2011),TOTUPLE('state',State)),TOTUPLE(TotalFeet);
-STORE insert_format INTO 'cql://libdata/libsqft?output_query=UPDATE%20libdata.libsqft%20SET%20sqft%20%3D%20%3F' USING CqlStorage;
\ No newline at end of file
+dump topnames;
\ No newline at end of file