Cassandra中类似的Oracle to_date和to_timestamp

时间:2017-07-27 20:16:08

标签: cassandra

我在Oracle Insert SQL中有这两个转换函数。

Insert Into MyTable(id,date1,timeStamp1) 
             values(1,To_date('22-JUN-17', 'DD-MON-RR'),
                    To_timestamp('22-JUN-17 11.53.25 AM', 'DD-MON-RR HH.MI.SS AM'));

我想将此指令转换为在Cassandra上运行。

1 个答案:

答案 0 :(得分:0)

Cassandra 2.2及更高版本支持toTimeStamp(timeuuid)toDate(timeuuid)函数

Doc的示例:

CREATE TABLE sample_times (a int, b timestamp, c timeuuid, d bigint, PRIMARY KEY (a,b,c,d));
INSERT INTO sample_times (a,b,c,d) VALUES (1, toUnixTimestamp(now()), 50554d6e-29bb-11e5-b345-feff819cdc9f, toTimestamp(now()));

TimeUUID functions