Sam-T
Sam-T

Reputation: 1965

Cassandra time datatype

Using DataStax 4.8.11 with Cassandra 2.1.17, Ubuntu14.04 I am trying to create a table with time data type. The syntax works fine on Cassandra 2.2.8/Win7, but not on DataStax 4.8.11.

CREATE KEYSPACE tests WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor': 1};

CREATE TABLE testts (
            ID int PRIMARY KEY,
            mdate timestamp,            
            ttime time);

I get error :

Invalid request: code=2200 [Invalid Query] message=Unknown type tests.time]

Thanks

Upvotes: 2

Views: 73

Answers (1)

Andy Tolbert
Andy Tolbert

Reputation: 11638

The time data type was introduced in protocol version 4, which requires Cassandra 2.2+ (DataStax Enterprise 5.0+). Because of this, time cannot be used for a column in DataStax 4.8.x / Cassandra 2.1.

Upvotes: 2

Related Questions