cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefania (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CASSANDRA-10038) Parse Error on CQLSH describe when describing a table with a non-reserved keyword name
Date Mon, 17 Aug 2015 09:27:46 GMT

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

Stefania edited comment on CASSANDRA-10038 at 8/17/15 9:27 AM:
---------------------------------------------------------------

CASSANDRA-9232 will fix this because the python driver has classified 'map' as an unreserved
keyword, along with several others, see _cassandra/metadata.py_ in the driver.

I tested it on trunk:
{code}
git checkout trunk
Switched to branch 'trunk'
Your branch is up-to-date with 'origin2/trunk'.

cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.0.0-alpha1-SNAPSHOT | CQL spec 3.3.0 | Native protocol v4]
Use HELP for help.
cqlsh> use keyspace1 ;
cqlsh:keyspace1> DESCRIBE map ;
Improper DESCRIBE command.
cqlsh:keyspace1> quit

git checkout 9232;
Switched to branch '9232'

cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.0.0-alpha1-SNAPSHOT | CQL spec 3.3.0 | Native protocol v4]
Use HELP for help.
cqlsh> use keyspace1 ;
cqlsh:keyspace1> DESCRIBE map ;

CREATE TABLE keyspace1.map (
    id int PRIMARY KEY,
    val text
) WITH bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND comment = ''
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99PERCENTILE';
{code}


was (Author: stefania):
CASSANDRA-9232 will fix this because the python driver has classified 'map' as an unreserved
keywords, along with several others, see _cassandra/metadata.py_ in the driver.

I tested it on trunk:
{code}
git checkout trunk
Switched to branch 'trunk'
Your branch is up-to-date with 'origin2/trunk'.

cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.0.0-alpha1-SNAPSHOT | CQL spec 3.3.0 | Native protocol v4]
Use HELP for help.
cqlsh> use keyspace1 ;
cqlsh:keyspace1> DESCRIBE map ;
Improper DESCRIBE command.
cqlsh:keyspace1> quit

git checkout 9232;
Switched to branch '9232'

cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.0.0-alpha1-SNAPSHOT | CQL spec 3.3.0 | Native protocol v4]
Use HELP for help.
cqlsh> use keyspace1 ;
cqlsh:keyspace1> DESCRIBE map ;

CREATE TABLE keyspace1.map (
    id int PRIMARY KEY,
    val text
) WITH bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND comment = ''
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99PERCENTILE';
{code}

> Parse Error on CQLSH describe when describing a table with a non-reserved keyword name
> --------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-10038
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10038
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Joel Knighton
>            Assignee: Stefania
>            Priority: Trivial
>              Labels: cqlsh
>
> If a table with the name 'map' is created, the describe command will return "Improper
describe command", indicating a parse error.
> I believe this is because 'map' is a keyword when referring to a type, but cqlshlib's
parser identifies it as a keyword in the context of a describe command, even though it is
not. This same mismatch likely applies to other CQL keywords as well.
> The cqlshlib and C* CQL parsers should treat keywords the same where possible.



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

Mime
View raw message