卡桑德拉选择性复制 [英] Cassandra selective copy

查看:63
本文介绍了卡桑德拉选择性复制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将选定的行从列族复制到.csv文件。复制命令仅可用于将列或整个表转储到不带where子句的文件中。有没有一种方法可以在复制命令中使用where子句?

I want to copy selected rows from a columnfamily to a .csv file. The copy command is available just to dump a column or entire table to a file without where clause. Is there a way to use where clause in copy command?

我想到的另一种方法是

插入到table2()值中( select * from table1 where< where_clause> );然后将table2转储到.csv,这也是不可能的。

Do "Insert into table2 () values ( select * from table1 where <where_clause>);" and then dump the table2 to .csv , which is also not possible.

任何帮助将不胜感激。

推荐答案

没有在副本中制作where子句的方法,但是可以使用此方法:

There are no way to make a where clause in copy, but you can use this method :

echo选择c1,c2...。FROM keySpace.Table where; | bin / cqlsh> output.csv

echo "select c1,c2.... FROM keySpace.Table where ;" | bin/cqlsh > output.csv

它允许您将结果保存在output.csv文件中。

It allows you to save your result in the output.csv file.

这篇关于卡桑德拉选择性复制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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