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

Sylvain Lebresne commented on CASSANDRA-3647:
---------------------------------------------

bq.  that we need a casts/instanceof checks which is a chronic problem of type 
hierarchy of o.a.c.db.marshal package related to Composite and Collection types

We test 6 times for "instanceof CollectionType": one time is to call 
serializeForThrift() and 2 other times are to call the execute() methods. Both 
of those are very specific to CollectionType currently and I'm not convainced 
at all moving these "functionality" to AbstractType would make sense/be 
cleaner. One other time, we cast to CollectionType in order to construct a 
ColumnToCollectionType so we'll have to do that cast anyway. Remains 2 
occurences were we could indeed replace the 'instanceof' by a 'isCollection()' 
method (we don't cast to CollectionType after the instanceof test), but again 
I'm not sure there is a point? It won't be measurably faster and it won't even 
save characters (since we'll have to define the isCollection method).

As for CompositeType, there is (only) 4 occurrences of "instanceof 
CompositeType", all of which are followed by a cast so that we can access the 
'types' field of CompositeType. I don't see any sane way to move that 
functionality into AbstractType.

So honestly I think we actually do a reasonably good job of 'reflecting their 
most commonly used functionality in AbstractType' and in practice I don't 
really see how to do better.

bq. remove (or rename Value to) Literal as all of the classes implement only 
that one interface, so it would be someting like Literal.{List, Set, Map} and 
you would be able to "assert instance of Literal" in UpdateStatement?

We cannot do that because Term implements Value. The point of Value is to be a 
Term or a Literal.

bq. There are couple of same typos in the UpdateStatement left - lines _341_, 
_349_ and _373_

I'll update those.

                
> Support set and map value types in CQL
> --------------------------------------
>
>                 Key: CASSANDRA-3647
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3647
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API, Core
>            Reporter: Jonathan Ellis
>            Assignee: Sylvain Lebresne
>              Labels: cql
>             Fix For: 1.2
>
>
> Composite columns introduce the ability to have arbitrarily nested data in a 
> Cassandra row.  We should expose this through CQL.

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

        

Reply via email to