Friday 7 February 2020

Cassandra: Write query output to a file

Below statement writes the query output to a file ‘output.txt’.
cqlsh -e'query' > output.txt

$ cqlsh -e'SELECT * FROM cassandratutorial.employee' > output.txt
$ 
$ cat output.txt

 id | age | firstname | lastname
----+-----+-----------+----------
  1 |  30 |   Krishna |   Gurram
  2 |  31 |       Ram |   Gurram
  4 |  45 |    Chitra |    Rajan
  3 |  45 |     Vijay |   Ponnam

(4 rows)



Previous                                                    Next                                                    Home

No comments:

Post a Comment