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 (Created) (JIRA)" <ji...@apache.org> on 2012/03/13 18:08:41 UTC

[jira] [Created] (CASSANDRA-4041) Allow updating column_alias types

Allow updating column_alias types
---------------------------------

                 Key: CASSANDRA-4041
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4041
             Project: Cassandra
          Issue Type: Sub-task
            Reporter: Sylvain Lebresne
            Priority: Minor


CASSANDRA-3657 has added the ability to change comparators (including parts of a compositeType) when compatible. The code of CQL3 forbids it currently however so we should lift that limitation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-4041) Allow updating column_alias types

Posted by "Pavel Yaskevich (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Yaskevich updated CASSANDRA-4041:
---------------------------------------

    Attachment:     (was: CASSANDRA-4041-v2.patch)
    
> Allow updating column_alias types
> ---------------------------------
>
>                 Key: CASSANDRA-4041
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4041
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Sylvain Lebresne
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1.2
>
>         Attachments: CASSANDRA-4041.patch
>
>
> CASSANDRA-3657 has added the ability to change comparators (including parts of a compositeType) when compatible. The code of CQL3 forbids it currently however so we should lift that limitation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-4041) Allow updating column_alias types

Posted by "Pavel Yaskevich (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Yaskevich updated CASSANDRA-4041:
---------------------------------------

    Attachment:     (was: CASSANDRA-4041-v2.patch)
    
> Allow updating column_alias types
> ---------------------------------
>
>                 Key: CASSANDRA-4041
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4041
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Sylvain Lebresne
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1.2
>
>         Attachments: CASSANDRA-4041-v2.patch, CASSANDRA-4041.patch
>
>
> CASSANDRA-3657 has added the ability to change comparators (including parts of a compositeType) when compatible. The code of CQL3 forbids it currently however so we should lift that limitation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-4041) Allow updating column_alias types

Posted by "Pavel Yaskevich (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Yaskevich updated CASSANDRA-4041:
---------------------------------------

    Attachment: CASSANDRA-4041.patch
    
> Allow updating column_alias types
> ---------------------------------
>
>                 Key: CASSANDRA-4041
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4041
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Sylvain Lebresne
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1.2
>
>         Attachments: CASSANDRA-4041.patch
>
>
> CASSANDRA-3657 has added the ability to change comparators (including parts of a compositeType) when compatible. The code of CQL3 forbids it currently however so we should lift that limitation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4041) Allow updating column_alias types

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13403019#comment-13403019 ] 

Sylvain Lebresne commented on CASSANDRA-4041:
---------------------------------------------

* In
{noformat}
List<AbstractType<?>> newTypes = new ArrayList<AbstractType<?>>(((CompositeType) cfm.comparator).types)
{{
    add(name.position, CFPropDefs.parseType(validator));
}};
{noformat}
it's set() that should be used, not add(). Nit: I'm not a fan of using the collection literal syntax in that case, especially when not using it takes half the number of lines.
* CFMetadata.apply() already check whether the new comparator is compatible with the old one. So we should probably rely on that rather than duplicating the check.
* Nit: CFMetadata.comparator is not final so we don't really need the new clone with comparator method.

I've pushed a test for this in the dtests (test that doesn't pass with this patch because of the add instead of set). It would really be awesome though if everyone took the habit of adding one with every patch for a CQL fix/new feature. 
                
> Allow updating column_alias types
> ---------------------------------
>
>                 Key: CASSANDRA-4041
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4041
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Sylvain Lebresne
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1.2
>
>         Attachments: CASSANDRA-4041.patch
>
>
> CASSANDRA-3657 has added the ability to change comparators (including parts of a compositeType) when compatible. The code of CQL3 forbids it currently however so we should lift that limitation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4041) Allow updating column_alias types

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401476#comment-13401476 ] 

Jonathan Ellis commented on CASSANDRA-4041:
-------------------------------------------

+1 for just supporting changing a component type
                
> Allow updating column_alias types
> ---------------------------------
>
>                 Key: CASSANDRA-4041
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4041
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Sylvain Lebresne
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1.2
>
>
> CASSANDRA-3657 has added the ability to change comparators (including parts of a compositeType) when compatible. The code of CQL3 forbids it currently however so we should lift that limitation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4041) Allow updating column_alias types

Posted by "Pavel Yaskevich (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401442#comment-13401442 ] 

Pavel Yaskevich commented on CASSANDRA-4041:
--------------------------------------------

Thinking about the syntax, good way probably would be to do "alter table <cf> add primary_key '<new-column-name>'", which would add the column definition to the end of composite comparator, what do you think? The easiest tho is to support "alter table <cf> with comparator = '<col_1, col_2, col_3, ...>'" which would require from users to specify all of the column names to be used in comparator or alternatively "alter table <cf> set primary_key '<col_1, col_2, ...>".
                
> Allow updating column_alias types
> ---------------------------------
>
>                 Key: CASSANDRA-4041
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4041
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Sylvain Lebresne
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1.2
>
>
> CASSANDRA-3657 has added the ability to change comparators (including parts of a compositeType) when compatible. The code of CQL3 forbids it currently however so we should lift that limitation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4041) Allow updating column_alias types

Posted by "Sylvain Lebresne (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13228521#comment-13228521 ] 

Sylvain Lebresne commented on CASSANDRA-4041:
---------------------------------------------

In the case of 'COMPACT STORAGE' we could also allow to add new part to the keys (i.e, to 'extend' the composite type). Though given the current implementation, it wouldn't work when there is only one 'clustered' key since we don't use a comparator in that case (to save 2 bytes per-key basically).
                
> Allow updating column_alias types
> ---------------------------------
>
>                 Key: CASSANDRA-4041
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4041
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Sylvain Lebresne
>            Priority: Minor
>             Fix For: 1.1.1
>
>
> CASSANDRA-3657 has added the ability to change comparators (including parts of a compositeType) when compatible. The code of CQL3 forbids it currently however so we should lift that limitation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-4041) Allow updating column_alias types

Posted by "Pavel Yaskevich (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Yaskevich updated CASSANDRA-4041:
---------------------------------------

    Attachment: CASSANDRA-4041-v2.patch

and removed "final" from the name definition :)
                
> Allow updating column_alias types
> ---------------------------------
>
>                 Key: CASSANDRA-4041
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4041
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Sylvain Lebresne
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1.2
>
>         Attachments: CASSANDRA-4041-v2.patch, CASSANDRA-4041.patch
>
>
> CASSANDRA-3657 has added the ability to change comparators (including parts of a compositeType) when compatible. The code of CQL3 forbids it currently however so we should lift that limitation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4041) Allow updating column_alias types

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401449#comment-13401449 ] 

Sylvain Lebresne commented on CASSANDRA-4041:
---------------------------------------------

There is 2 things we can support here:
# Allow to modify the type of a given component of the comparator (say change UTF8Type to BytesType). For that, we'll probably just want to reuse the 'ALTER TABLE foo ALTER x TYPE blob' syntax.
# Allow adding more components to the composite comparator. Not sure what is the best syntax for that but I would suggest something like 'ALTER TABLE foo EXTEND PRIMARY KEY WITH x int' to express we are really modifying the existing definition rather than setting a new one. That being said, given that this part will work only for compact composite table definition, which are supposed to be here for backward compatibility mostly, I wouldn't shed a tear if we don't support that at all.
                
> Allow updating column_alias types
> ---------------------------------
>
>                 Key: CASSANDRA-4041
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4041
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Sylvain Lebresne
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1.2
>
>
> CASSANDRA-3657 has added the ability to change comparators (including parts of a compositeType) when compatible. The code of CQL3 forbids it currently however so we should lift that limitation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4041) Allow updating column_alias types

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13403067#comment-13403067 ] 

Sylvain Lebresne commented on CASSANDRA-4041:
---------------------------------------------

+1
                
> Allow updating column_alias types
> ---------------------------------
>
>                 Key: CASSANDRA-4041
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4041
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Sylvain Lebresne
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1.2
>
>         Attachments: CASSANDRA-4041-v2.patch, CASSANDRA-4041.patch
>
>
> CASSANDRA-3657 has added the ability to change comparators (including parts of a compositeType) when compatible. The code of CQL3 forbids it currently however so we should lift that limitation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-4041) Allow updating column_alias types

Posted by "Pavel Yaskevich (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Yaskevich updated CASSANDRA-4041:
---------------------------------------

    Attachment: CASSANDRA-4041-v2.patch

I a bit misunderstood what you meant original so I removed {{ }} notation now and made set independent.
                
> Allow updating column_alias types
> ---------------------------------
>
>                 Key: CASSANDRA-4041
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4041
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Sylvain Lebresne
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1.2
>
>         Attachments: CASSANDRA-4041-v2.patch, CASSANDRA-4041.patch
>
>
> CASSANDRA-3657 has added the ability to change comparators (including parts of a compositeType) when compatible. The code of CQL3 forbids it currently however so we should lift that limitation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4041) Allow updating column_alias types

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13228531#comment-13228531 ] 

Jonathan Ellis commented on CASSANDRA-4041:
-------------------------------------------

bq. to save 2 bytes per-key basically

And because we don't have a way to differentiate between the two -- the non-composite is reasonably common in "legacy" Thrift schemas.
                
> Allow updating column_alias types
> ---------------------------------
>
>                 Key: CASSANDRA-4041
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4041
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Sylvain Lebresne
>            Priority: Minor
>             Fix For: 1.1.1
>
>
> CASSANDRA-3657 has added the ability to change comparators (including parts of a compositeType) when compatible. The code of CQL3 forbids it currently however so we should lift that limitation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-4041) Allow updating column_alias types

Posted by "Pavel Yaskevich (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Yaskevich updated CASSANDRA-4041:
---------------------------------------

    Attachment: CASSANDRA-4041-v2.patch

changed "add" to "set" and removed clone and validation, there is no reason to use manual iteration where construction already gives that to us saving space.
                
> Allow updating column_alias types
> ---------------------------------
>
>                 Key: CASSANDRA-4041
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4041
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Sylvain Lebresne
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1.2
>
>         Attachments: CASSANDRA-4041-v2.patch, CASSANDRA-4041.patch
>
>
> CASSANDRA-3657 has added the ability to change comparators (including parts of a compositeType) when compatible. The code of CQL3 forbids it currently however so we should lift that limitation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (CASSANDRA-4041) Allow updating column_alias types

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis reassigned CASSANDRA-4041:
-----------------------------------------

    Assignee: Pavel Yaskevich
    
> Allow updating column_alias types
> ---------------------------------
>
>                 Key: CASSANDRA-4041
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4041
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Sylvain Lebresne
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1.2
>
>
> CASSANDRA-3657 has added the ability to change comparators (including parts of a compositeType) when compatible. The code of CQL3 forbids it currently however so we should lift that limitation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira