cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Techy Teck <>
Subject Insert into column which is of DateType
Date Tue, 23 Apr 2013 03:23:10 GMT
I created my column family in Cassandra database like this from the CLI-

create column family PROFILE
with key_validation_class = 'UTF8Type'
and comparator = 'UTF8Type'
and default_validation_class = 'UTF8Type'
and column_metadata = [
  {column_name : lmd, validation_class : 'DateType'}

Now I was trying to insert into above lmd columns using few of the
clients like Netflix/Pelops/Datastax

I am not sure how to insert into columns which is of DateType. I was using
the below code to insert
into lmd column.

final long LMD = System.currentTimeMillis() / 1000L;

attrMap.put("lmd", String.valueOf(LMD));

And* *everytime, I get exception as -

*(Expected 8 or 0 byte long for date (30)) [my_keyspace][PROFILE][lmd]
failed validation*

Is there anything wrong I am doing?

attrMap is String, String here. And then I am using this map later on to
retrieve the column and then populate it into cassandra database

View raw message