Cassandra - dates before 1970

后端 未结 1 746
情深已故
情深已故 2021-01-22 01:10

Is there a way to support dates older than 1970 in Cassandra while supporting dates operations on them? I can only see timestamps. If we need older dates should I simulate my ow

相关标签:
1条回答
  • 2021-01-22 01:41

    This issue seems to be ok with Cassandra 2.0.9:

    CREATE TABLE table1 (id int, col1 int, ts timestamp, PRIMARY KEY (id, ts));  
    INSERT INTO table1 (id, col1, ts) values (1, 10, '2000-02-03');  
    INSERT INTO table1 (id, col1, ts) values (1, 20, '1960-02-03');  
    INSERT INTO table1 (id, col1, ts) values (1, 30, '1890-02-03'); 
    
    SELECT col1 FROM table1 WHERE id = 1 and ts >= '1900-01-01 00:00:00+0000' limit 10;  
    

    Output:

     col1
    ------
       20
       10
    

    Problems in earlier versions might be related to CASSANDRA-6395 (fixed in 2.0.4), or JAVA-264 (that was later reverted).

    0 讨论(0)
提交回复
热议问题