From 168482bc113616206701d86fd9db29849a3635b5 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 26 Jun 2013 19:10:05 -0500 Subject: [PATCH] Add forgotten updates --- examples/pig/README.txt | 21 ++++++++++++++++++--- examples/pig/test/test_storage.pig | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/examples/pig/README.txt b/examples/pig/README.txt index e3d9af6a82..6dc0937120 100644 --- a/examples/pig/README.txt +++ b/examples/pig/README.txt @@ -32,7 +32,10 @@ for input and output: * PIG_OUTPUT_RPC_PORT : the port thrift is listening on for writing * PIG_OUTPUT_PARTITIONER : cluster partitioner for writing -Then you can run it like this: +CassandraStorage +================ + +The CassandraStorage class is for any non-CQL3 ColumnFamilies you may have. For CQL3 support, refer to the CqlStorage section. examples/pig$ bin/pig_cassandra -x local example-script.pig @@ -71,8 +74,8 @@ already exist for this to work. See the example in test/ to see how schema is inferred. -Advanced Options -================ +Advanced Options for CassandraStorage +===================================== The following environment variables default to false but can be set to true to enable them: @@ -92,3 +95,15 @@ PIG_INPUT_SPLIT_SIZE: this sets the split size passed to Hadoop, controlling the amount of mapper tasks created. This can also be set in the LOAD url by adding the 'split_size=X' parameter, where X is an integer amount for the size. +CqlStorage +========== + +The CqlStorage class is somewhat similar to CassandraStorage, but it can work with CQL3-defined ColumnFamilies. The main difference is in the URL format: + +cql://[username:password@]/[?[page_size=][&columns=][&output_query=][&where_clause=][&split_size=][&partitioner=]] + +Which in grunt, the simplest example would look like: + +grunt> rows = LOAD 'cql://MyKeyspace/MyColumnFamily' USING CqlStorage(); + +CqlStorage handles wide rows automatically and thus has no separate flag for this. diff --git a/examples/pig/test/test_storage.pig b/examples/pig/test/test_storage.pig index 93dd91f2db..026cb025a9 100644 --- a/examples/pig/test/test_storage.pig +++ b/examples/pig/test/test_storage.pig @@ -1,4 +1,4 @@ -rows = LOAD 'cassandra://PigTest/SomeApp?widerows=true' USING CassandraStorage(); +rows = LOAD 'cassandra://PigTest/SomeApp' USING CassandraStorage(); -- full copy STORE rows INTO 'cassandra://PigTest/CopyOfSomeApp' USING CassandraStorage(); -- single tuple