我想复制从csv文件,我有1时间戳和时间列。 试图与一对夫妇行的测试开始与:Cassandra复制从时间和时间戳列
cqlsh:tests> CREATE TABLE testts (
... ID int PRIMARY KEY,
... mdate timestamp,
... ttime time);
cqlsh:tests> INSERT INTO testts (ID , mdate, ttime)
... VALUES (1, '2015-10-12', '1055') ;
cqlsh:tests> INSERT INTO testts (ID , mdate, ttime)
... VALUES (2, '2014-06-25', '920') ;
cqlsh:tests> select * from testts;
id | mdate | ttime
----+--------------------------+--------------------
1 | 2015-10-12 07:00:00+0000 | 00:00:00.000001055
2 | 2014-06-25 07:00:00+0000 | 00:00:00.000000920
(2 rows)
以上的作品,现在我尝试导入文件
cqlsh:tests> COPY testts (ID,
... mdate,
... ttime)
... FROM 'c:\cassandra228\testtime.csv' WITH HEADER = FALSE AND DELIMITER = ',' AND DATETIMEFORMAT='%Y/%m/%d';
Using 3 child processes
Starting copy of tests.testts with columns [id, mdate, ttime].
Failed to import 1 rows: ParseError - Failed to parse 1130 : can't interpret '1130' as a time, given up without retries
Failed to import 1 rows: ParseError - Failed to parse 1230 : can't interpret '1230' as a time, given up without retries
Failed to import 1 rows: ParseError - Failed to parse 930 : can't interpret '930' as a time, given up without retries
Failed to process 3 rows; failed rows written to import_tests_testts.err
Processed: 3 rows; Rate: 0 rows/s; Avg. rate: 1 rows/s
3 rows imported from 1 files in 3.269 seconds (0 skipped).
我的时间戳coulmn的格式YYYY/MM/DD,直到我给了这个DATETIMEFORMAT ='%Y /%m /%d'我会在时间戳列上发生错误,但在此之后,错误停止。
CSV文件:3,2010年 /02/08930 4,2015/05/20,1130 5,2016/08/15,1230
我该如何解决这个问题。
感谢很多
告诉我们您的架构,并从CSV –
这里是一些行是整个事情 –
这Cassandra的CQL版本您使用的? –