You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jo...@apache.org on 2010/06/12 15:08:01 UTC
svn commit: r953999 - in /cassandra/branches/cassandra-0.6/contrib/pig:
README.txt bin/pig_cassandra build.xml example-script.pig
Author: johan
Date: Sat Jun 12 13:08:00 2010
New Revision: 953999
URL: http://svn.apache.org/viewvc?rev=953999&view=rev
Log:
Remove references to -dev version of pig, add example script. Patch by Jeremy Hanna, review by johan. CASSANDRA-1150
Added:
cassandra/branches/cassandra-0.6/contrib/pig/example-script.pig
Modified:
cassandra/branches/cassandra-0.6/contrib/pig/README.txt
cassandra/branches/cassandra-0.6/contrib/pig/bin/pig_cassandra
cassandra/branches/cassandra-0.6/contrib/pig/build.xml
Modified: cassandra/branches/cassandra-0.6/contrib/pig/README.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/contrib/pig/README.txt?rev=953999&r1=953998&r2=953999&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/contrib/pig/README.txt (original)
+++ cassandra/branches/cassandra-0.6/contrib/pig/README.txt Sat Jun 12 13:08:00 2010
@@ -4,14 +4,22 @@ Setup:
First build and start a Cassandra server with the default
configuration* and set the PIG_HOME and JAVA_HOME environment
-variables to the location of a Pig >= 0.7.0-dev install and your Java
+variables to the location of a Pig >= 0.7.0 install and your Java
install. If you would like to run using the Hadoop backend, you should
also set PIG_CONF_DIR to the location of your Hadoop config.
Run:
contrib/pig$ ant
-contrib/pig$ bin/pig_cassandra
+contrib/pig$ bin/pig_cassandra -x local example-script.pig
+
+This will run the test script against your Cassandra instance
+and will assume that there is a Keyspace1/Standard1 with some
+data in it. It will run in local mode (see pig docs for more info).
+
+If you'd like to get to a 'grunt>' shell prompt, run:
+
+contrib/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:
Modified: cassandra/branches/cassandra-0.6/contrib/pig/bin/pig_cassandra
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/contrib/pig/bin/pig_cassandra?rev=953999&r1=953998&r2=953999&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/contrib/pig/bin/pig_cassandra (original)
+++ cassandra/branches/cassandra-0.6/contrib/pig/bin/pig_cassandra Sat Jun 12 13:08:00 2010
@@ -33,7 +33,7 @@ fi
CLASSPATH=$CLASSPATH:$LOADFUNC_JAR
if [ "x$PIG_HOME" = "x" ]; then
- echo "PIG_HOME not set: requires Pig >= 0.7.0-dev" >&2
+ echo "PIG_HOME not set: requires Pig >= 0.7.0" >&2
exit 1
fi
Modified: cassandra/branches/cassandra-0.6/contrib/pig/build.xml
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/contrib/pig/build.xml?rev=953999&r1=953998&r2=953999&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/contrib/pig/build.xml (original)
+++ cassandra/branches/cassandra-0.6/contrib/pig/build.xml Sat Jun 12 13:08:00 2010
@@ -49,7 +49,7 @@
</target>
<target depends="init" name="build">
- <fail unless="env.PIG_HOME" message="Please set PIG_HOME to the location of a Pig >= 0.7.0-dev install." />
+ <fail unless="env.PIG_HOME" message="Please set PIG_HOME to the location of a Pig >= 0.7.0 install." />
<javac destdir="${build.classes}">
<src path="${build.src}" />
<classpath refid="classpath" />
Added: cassandra/branches/cassandra-0.6/contrib/pig/example-script.pig
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/contrib/pig/example-script.pig?rev=953999&view=auto
==============================================================================
--- cassandra/branches/cassandra-0.6/contrib/pig/example-script.pig (added)
+++ cassandra/branches/cassandra-0.6/contrib/pig/example-script.pig Sat Jun 12 13:08:00 2010
@@ -0,0 +1,8 @@
+rows = LOAD 'cassandra://Keyspace1/Standard1' USING CassandraStorage();
+cols = FOREACH rows GENERATE flatten($1);
+colnames = FOREACH cols GENERATE $0;
+namegroups = GROUP colnames BY $0;
+namecounts = FOREACH namegroups GENERATE COUNT($1), group;
+orderednames = ORDER namecounts BY $0;
+topnames = LIMIT orderednames 50;
+dump topnames;