问题
I have problem with COPY command in Cassandra. I try move my old database on new server but when I use COPY FROM I receives error:
Failed to import 1 rows: ParseError - invalid literal for int() with base 10: 'null', given up without retries
Some fields are null and the need to keep this informations. CSV I created with COPY TO:
COPY tabel TO './db.csv' WITH NULL='null'
If I try make CSV without NULL='null' I receives error:
Failed to import 1 rows: ParseError - invalid literal for int() with base 10: '', given up without retries
How I can assign null to int ? Cassandra version: [cqlsh 5.0.1 | Cassandra 2.2.6 | CQL spec 3.3.1 | Native protocol v4]
回答1:
I have found a bug description in JIRA:
https://issues.apache.org/jira/browse/CASSANDRA-11549
And the patch worked for me both on Linux and Windows. I have just manually replaced one line of the code in the given file:
https://github.com/stef1927/cassandra/commit/6e7664380bb6ddea37efd5f866b7631fdc84bdac
Does it work for you as well?
来源:https://stackoverflow.com/questions/37431860/cassandra-copy-null