CQL data access 

Use the CqlNativeStorage handler with the input_cql statement or use the output_query statement to pull Cassandra data into a Pig relation.

Use the CqlNativeStorage handler with the input_cql statement or the output_query statement. 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.

The Pig LOAD function pulls Cassandra data into a Pig relation through the storage handler as shown in this examples:
pig_relation_name = LOAD 'cql://keyspace/table' 
    USING CqlNativeStorage(); 
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 CqlNativeStorage();

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.