如何在Cassandra中导入列值,就像具有这样的值“13/01/09 23:13”? [英] How to import column value in Cassandra like one having such values "13/01/09 23:13"?

查看:248
本文介绍了如何在Cassandra中导入列值,就像具有这样的值“13/01/09 23:13”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查询:

CREATE TABLE IF NOT EXISTS "TEMP_tmp".temp (
"Date_Time" timestamp,
PRIMARY KEY ("Date_Time")
);

CSV包含13/01/09 23:13值。

CSV Contains "13/01/09 23:13" values.

Error : Failed to import 1 rows: ParseError - Failed to parse 13/01/09 23:13 : invalid literal for long() with base 10: '13/01/09 23:13',  given up without retries.

我应该使用什么数据类型?

What Data Type should I Use ?

推荐答案

默认Cqlsh时间戳格式为:year-month-day hour:min:sec + timezone

示例:

Default Cqlsh timestamp format is : year-month-day hour:min:sec+timezone
Example :

2017-02-01 05:28:36+0000

您可以将日期格式更改为上述格式,也可以从cqlshrc文件更改格式

选中此答案自定义cassandra / cqlsh time_format

You either change your date format to above or you can change the format from cqlshrc file
Check this answer custom cassandra / cqlsh time_format

这篇关于如何在Cassandra中导入列值,就像具有这样的值“13/01/09 23:13”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆