我想複製從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版本您使用的? –