如何将包含计数器列的CSV文件加载到Cassandra CQL3表中 [英] How can a CSV file with counter columns be loaded to a Cassandra CQL3 table

查看:130
本文介绍了如何将包含计数器列的CSV文件加载到Cassandra CQL3表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下格式的CSV档案

  key1,key2,key3,counter1,counter2,counter3,counter4 
1,2,1,0,0,0,1
1,2,2,0,1,0,4

CQL3表具有类型为counter的所有值列。当我尝试使用COPY命令加载CSV我得到一个通常的错误,它要求一个UPDATE而不是一个INSERT。



问题是:如何告诉

解决方案

div>

使用sstables解决了这个问题。虽然比我预期的慢一点,它做的工作


I have a CSV file in the following format

key1,key2,key3,counter1,counter2,counter3,counter4
1,2,1,0,0,0,1
1,2,2,0,1,0,4

The CQL3 table has all value columns of type 'counter'. When I try to use the COPY command to load the CSV I get the usual error which asks for an UPDATE instead of an INSERT.

The question is : how can I tell CQL to use an UPDATE ?

Is there any other way to do this ?

解决方案

using sstables solved this issue. Although a little slower than what i expected , it does the job

这篇关于如何将包含计数器列的CSV文件加载到Cassandra CQL3表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆