【问题标题】:Cassandra time datatypeCassandra 时间数据类型
【发布时间】:2017-04-12 22:40:11
【问题描述】:

在 Cassandra 2.1.17、Ubuntu14.04 中使用 DataStax 4.8.11 我正在尝试创建一个具有时间数据类型的表。该语法在 Cassandra 2.2.8/Win7 上运行良好,但在 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);

我得到错误:

无效请求:code=2200 [Invalid Query] message=Unknown type tests.time]

谢谢

【问题讨论】:

  • 请包括您的查询

标签: cassandra ubuntu-14.04 datastax cassandra-2.1


【解决方案1】:

time 数据类型为 introduced in protocol version 4,这需要 Cassandra 2.2+ (DataStax Enterprise 5.0+)。因此,time 不能用于 DataStax 4.8.x / Cassandra 2.1 中的列。

【讨论】:

  • 安迪感谢您澄清这一点。我怀疑/猜测类似这样的事情,API 文档没有@since(也许我错过了)。我会尝试寻找替代解决方案。
猜你喜欢
  • 2018-06-24
  • 2013-08-02
  • 1970-01-01
  • 1970-01-01
  • 2013-04-17
  • 2013-07-13
  • 2019-03-20
  • 2015-03-22
  • 1970-01-01
相关资源
最近更新 更多