Cassandra: copy null

南楼画角 提交于 2019-12-13 07:03:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!