Skip to content

Instantly share code, notes, and snippets.

@cjwebb
Created December 2, 2014 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjwebb/83b0c02673d90c90ed41 to your computer and use it in GitHub Desktop.
Save cjwebb/83b0c02673d90c90ed41 to your computer and use it in GitHub Desktop.
Creating a table with a timestamp column, and then inserting data with a massive timestamp results in CQLSH errors when trying to remove the inserted data.
Creating a table with a timestamp column, and then inserting data with a massive timestamp results in CQLSH errors when trying to remove the inserted data.
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 2.1.0 | CQL spec 3.2.0 | Native protocol v3]
cqlsh> create keyspace test WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };
cqlsh> use test;
cqlsh:test> create table test.table1 (id int, time timestamp, primary key (id));
clqsh:test> insert into table1(id, time) values (1, 1000000000000000) ;
cqlsh:test> select * from table1;
Traceback (most recent call last):
File "/usr/local/bin/cqlsh", line 909, in perform_simple_statement
rows = self.session.execute(statement, trace=self.tracing_enabled)
File "/Users/colin/Virtualenvs/cassandra/lib/python2.7/site-packages/cassandra/cluster.py", line 1281, in execute
result = future.result(timeout)
File "/Users/colin/Virtualenvs/cassandra/lib/python2.7/site-packages/cassandra/cluster.py", line 2771, in result
raise self._final_exception
ValueError: year is out of range
cqlsh:test> truncate table1;
('Unable to complete the operation against any hosts', {<Host: 127.0.0.1 datacenter1>: ConnectionShutdown('Connection to 127.0.0.1 is defunct',)})
cqlsh:test> select count(*) from table1;
count
-------
1
(1 rows)
cqlsh:test> delete from table1 where id = 1;
('Unable to complete the operation against any hosts', {<Host: 127.0.0.1 datacenter1>: ConnectionShutdown('Connection to 127.0.0.1 is defunct',)})
cqlsh:test> drop keyspace test;
cqlsh:test>
dropping the keyspace is successful
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment