0
votes

I am trying to load simple table created in Cassandra sing cql command. But load is failing when I try to dump .my pig script looks like this.

    A = LOAD 'cql://pigtest/myusers' USING CqlStorage()
        AS (user_id:int,fname:chararray,lname:chararray);
    describe A;
    DUMP A;

My users table schema looks like

CREATE TABLE users (
  user_id int ( primary key), 
  fnam text, 
  lname text
)

I am getting following exception ( I tried with Cassandra 2.0.9 and 2.1.0, and pig 0.13). Please help us with root cause/

    ERROR 1002: Unable to store alias A

    Caused by: InvalidRequestException(why:Expected 8 or 0 byte long (7))
        at org.apache.cassandra.thrift.Cassandra$execute_prepared_cql3_query_result$execute_prepared_cql3_query_resultStandardScheme.read(Cassandra.java:54918)
        at org.apache.cassandra.thrift.Cassandra$execute_prepared_cql3_query_result$execute_prepared_cql3_query_resultStandardScheme.read(Cassandra.java:54895)
        at org.apache.cassandra.thrift.Cassandra$execute_prepared_cql3_query_result.read(Cassandra.java:54810)
        at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
        at org.apache.cassandra.thrift.Cassandra$Client.recv_execute_prepared_cql3_query(Cassandra.java:1861)
        at org.apache.cassandra.thrift.Cassandra$Client.execute_prepared_cql3_query(Cassandra.java:1846)
        at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.executeQuery(CqlPagingRecordReader.java:635)
        ... 28 more
1

1 Answers

0
votes

Verify that the partitioner is the same on the server and client. Murmur3Partitioner vs RandomPartitioner

> cqlsh -e "describe cluster" | head

Cluster: Test Cluster
Partitioner: Murmur3Partitioner

- Pig Script

set cassandra.input.partitioner.class org.apache.cassandra.dht.Murmur3Partitioner;
set cassandra.output.partitioner.class org.apache.cassandra.dht.Murmur3Partitioner;