문제

I am new to cassandra. I want to know how can i insert system date and time through CLI (command line interface) for perticular row.

DateType and TiemUUIDType are just data types for this purpose so how can i use this two data types and insert the date and time for perticular UUID through Internal/ CLI type.

Thanks in advance.

도움이 되었습니까?

해결책

To enter a timeuuid corresponding to now, use the timeuuid() function, e.g. (taken from this example):

CREATE COLUMN FAMILY blog_entry
  WITH comparator = TimeUUIDType
  AND key_validation_class=UTF8Type
  AND default_validation_class = UTF8Type;

SET blog_entry['yomama'][timeuuid()] = 'I love my new shoes!';

To enter a timestamp into a datetime function use the unix timestamp, see the following example (taken from a related question), where we insert a unix timestamp into a DateType column:

set test['userID']['dob']=567999912112;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top