java - DateType column metadata column in Cassandra database -


i working cassandra database. have created below column family

create column family user comparator = 'utf8type' , default_validation_class = 'utf8type' , column_metadata = [                 {column_name : account, validation_class : 'utf8type'}                 {column_name : lmd, validation_class : 'datetype'}  ]; 

now trying insert cassandra database using pelops client

mutator.writecolumns(column_family, string.valueof(userid),                         mutator.newcolumnlist(                         mutator.newcolumn("account", "hello"),                          mutator.newcolumn("lmd", string.valueof(new date().gettime()))                                       )); 

in case, created lmd datetype in column family not sure how add datetype through code. adding string need make sure compatible datetype.

can me this?

well, have created column family using cli. try using these

set user['somekey']['account']='ac-46113'; set user['somekey']['lmd']=1365490146534; list user; 

now have same thing using pelops

mutator.writecolumns(column_family, string.valueof(userid),                     mutator.newcolumnlist(                     mutator.newcolumn("account", "hello"),                      mutator.newcolumn("lmd", bytes.fromlong(system.currenttimemillis()))                                   )); 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -