Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-10625

Problem of year 10000: Dates too far in the future can be saved but not read back using cqlsh

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 3.0.4, 3.4
    • None
    • None
    • Low

    Description

      cqlsh> insert into test.timestamp_test (pkey, ts) VALUES (1, '9999-12-31 23:59:59+0000');
      cqlsh> select * from test.timestamp_test ;
      
       pkey | ts
      ------+--------------------------
          1 | 9999-12-31 23:59:59+0000
      
      (1 rows)
      
      cqlsh> insert into test.timestamp_test (pkey, ts) VALUES (1, '10000-01-01 00:00:01+0000');
      cqlsh> select * from test.timestamp_test ;
      Traceback (most recent call last):
        File "bin/../resources/cassandra/bin/cqlsh", line 1112, in perform_simple_statement
          rows = self.session.execute(statement, trace=self.tracing_enabled)
        File "/home/pkolaczk/Projekty/DataStax/bdp/resources/cassandra/bin/../zipfiles/cassandra-driver-internal-only-2.7.2.zip/cassandra-driver-2.7.2/cassandra/cluster.py", line 1602, in execute
          result = future.result()
        File "/home/pkolaczk/Projekty/DataStax/bdp/resources/cassandra/bin/../zipfiles/cassandra-driver-internal-only-2.7.2.zip/cassandra-driver-2.7.2/cassandra/cluster.py", line 3347, in result
          raise self._final_exception
      OverflowError: date value out of range
      

      The connection is broken afterwards:

      cqlsh> insert into test.timestamp_test (pkey, ts) VALUES (1, '10000-01-01 00:00:01+0000');
      NoHostAvailable: ('Unable to complete the operation against any hosts', {<Host: 127.0.0.1 Analytics>: ConnectionShutdown('Connection to 127.0.0.1 is defunct',)})
      

      Expected behaviors (one of):

      • don't allow to insert dates larger than 9999-12-31 and document the limitation
      • handle all dates up to Java Date(MAX_LONG) for writing and reading

      Attachments

        Issue Links

          Activity

            People

              aholmber Adam Holmberg
              pkolaczk Piotr Kolaczkowski
              Adam Holmberg
              Paulo Motta
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: