Prettifying results of cqlsh commands in Linux terminal

booleanhunter picture booleanhunter · Mar 9, 2015 · Viewed 11k times · Source

Is there any way to prettify the results of cql commands in the Linux terminal while using the cqlsh utility (cql version of Mongo .pretty())? It becomes quite difficult to read the results when the output is displayed normally, especially when there are nested documents and arrays

Answer

arielkirkwood picture arielkirkwood · Mar 9, 2016

Perhaps you are interested in the EXPAND command?

Usage: EXPAND ON;

From the documentation over at Datastax:

This command lists the contents of each row of a table vertically, providing a more convenient way to read long rows of data than the default horizontal format. You scroll down to see more of the row instead of scrolling to the right. Each column name appears on a separate line in column one and the values appear in column two.

Source: https://docs.datastax.com/en/cql/3.3/cql/cql_reference/expand.html