CQLSH currently left-aligns all output, affecting both numbers and text.
While this works well for numbers, a better approach adopted by many is to
left align numbers and right align text.

For example, both Excel and Postgres shell use the later:

psql

# select * from employee;

 empid |  name   |    dept

-------+---------+------------

     1 | Clark   | Sales

   200 | Dave    | Accounting

    33 | Johnson | Sales


while CQLSH simply left aligns all the columns

cqlsh> select * from employee;

 empid | dept       | name

-------+------------+---------

    33 |      Sales | Johnson

     1 |      Sales |   Clark

   200 | Accounting |    Dave



Left aligned text looks much worse on text values which share common
prefixes


cqlsh> select * from system_views.system_properties limit 7 ;


 name                                       | value

--------------------------------------------+--------------------------------------------

                                  JAVA_HOME |
  /Users/brad/.jenv/versions/17

                   cassandra.jmx.local.port |
        7199

                           cassandra.logdir |
/usr/local/cassandra-5.0-beta1/bin/../logs

                       cassandra.storagedir |
/usr/local/cassandra-5.0-beta1/bin/../data

  com.sun.management.jmxremote.authenticate |
        false

 com.sun.management.jmxremote.password.file |
  /etc/cassandra/jmxremote.password

    io.netty.transport.estimateSizeOnSubmit |
        false



The Jira CASSANDRA-19150
<https://issues.apache.org/jira/browse/CASSANDRA-19150> discusses this in
further detail with some additional examples.


I wanted to raise the issue here to propose changing CQLSH to right-align
text while continue to left-align numbers.


Regards,


Brad Schoening


ReplyForward
Add reaction

Reply via email to