【发布时间】:2013-09-28 21:38:24
【问题描述】:
我正在尝试使用 cqlengine 或 cql(python) 从 Cassandra 2.0 中选择时间戳列,但我得到了错误的结果。
这是我从 cqlsh (或 thrift )得到的: "2013-09-23 00:00:00-0700"
这是我从 cqlengine 和 cql 本身得到的: "\x00\x00\x01AG\x0b\xd5\xe0"
如果你想重现错误,试试这个:
- 打开cqlsh
- 创建表测试(名称 varchar 主键,dt 时间戳)
- insert into table test ('Test', '2013-09-23 12:00')
- select * from test(这里一切正常)
- 现在继续 cqlengine 或 cql 本身并选择该表,您将得到一个损坏的十六进制。
谢谢!
【问题讨论】:
-
插入语句应该是
insert into test (name, dt) VALUES ('Test', '2013-09-23 12:00');
标签: python timestamp cassandra cql3