incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Шамим <sre...@yandex.ru>
Subject java.io.IOException: InvalidRequestException(why:Expected 8 or 0 byte long for date (4)) when inserting data to CF with compound key from pig
Date Mon, 12 Nov 2012 07:48:05 GMT
Hello All,
  we are using pig (pig-0.10.0) to store some data in CF with compound key. Cassandra version
is 1.1.15. Here is the script for creating CF
CREATE TABLE clicks_c (
  user_id varchar,
  time timestamp,
  url varchar,
  PRIMARY KEY (user_id, time)
) WITH COMPACT STORAGE;

Here is description of the keyspace with CF
Keyspace: test:
  Replication Strategy: org.apache.cassandra.locator.NetworkTopologyStrategy
  Durable Writes: true
    Options: [p00smevDC:1, p00skimDC:1]
  Column Families:
    ColumnFamily: clicks_c
      Key Validation Class: org.apache.cassandra.db.marshal.UTF8Type
      Default column value validator: org.apache.cassandra.db.marshal.UTF8Type
      Columns sorted by: org.apache.cassandra.db.marshal.DateType
      GC grace seconds: 864000
      Compaction min/max thresholds: 4/32
      Read repair chance: 0.1
      DC Local Read repair chance: 0.0
      Replicate on write: true
      Caching: KEYS_ONLY
      Bloom Filter FP chance: default
      Built indexes: []
      Compaction Strategy: org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy
      Compression Options:
        sstable_compression: org.apache.cassandra.io.compress.SnappyCompressor

Using following pig script to store data in CF named clicks_c

REGISTER /oracle/smev-pig-scripts/lib/piggybank.jar;
REGISTER /oracle/smev-pig-scripts/lib/joda-time-2.1.jar;

DEFINE ISOToUnix org.apache.pig.piggybank.evaluation.datetime.convert.ISOToUnix();

rows = LOAD 'cassandra://test/clicks' USING CassandraStorage();
--dump rows;
clup = foreach rows generate TOTUPLE('user_id', key), TOTUPLE('time', ISOToUnix('2009-01-07T01:07:01.000Z')),
url;
store clup into 'cassandra://test/clicks_c' using CassandraStorage();

manaualy i can insert data into the CF through CQL 3.0. What i am doing wrong here? Or CassandraStorage.java
for stroring is not supporting compound key features yet? 
thank's in advance
Shamim

Mime
View raw message