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

Reply via email to