cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miguel Angel Martin junquera <>
Subject how can i get the column value? Need help!.. cassandra 1.28 and pig 0.11.1
Date Thu, 22 Aug 2013 10:51:33 GMT
hi all:

I,m testing the new CqlStorage() with cassandra 1.28 and pig 0.11.1

I am using this sample data test:

And I load and dump data Righ with this script:

*rows = LOAD
'cql://keyspace1/test?page_size=1&split_size=4&where_clause=age%3D30' USING
*dump rows;*
*describe rows;*




rows: {id: chararray,age: int,title: chararray}


But i can not  get  the column values

I try to define   another schemas in Load like I used with


*rows = LOAD
'cql://keyspace1/test?page_size=1&split_size=4&where_clause=age%3D30' USING
CqlStorage() AS (columns: bag {T: tuple(name, value)});*

and I get this error:

*2013-08-22 12:24:45,426 [main] ERROR -
ERROR 1031: Incompatable schema: left is
"columns:bag{T:tuple(name:bytearray,value:bytearray)}", right is

I try to use, FLATTEN, SUBSTRING, SPLIT UDF`s but i have not get good


   - when I flatten , I get a set of tuples like



*2013-08-22 12:42:20,673 [main] INFO
 org.apache.pig.backend.hadoop.executionengine.util.MapRedUtil - Total
input paths to process : 1*

*A: {title: chararray}*

but i can get value QA

Sustring only works with title


*dump B;*
*describe B;*


*B: {chararray}*

i try, this like ERIC LEE inthe other mail  and have the same results:

 Anyways, what I really what is the column value, not the name. Is there a
way to do that? I listed all of the failed attempts I made below.

   - colnames = FOREACH cols GENERATE $1 and was told $1 was out of bounds.
   - casted = FOREACH cols GENERATE (tuple(chararray, chararray))$0; but
   all I got back were empty tuples
   - values = FOREACH cols GENERATE $0.$1; but I got an error telling me
   data byte array can't be casted to tuple

Please, I will appreciate any help


View raw message