cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip Thompson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-7891) Select an element inside a UDT throws an index error
Date Fri, 19 Sep 2014 16:58:34 GMT

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

Philip Thompson commented on CASSANDRA-7891:
--------------------------------------------

Okay so the root issue is at 
{code}
/cassandra/pylib/cqlshlib/pylexotron.py(254)match()
    253         if ctxt.remainder:
--> 254             if self.arg.lower() == ctxt.remainder[0][1].lower():
    255                 return [ctxt.with_match(1)]
{code}
The code is expecting ctxt.remainder[0][1] to be 'from', but instead it is 'op', because 'name.lastname'
is being interpreted as identifier, op, identifier. I assume everything between 'SELECT' and
'FROM' should have been removed from the remainder when we dealt with the 'selectClause' rule.

> Select an element inside a UDT throws an index error
> ----------------------------------------------------
>
>                 Key: CASSANDRA-7891
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7891
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Patrick McFadin
>            Assignee: Philip Thompson
>             Fix For: 3.0
>
>
> Create the following data model:
> {noformat}
> CREATE TYPE address (
> street text,
> city text,
> zip_code int,
> phones set<text>
>  );
>  
> CREATE TYPE fullname (
> firstname text,
> lastname text
> );
> CREATE TABLE users (
> id uuid PRIMARY KEY,
> name FROZEN <fullname>,
> addresses map<text, FROZEN <address>>
> );
> INSERT INTO users (id, name) 
> VALUES (62c36092-82a1-3a00-93d1-46196ee77204, {firstname: 'Marie-Claude', lastname: 'Josset'});
> {noformat}
> When trying to select a sub-field in the name type:
> {noformat}
> SELECT name.lastname FROM users WHERE id=62c36092-82a1-3a00-93d1-46196ee77204;
> {noformat}
> You get the following error:
> {noformat}
> list index out of range
> {noformat}



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

Mime
View raw message