Export cassandra query result to a csv file

后端 未结 13 1925
刺人心
刺人心 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 06:53

    1. Use CAPTURE command to export the query result to a file.
    cqlsh> CAPTURE
    cqlsh> CAPTURE '/home/Desktop/user.csv';
    cqlsh> select *from user;
    Now capturing query output to '/home/Desktop/user.csv'.
    

    Now, view the output of the query in /home/Desktop/user.csv

    1. Use DevCenter and execute a query. Right click on the output and select "Copy All as CSV" to paste the output in CSV.

提交回复
热议问题