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

Sylvain Lebresne commented on CASSANDRA-5600:
---------------------------------------------

The changes look good. However, the methods in ColumnNameHelper basically 
assume that all column names (for a given CF) will have the same number of 
components. But that's not true (it's not true for CQL3 because of collections, 
but more importantly, since CompositeType doesn't force all components to be 
set, thrift users may have existing CF where the column names differ widely in 
number of components). So I believe we should have something along the lines of
{noformat}
List<ByteBuffer> components = Arrays.asList(ct.split(candidate));
int minSize = Math.min(maxSeen.size(), components.size());
for (int i = 0; i < minSize; i++)
    retList.add(ColumnNameHelper.max(maxSeen.get(i), components.get(i), 
ct.types.get(i)));

List<ByteBuffer> biggest = maxSeen().size() > components().size() ? maxSeen : 
components;
for (int i = minSize; i < biggest.size(); i++)
    retList.add(bigget.get(i));
{noformat}

Nit: In CompositeType.intersects, could be worth asserting is that 
minColumnNames.size() == maxColumnNames.size() (since the method does assume 
it). It's reasonable in that case since both are guaranteed to be the size of 
the longest column name in the sstable.

                
> fix intersection-checking in CompositeType
> ------------------------------------------
>
>                 Key: CASSANDRA-5600
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5600
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Marcus Eriksson
>            Assignee: Marcus Eriksson
>         Attachments: 0001-CASSANDRA-5600-v1.patch
>
>
> CASSANDRA-5514 introduced the ability to skip entire sstables based on 
> max/min column names in the sstable. This ticket aims to fix a few issues 
> with it:
> * dont use ACT.deconstruct on the hot path
> * remove assert that compares type count with collected columns

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

Reply via email to