Is there a way to show results in a pager in Cassandra cqlsh?

If the query output cannot be correctly displayed in the dimensions of the terminal used to issue the query, the ASCII art used to draw the table usually breaks down and becomes more difficult than helping to read the displayed results.

This also happens very often when using Cassandra cqlsh. Despite the fact that there is an option to display the results in the layout based on the line EXPAND ON, I would prefer to configure it cqlshso that the output of the table, which is too large for the terminal, is automatically transferred to the pager.

In PostgreSQL psql utitliy, the pager configured in the environment variable PAGERis automatically used as soon as the output does not fit into the terminal. Usually the command is lessused as a pager. In MySQL, you can use a type command PAGER lessto display all results through a pager less.

Is there a comparable function in cqlsh?

+4
source share
1 answer

If you want, you can write the output to a file, and then run the file through a pager.

For example, run this command in the cqlsh shell

CAPTURE '~ / out.txt'

, - , , . (out.txt), .

: http://docs.datastax.com/en/cql/3.1/cql/cql_reference/capture_r.html

cqlsh. , , .

paging

,

100 . , , .

+1

Source: https://habr.com/ru/post/1620279/


All Articles