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

Benjamin Lerer commented on CASSANDRA-7423:
-------------------------------------------

The patch seems pretty good. :-)

The 2 missing things are the CQL documentation and the CQLSH auto completion 
for field update/deletion.

Otherwise, I have found the following nits:
* In {{AbstractMarker}} and {{FunctionCall}} the {{else}} are not needed as all 
the if end with return statements.
* It seems to me that the signature of {{Operation.RawUpdate::prepare}} method 
could be improved by removing the keyspace name (it can be retrieved from 
cfm.ksName) and making cfm the first parameter.
* In {{AbstractFunction}} and {{Selector}} I think that 
{{receiver.type.isFrozenCollection() || (receiver.type.isUDT() && 
!receiver.type.isMultiCell())}} should be changed.
In my opinion, we could add a {{isFreezable}} method to {{AbstractType}} 
({{receiver.type.isFreezable() && !receiver.type.isMultiCell()}}) or use a 
{{isFrozenUDT}} method. 
* In the {{TulpeType}} constructor it seems that the code:
{code}
for (int i = 0; i < types.size(); i++)
{
    AbstractType<?> type = types.get(i);
    if (freezeInner)
        type = type.freeze();
    types.set(i, type);
}
{code}
could be written:
{code}
if (freezeInner)
    types.forEach(AbstractType::freeze);
{code}
* In {{CollectionType::serializeForNativeProtocol}} the def parameter is not 
used and can be removed (it was there before the patch).
* It might make sense to pass the protocol version to the 
{{UDType::serializeForNativeProtocol}} like for 
{{CollectionType::serializeForNativeProtocol}} even if it is not used for the 
moment. 
* I like a lot the {{beforeAndAfterFlush}} method used in {{UserTypesTest}}. 
Could you put in {{CQLTester}} instead? There is several places where I would 
like to use it. :-)

> Allow updating individual subfields of UDT
> ------------------------------------------
>
>                 Key: CASSANDRA-7423
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7423
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL
>            Reporter: Tupshin Harper
>            Assignee: Tyler Hobbs
>              Labels: client-impacting, cql, docs-impacting
>             Fix For: 3.x
>
>
> Since user defined types were implemented in CASSANDRA-5590 as blobs (you 
> have to rewrite the entire type in order to make any modifications), they 
> can't be safely used without LWT for any operation that wants to modify a 
> subset of the UDT's fields by any client process that is not authoritative 
> for the entire blob. 
> When trying to use UDTs to model complex records (particularly with nesting), 
> this is not an exceptional circumstance, this is the totally expected normal 
> situation. 
> The use of UDTs for anything non-trivial is harmful to either performance or 
> consistency or both.
> edit: to clarify, i believe that most potential uses of UDTs should be 
> considered anti-patterns until/unless we have field-level r/w access to 
> individual elements of the UDT, with individual timestamps and standard LWW 
> semantics



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

Reply via email to