You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Aleksey Yeschenko (JIRA)" <ji...@apache.org> on 2014/11/04 19:22:35 UTC

[jira] [Commented] (CASSANDRA-8178) Column names are not converted correctly for non-text comparators

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

Aleksey Yeschenko commented on CASSANDRA-8178:
----------------------------------------------

LGTM, +1

WRT
{code}
if (cfm.getIsDense() || cfm.comparator instanceof CompositeType || cfm.comparator instanceof UTF8Type)
    return new ColumnIdentifier(text, true);
{code}

As discussed privately - it's probably theoretically possible to have a compositetype column name defined via Thrift, but I've never seen anything like it - and the perf optimisation outweighs the risk of it not working for someone (plus if someone ever complains about it, we'll remove that part of the test).

> Column names are not converted correctly for non-text comparators
> -----------------------------------------------------------------
>
>                 Key: CASSANDRA-8178
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8178
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Tyler Hobbs
>            Assignee: Tyler Hobbs
>             Fix For: 2.0.12, 2.1.2
>
>         Attachments: 8178-2.0.txt
>
>
> If a column family is created with a non-text comparator through Thrift (or cassandra-cli) and column metadata is defined, those column names cannot be queried through cql3.
> For example:
> {noformat}
> [default@ks1] create column family entity_data
> ...   with column_type = 'Standard'
> ...   and comparator = 'BytesType'
> ...   and default_validation_class = 'BytesType'
> ...   and key_validation_class = 'UTF8Type'
> ...   and column_metadata = [
> ...     {column_name : '0008',
> ...     validation_class : UTF8Type,
> ...     index_name : 'entity_data_0008_idx',
> ...     index_type : 0}];
> {noformat}
> When you attempt to query that column through cqlsh, you'll get an error like this:
> {noformat}
> cqlsh:ks1> select "0008" FROM entity_data ;
> Bad Request: Undefined name 0008 in selection clause
> {noformat}
> The problem is that we aren't taking the comparator type into account when converting column names in cql3 statements to their internal (ByteBuffer) representation.



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