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

Tyler Hobbs commented on CASSANDRA-7981:
----------------------------------------

bq. Did not found a way to simplify it but I am also not fully sure about what 
it is making it confusing.

I think it's primarily the classes that implement both Restriction and 
Restrictions (AbstractPrimaryKeyRestrictions, 
SingleColumnPrimaryKeyRestrictions).  It makes some sense to me now, but I had 
to diagram it.

It looks like the {{mergeWith()}} conflict is still present.  For some reason, 
the ant build doesn't normally complain, but my IDE does.  Either way, it's a 
legit problem that needs to be fixed.

I don't understand this piece of code in {{MultiColumnRestriction.Slice}}, and 
it seems incorrect to me:

{code}
protected boolean isSupportedBy(ColumnDefinition columnDef, SecondaryIndex 
index)
{
    if (columnDefs.indexOf(columnDef) != (columnDefs.size() - 1))
        return index.supportsOperator(Operator.EQ);
    return slice.isSupportedBy(index);
}
{code}

Can you explain why that's correct (and add a comment)?

I'm still working on getting the test coverage analysis.

> Refactor SelectStatement
> ------------------------
>
>                 Key: CASSANDRA-7981
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7981
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Benjamin Lerer
>            Assignee: Benjamin Lerer
>             Fix For: 3.0
>
>
> The current state of the code of SelectStatement make fixing some issues or 
> adding new functionnalities really hard. It also contains some 
> functionnalities that we would like to reuse in ModificationStatement but 
> cannot for the moment.
> Ideally I would like to:
> * Perform as much validation as possible on Relations instead of performing 
> it on Restrictions as it will help for problem like the one of 
> #CASSANDRA-6075 (I believe that by clearly separating validation and 
> Restrictions building we will also make the code a lot clearer)
> * Provide a way to easily merge restrictions on the same columns as needed 
> for #CASSANDRA-7016
> * Have a preparation logic (validation + pre-processing) that we can easily 
> reuse for Delete statement #CASSANDRA-6237
> * Make the code much easier to read and safer to modify.



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

Reply via email to