[
https://issues.apache.org/jira/browse/CASSANDRA-19150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17827947#comment-17827947
]
Arun Ganesh commented on CASSANDRA-19150:
-----------------------------------------
Sorry, I took a while to get back to this. I have a draft PR ready. I have two
items to discuss:
# I'd like some feedback on the design. The formatter for each type will
request whatever alignment it wants
like this, (I'm yet to do this on the PR)
{code:java}
return FormattedValue(val, coloredval, displaywidth,
alignment=Alignment.LEFT){code}
# I'm planning to use the following left/right alignment for the different
types (inspired from psql).
|*Type*|*Alignment*|
|default|right|
|blob/bytearray|left|
|decimal|right|
|uuid/timeuuid|left|
|inet|left|
|bool|left|
|float/double|right|
|text/unicode/ascii|left|
|set/list/map|right|
|user types|right|
When the expand mode is enabled, everything is aligned to the left, just like
in psql.
> Align values in rows in CQLSH right for numbers, left for text
> --------------------------------------------------------------
>
> Key: CASSANDRA-19150
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19150
> Project: Cassandra
> Issue Type: Improvement
> Components: CQL/Interpreter
> Reporter: Stefan Miklosovic
> Assignee: Arun Ganesh
> Priority: Low
> Fix For: 5.x
>
> Attachments: Screenshot 2023-12-04 at 00.38.16.png, Screenshot
> 2023-12-09 at 16.58.25.png, signature.asc
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> *Updated* Jan 17 2024 after dev discussion
> Change CQLSH to left-align text while continue to right-align numbers. This
> will match how Postgres shell and Excel treat alignment of text and number.
> -------------
> *Original*
> We need to make this
> [https://github.com/apache/cassandra/blob/trunk/pylib/cqlshlib/cqlshmain.py#L1101]
> configurable so values in columns are either all on left or on right side of
> the column (basically change col.rjust to col.ljust).
> By default, it would be like it is now but there would be configuration
> property in cqlsh for that as well as a corresponding CQLSH command
> (optional), something like
> {code:java}
> ALIGNMENT LEFT|RIGHT
> {code}
> cc [~bschoeni]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]