I am trying to write data to Cassandra CQL 3 Table using:
STORE G INTO 'cql://keyapse/col_family?output_query=not sure what goes here' USING CqlStorage();
What does the output_query look like:
UPDATE col_family SET col1=$0, col2=$3 WHERE KEY=$2
I am trying to write data to Cassandra CQL 3 Table using:
STORE G INTO 'cql://keyapse/col_family?output_query=not sure what goes here' USING CqlStorage();
What does the output_query look like:
UPDATE col_family SET col1=$0, col2=$3 WHERE KEY=$2
You need to take care on both: the storage URL and the data preparation. This is an example that should work.
Suppose you need to insert data in the following structure:
CREATE TABLE example (
row_id text PRIMARY KEY,
value1 text,
value2 int
);
You need to prepare the data like this:
data_to_insert = FOREACH some_set_of_data GENERATE
TOTUPLE(TOTUPLE('row_id',row_id)), TOTUPLE(value1, value2) ;
Finally the storing statement will be:
STORE data_to_insert INTO 'cql://my/example?output_query=update example set value1 @ # , value2 @ #' USING CqlStorage();
This blog has some details, but no specific examples: http://www.datastax.com/dev/blog/cql3-table-support-in-hadoop-pig-and-hive
I wrote up a brief how to on using PIG as a Data loader for Cassandra using CQL3.
http://www.schappet.com/pig_cassandra_bulk_load
Basic setup includes the info from @Kernald
STORE data_to_insert INTO
'cql://myschema/example?output_query=update example set value1 @ #,value2 @ #' USING CqlStorage();