Using the CqlStorage handler
Use the CqlNativeStorage handler with the input_cql statement or use the output_query statement that was available in earlier releases.
To use data in CQL tables created by any version of Cassandra, use the CqlStorage() handler and cql:// url. To access data in the CassandraFS, the target keyspace and table must already exist. Data in a Pig relation can be stored in a Cassandra table, but Pig will not create the table.
DataStax Enterprise supports these Pig data types:
- int
- long
- float
- double
- boolean
- chararray
The Pig LOAD statement pulls Cassandra data into a Pig relation through the storage
handler. The format of the Pig LOAD statement
is:
<pig_relation_name> = LOAD 'cql://<keyspace>/<table>' USING CqlStorage();
The Pig demo examples include using the LOAD command.
LOAD schema
The LOAD Schema is:
(colname:colvalue, colname:colvalue, … )
where each colvalue is referenced by the Cassandra column name.