【cassandra】cannot assign result of function system.now (type timeuuid) to time (type timestamp)

背景

执行如下sql会失败并报如题目中的错误

insert into event (subject, time, type)
values (now(), 'type');

原因

now() returns a timeuuid, not a timestamp

解决办法

尝试用 dateOf(now())

insert into event (time, type)
values (dateOf(now()), 'type');

结果

问题解决

posted @ 2023-02-27 22:01  青玄0316  阅读(15)  评论(0编辑  收藏  举报