Export cassandra query result to a csv file

后端 未结 13 1863
刺人心
刺人心 2020-12-08 06:18

I\'m new in cassandra, and I have to export the result of a specific query to a csv file.

I found the COPY command, but (from what I understand) it allo

13条回答
  •  独厮守ぢ
    2020-12-08 07:13

    The person asking asked for CSV not text.

    I did this hack get my results. It worked for me and I moved on with my day.

    me:~/MOOSE2# echo "USE ████it; select * from samples_daily_buffer where dog_id=██48;" | cqlsh --cqlversion="3.4.4" cassandra0.stage.███████ | sed -e "s/ | */,/g" | sed -e "s/^ *//g" | tail -n +4 > ./myfile.csv

提交回复
热议问题