Executing CQL through Shell Script?

Immadisetty picture Immadisetty · Aug 13, 2014 · Viewed 37.2k times · Source

I am trying to execute the CQL commands from shell script. I am able to connect to the cqlsh (CQL version i'm using is 1.1.18) but unable to send the queries to cql.

Any ideas or suggestion how to proceed on this? Do I need to connect to Cassandra and execute few commands (select/update ) with shell script ??

Answer

zqhxuyuan picture zqhxuyuan · Nov 2, 2015
cqlsh -e "select * from ks.table limit 1;" > ~/output