You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2012/12/04 14:54:58 UTC

[jira] [Updated] (CASSANDRA-5017) Preparing UPDATE queries with collections returns suboptimal metadata

     [ https://issues.apache.org/jira/browse/CASSANDRA-5017?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne updated CASSANDRA-5017:
----------------------------------------

    Attachment: 0003-Fix-handling-of-prepared-marker-for-deletes.txt
                0002-Fix-prepared-list-index-and-using-integer-for-map-keys.txt
                0001-Return-correct-metadata-when-preparing-map.txt

Attaching 3 small patches that fixes a number of problems with prepared queries and collections, including this one, the fact that you weren't allowed to prepare a list index and the fact that delete wasn't working correctly when either a list index or a map key was prepared.

I note we have a small "problem" for the metadata return in all those cases, in that if you do
{noformat}
UPDATE foo SET amap[?] = ? WHERE ...
{noformat}
then it's unclear what name to return for the prepared variables in the metadata. The choice made by the patch is to return 'key(amap)' and 'value(amap)' respectively (and when preparing a list index, we return 'index(alist)').

                
> Preparing UPDATE queries with collections returns suboptimal metadata
> ---------------------------------------------------------------------
>
>                 Key: CASSANDRA-5017
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5017
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.2.0 beta 2
>            Reporter: Aleksey Yeschenko
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>         Attachments: 0001-Return-correct-metadata-when-preparing-map.txt, 0002-Fix-prepared-list-index-and-using-integer-for-map-keys.txt, 0003-Fix-handling-of-prepared-marker-for-deletes.txt
>
>
> CQL3, binary protocol.
> collections (id int primary key, amap map<int, varchar>);
> preparing "UPDATE test.collections SET amap[?] = ? WHERE id = ?" returns the following metadata:
> [{column,<<"test">>,<<"collections">>,<<"amap">>,
>                        {map,int,varchar}},
>                {column,<<"test">>,<<"collections">>,<<"amap">>,
>                        {map,int,varchar}},
>                {column,<<"test">>,<<"collections">>,<<"id">>,int}]
> Ideally it should return [int, varchar, int] types. Less ideally [{map, int, varchar}, int] and expect an encoded map with a single key-value pair. But certainly not what it currently returns.

--
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