cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksey Yeschenko (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-7274) Better display table organization on desc table via primary key list
Date Sat, 24 May 2014 23:30:02 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-7274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14008236#comment-14008236
] 

Aleksey Yeschenko commented on CASSANDRA-7274:
----------------------------------------------

[~pmcfadin] you should just get rid of the if len(..) statement there and make the first branch
unconditional

> Better display table organization on desc table via primary key list
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-7274
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7274
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: G Gordon Worley III
>            Assignee: Patrick McFadin
>             Fix For: 2.0.8
>
>         Attachments: 7274.txt
>
>
> In cqlsh, the desc table command does not make it sufficiently clear which columns are
part of the row key and which are clustering keys.
> A simple change to the primary key list, though, would make it easier to tell.
> Consider the following table definition:
> {code}
> create table my_table {
>   first_column text,
>   second_column text,
>   third_column text,
>   primary key (first_column, second_column, third_column)
> }
> {code}
> This table has a row key of first_column and clustering keys of second_column, third_column.
But if the user intended for the table to have all three in the row key, the correct definition
would be:
> {code}
> create table my_table {
>   first_column text,
>   second_column text,
>   third_column text,
>   primary key ((first_column, second_column, third_column))
> }
> {code}
> But this is a sufficiently subtle difference that the first may be mistaken for the second
or vice-versa.
> My suggested solution is to always wrap the row key in parentheses. This is already supported
by create table syntax, so it's just a matter of changing desc table to display the create
table statement with the primary key always in parentheses, like so:
> {code}
> create table my_table {
>   first_column text,
>   second_column text,
>   third_column text,
>   primary key ((first_column), second_column, third_column)
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message