CQL data access

Use the CqlNativeStorage handler with the new input_cql statement or use the output_query statement that was available in earlier releases.

In DataStax Enterprise 4.5.2, to access data in CQL tables, use the CqlNativeStorage handler with the new input_cql statement or use the output_query statement that was available in earlier releases.

In DataStax Enterprise 4.5.0-4.5.1, to access data in CQL tables, use the CqlStorage() handler. 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 these examples:
  • DataStax Enterprise 4.5.2
    <pig_relation_name> = LOAD 'cql://<keyspace>/<table>' 
        USING CqlNativeStorage(); -- DataStax Enterprise 4.5.2
  • DataStax Enterprise 4.5 - 4.5.1
    <pig_relation_name> = LOAD 'cql://<keyspace>/<table>' 
        USING CqlStorage(); -- DataStax Enterprise 4.5.0 - 4.5.1
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.