Cassandra:copy null [英] Cassandra: copy null
问题描述
我在Cassandra的COPY命令有问题。
我尝试在新服务器上移动我的旧数据库,但当我使用COPY FROM我收到错误:
无法导入1 rows:ParseError - 无效的文字为int()与基础10:'null',给予没有重试
某些字段为空,需要保留此信息。
CSV使用COPY TO创建:
COPY tabel TO'./db.csv'WITH NULL ='null '
如果我尝试使CSV无NULL ='null'我收到错误:
无法导入1行:ParseError - 无效的文字为int()与base 10:'',放弃没有重试
如何将null分配给int?
Cassandra版本:
[cqlsh 5.0.1 | Cassandra 2.2.6 | CQL规范3.3.1 |本地协议v4]
我在JIRA中发现了一个错误描述:
https://issues.apache.org/jira/browse/CASSANDRA-11549
补丁在Linux和Windows上都适用于我。我只是手动替换给定文件中的一行代码:
https://github.com/stef1927/cassandra/commit/6e7664380bb6ddea37efd5f866b7631fdc84bdac
它也适用于您吗? / p>
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]
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?
这篇关于Cassandra:copy null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!