gpt4 book ai didi

Cassandra:无法将 '2016-04-06 13:06:11.534000' 强制转换为格式化日期(长)

转载 作者:行者123 更新时间:2023-12-02 06:28:21 31 4
gpt4 key购买 nike

我正在尝试使用 cqlsh 更新 cassandra DB 中的现有项目:

$ > UPDATE allEvents SET "isLastEvent" = True WHERE "websiteId" = 'sd-8231'
AND "purchaser" = False
AND "currentTime" = '2016-04-06 13:06:11.534000';

我得到了这个:

InvalidRequest: code=2200 [Invalid query] message="Unable to coerce '2016-04-06 13:06:11.534000' to a formatted date (long)"

如果它可以帮助:

$ > show version
[cqlsh 5.0.1 | Cassandra 3.0.2 | CQL spec 3.3.1 | Native protocol v4]

最佳答案

这是因为 Cassandra 时间戳类型仅支持毫秒。您的 currentTime 精度太高。去掉最后三个零,这样就可以了:

UPDATE allEvents SET "isLastEvent" = True 
WHERE "websiteId" = 'sd-8231'
AND "purchaser" = False
AND "currentTime" = '2016-04-06 13:06:11.534';

关于Cassandra:无法将 '2016-04-06 13:06:11.534000' 强制转换为格式化日期(长),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36453972/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com