cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tyler Hobbs (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-7859) Extend freezing to collections
Date Thu, 06 Nov 2014 17:16:34 GMT

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

Tyler Hobbs commented on CASSANDRA-7859:
----------------------------------------

bq. To reiter, collection values are sorted (even when used as cell values), and so it felt
fishy to me to consider that changing to a type that change the internal sorting of those
values is "compatible"

Right, I agree with that, and the current patch doesn't change that.  I think an example will
clarify this.  Take the type {{frozen<list<int>>}}.  If you use that type for
a clustering column, then entire lists will be compared (is [1, 2, 3] > [2, 3, 4]? etc)
to sort the cells.  In this case, the sorting order of {{int}} must be maintained when you
alter the type.  However, if you use {{frozen<list<int>>}} for a cell value, that
sorting order no longer matters.  It would be safe to alter it to {{frozen<list<bytes>>}}.

That does *not* apply to sets, because the items within a set should be sorted.  It also does
not apply to map *keys*, but map *values* can be treated like list values.

Does that clarify things?  I was a little tired when I tried to explain it last night.

bq. Maybe we should just remove the comment in that case.

Yup, already removed it in the last commit.

What do you think about my comment on 8264 and getRequestedColumns?

> Extend freezing to collections
> ------------------------------
>
>                 Key: CASSANDRA-7859
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7859
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Sylvain Lebresne
>            Assignee: Tyler Hobbs
>              Labels: cql
>             Fix For: 2.1.2
>
>         Attachments: 7859-v1.txt
>
>
> This is the follow-up to CASSANDRA-7857, to extend {{frozen}} to collections. This will
allow things like {{map<text, frozen<map<int, int>>>}} for instance, as
well as allowing {{frozen}} collections in PK columns.
> Additionally (and that's alsmot a separate ticket but I figured we can start discussing
it here), we could decide that tuple is a frozen type by default. This means that we would
allow {{tuple<int, text>}} without needing to add {{frozen}}, but we would require {{frozen}}
for complex type inside tuple, so {{tuple<int, list<text>>}} would be rejected,
but not {{tuple<int, frozen<list<text>>>}}.



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

Mime
View raw message