Cassandra .csv导入错误:批量太大

Eml*_*lon 9 csv import copy cassandra

我正在尝试通过复制命令将数据从.csv文件导入到Cassandra 3.2.1.该文件只有299行,有14列.我收到错误:

无法导入299行:InvalidRequest - code = 2200 [Invalid query] message ="Batch too large"

我使用了以下复制命令并尝试增加批量大小:

copy table (Col1,Col2,...)from 'file.csv' with delimiter =';' and header = true and MAXBATCHSIZE = 5000;

我认为299行不是太多导入cassandra或我错了?

小智 8

添加 CHUNKSIZE 关键字为我解决了这个问题。

例如从 '/home/kiren/dumps/event_stats_user.csv ' 复制 event_stats_user , CHUNKSIZE=1 ;


doa*_*hai 5

您遇到的错误是服务器端错误消息,表示批量插入的大小(以字节数计)太大.

此批处理大小在cassandra.yaml文件中定义:

# Log WARN on any batch size exceeding this value. 5kb per batch by default.
# Caution should be taken on increasing the size of this threshold as it can lead to node instability.
batch_size_warn_threshold_in_kb: 5

# Fail any batch exceeding this value. 50kb (10x warn threshold) by default.
batch_size_fail_threshold_in_kb: 50
Run Code Online (Sandbox Code Playgroud)

如果插入大量大柱(大小),您可以快速达到此阈值.尽量减少MAXBATCHSIZE到200.

在复印选项更多信息点击这里