EXPAND 

Formats the output of a query vertically.

Formats the output of a query vertically.

Synopsis 

EXPAND  ON | OFF 
Legend
  • Uppercase means literal
  • Lowercase means not literal
  • Italics mean optional
  • The pipe (|) symbol means OR or AND/OR
  • Ellipsis (...) means repeatable

A semicolon that terminates CQL statements is not included in the synopsis.

Description 

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.

Sample output of EXPAND ON is:

cqlsh:my_ks> EXPAND ON
             Now printing expanded output
cqlsh:my_ks> SELECT * FROM users;
@ Row 1
------------+----------------------------------------------
 userid     | samwise
 emails     | {'samwise@gmail.com', 's@gamgee.com'}
 first_name | Samwise
 last_name  | Gamgee
 todo       | {'2013-09-22 12:01:00-0700': 'plant trees'}
 top_scores | null

@ Row 2
------------+----------------------------------------------
 userid     | frodo
 emails     | {'baggins@gmail.com', 'f@baggins.com'}
 first_name | Frodo
 last_name  | Baggins
 todo       | {'2012-10-02 12:00:00-0700': 'throw my precious into mount doom'}
 top_scores | null

(2 rows)