cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefania (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-9232) "timestamp" is considered as a reserved keyword in cqlsh completion
Date Mon, 29 Jun 2015 02:46:04 GMT

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

Stefania commented on CASSANDRA-9232:
-------------------------------------

Unfortunately the cql keywords exported by the new version of the driver are too many. We
now have 123 keywords but python regular expressions only support 100 named groups maximum:

{code}
Traceback (most recent call last):
  File "/home/stefania/git/cstar/cassandra/bin/cqlsh", line 2459, in <module>
    main(*read_options(sys.argv[1:], os.environ))
  File "/home/stefania/git/cstar/cassandra/bin/cqlsh", line 2451, in main
    shell.cmdloop()
  File "/home/stefania/git/cstar/cassandra/bin/cqlsh", line 942, in cmdloop
    if self.onecmd(self.statement.getvalue()):
  File "/home/stefania/git/cstar/cassandra/bin/cqlsh", line 959, in onecmd
    statements, in_batch = cqlruleset.cql_split_statements(statementtext)
  File "/home/stefania/git/cstar/cassandra/bin/../pylib/cqlshlib/cqlhandling.py", line 143,
in cql_split_statements
    tokens = self.lex(text)
  File "/home/stefania/git/cstar/cassandra/bin/../pylib/cqlshlib/pylexotron.py", line 447,
in lex
    self.scanner = self.make_lexer()
  File "/home/stefania/git/cstar/cassandra/bin/../pylib/cqlshlib/pylexotron.py", line 443,
in make_lexer
    return SaferScanner(regexes, re.I | re.S).scan
  File "/home/stefania/git/cstar/cassandra/bin/../pylib/cqlshlib/saferscanner.py", line 37,
in __init__
    self.scanner = re.sre_compile.compile(p)
  File "/usr/lib/python2.7/sre_compile.py", line 509, in compile
    "sorry, but this version only supports 100 named groups"
AssertionError: sorry, but this version only supports 100 named groups
{code}

There is a third party module that might do the job, [regex|https://pypi.python.org/pypi/regex],
but it would require changing safescanner.py and adding one more dependency.

Can we do without named groups and add separate map alternatively? 

> "timestamp" is considered as a reserved keyword in cqlsh completion
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-9232
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9232
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Michaël Figuière
>            Assignee: Stefania
>            Priority: Trivial
>              Labels: cqlsh
>             Fix For: 3.x, 2.1.x
>
>
> cqlsh seems to treat "timestamp" as a reserved keyword when used as an identifier:
> {code}
> cqlsh:ks1> create table t1 (int int primary key, ascii ascii, bigint bigint, blob
blob, boolean boolean, date date, decimal decimal, double double, float float, inet inet,
text text, time time, timestamp timestamp, timeuuid timeuuid, uuid uuid, varchar varchar,
varint varint);
> {code}
> Leads to the following completion when building an {{INSERT}} statement:
> {code}
> cqlsh:ks1> insert into t1 (int, 
> "timestamp" ascii       bigint      blob        boolean     date        decimal     double
     float       inet        text        time        timeuuid    uuid        varchar     varint
> {code}
> "timestamp" is a keyword but not a reserved one and should therefore not be proposed
as a quoted string. It looks like this error happens only for timestamp. Not a big deal of
course, but it might be worth reviewing the keywords treated as reserved in cqlsh, especially
with the many changes introduced in 3.0.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message