Just for informational purposes, Pete and I tried to troubleshoot it via twitter. I was able to do the following with Cassandra 0.8.1 and Pig 0.9.1. He's going to dig in to see if there's something else going on.
// Cassandra-cli stuff // bin/cassandra-cli -h localhost -p 9160 create keyspace lala; use lala; create column family FriendsAlreadyRanked with comparator = UTF8Type and key_validation_class = UTF8Type and column_metadata = [ {column_name: time_last_ranked, validation_class: UTF8Type}, ]; set FriendsAlreadyRanked['mykey']['time_last_ranked'] = '2011-10-10'; // Pig stuff // bin/pig_cassandra -x local myscript.pig rows = LOAD 'cassandra://lala/FriendsAlreadyRanked' USING CassandraStorage() AS (key, columns:bag{T: tuple(name, value)}); dump rows; // Ouput (mykey,{(time_last_ranked,2011-10-10)}) On Oct 11, 2011, at 4:24 PM, Pete Warden wrote: > I'm trying to run the most basic example for pig_cassandra, counting the > number of rows in a column family, and I'm hitting the following error: > > 2011-10-11 14:13:32,321 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR > 1031: Incompatable field schema: left is > "columns:bag{:tuple(name:bytearray,value:bytearray)}", right is > "columns:bag{:tuple(name:chararray,value:bytearray,time_last_ranked:chararray,value:bytearray)}" > > I've tried it with various column families, with the same result, but here's > the definition of this one: > > create column family FriendsAlreadyRanked with > comparator = UTF8Type and > column_metadata = > [ > {column_name: time_last_ranked, validation_class: UTF8Type}, > ]; > > Here's the command I'm running from within pig_cassandra: > rows = LOAD 'cassandra://Frap/FriendsAlreadyRanked' USING CassandraStorage() > AS (key, columns:bag{T: tuple(name, value)}); > > Here's my versions: > > Apache Pig version 0.9.1 (r1177456) > > Cassandra 0.8.1 > > Any thoughts on how to troubleshoot this? It's obviously connecting to > Cassandra since it pulls out the column family definition, so I'm guessing > it's a Pig type definition problem, but I haven't figured out what it expects > (and all the examples just use the form above). > > cheers, > > Pete >