[
https://issues.apache.org/jira/browse/CASSANDRA-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13464090#comment-13464090
]
paul cannon commented on CASSANDRA-4488:
----------------------------------------
The machinery needs to be able to parse an entire line up to the completion
point, or it has no way of knowing what the context is. Since many people have
reported cqlsh's context-sensitive completion of things like columnfamily
properties and possible values as useful, cqlsh needs to be able to recognize
that map literals are valid property values, etc. Cqlsh also needs to know that
composite row keys are possible or it wouldn't be able to figure out when a
CREATE TABLE statement's column definitions were done and when the options are
supposed to come.
>From a different direction, cqlsh is supposed to be able to DESCRIBE keyspaces
>and tables using current, valid syntax. People complain and write bug reports
>when they copy and paste DESCRIBE output and they get an error. So, the
>DESCRIBE machinery also needs to know how to show options in the map format
>and when to use the old syntax instead.
I have a pretty huge patch toward this end already, which not only allows
parsing the new syntax, but also recognizes when it should be used versus the
old syntax (3.0.0-beta1 for cassandra-1.1 servers), updates cqlsh's idea of
what properties are valid and how they look ('compaction' as a map for 1.2 vs
'compaction_strategy_options' as a prefix for 1.1, etc), updates DESCRIBE
KEYSPACE and DESCRIBE TABLE, adds hints to INSERT and UPDATE statements to let
the user know what type is expected in a particular value position, and starts
using schema_columnfamilies to get the list of available column names in
certain cases since thrift doesn't report all of them anymore.
The only thing I have left to add there is the GRANT and REVOKE statements from
CASSANDRA-4490, which should be pretty straightforward. I can attach what I
have so far if you'd rather have Aleksey finish it off.
> update cqlsh recognized syntax (for tab completion, etc)
> --------------------------------------------------------
>
> Key: CASSANDRA-4488
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4488
> Project: Cassandra
> Issue Type: Improvement
> Components: Tools
> Reporter: paul cannon
> Assignee: Aleksey Yeschenko
> Priority: Minor
> Fix For: 1.1.6
>
>
> cqlsh syntax awareness (tab completion, etc) should be aware of several
> recent changes to CQL:
> * CASSANDRA-4179 (row key and column value composites; 1.2 only)
> * CASSANDRA-3647 (sets/lists/maps; 1.2 only)
> * CASSANDRA-4018 (inet type; 1.2 only)
> * CASSANDRA-4278 (hyphens in keyspace properties; 1.1 and up)
> * CASSANDRA-4217 (accessing ttl, timestamp; 1.1 and up)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira