DataStax Enterprise 4.0

Saving a Pig relation to Cassandra

The Pig STORE command pushes data from a Pig relation to Cassandra through the CqlStorage handler (DataStax Enterprise 4.0 - 4.0.3) or CqlNativeStorage handler (DataStax Enterprise 4.0.4 and later):

STORE <relation_name> INTO 'cql://<keyspace>/<column_family>?<prepared statement>'
  USING CqlStorage();                       -- DataStax Enterprise 4.0 - 4.0.3

STORE <relation_name> INTO 'cql://<keyspace>/<column_family>?<prepared statement>'
  USING CqlNativeStorage();                 -- DataStax Enterprise 4.0.4

Store schema

The input schema for Store is:

(value, value, value)

where each value schema has the name of the column and value of the column value.

The output schema for Store is:

(((name, value), (name, value)), (value ... value), (value ... value))

where the first tuple is the map of partition key and clustering columns. The rest of the tuples are the list of bound values for the output in a prepared CQL query.

Show/hide