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

Bernardo Botella Corbi commented on CASSANDRA-20340:
----------------------------------------------------

They are definitely closely related, but as they are, and given the lack of 
complexity inside the functions, I don't think there is actual value on trying 
to generalize the common logic between the two, which is basically return a 
ByteBuffer remaining value. Constraints is designed to be compared with a term, 
and needs to implement the validate and execute methods, and the 
NativeScalarFunctions are designed with another purpose in mind.

Another difference is that the function you pointed out also supports integers, 
while the constraint I'm proposing only works for tests and bytes.

Having said that, I think there is room for alignment in the naming. Let's call 
the constraint octet_length as well.

> Add SERIALIZED_SIZE constraint
> ------------------------------
>
>                 Key: CASSANDRA-20340
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-20340
>             Project: Apache Cassandra
>          Issue Type: Improvement
>          Components: Feature/Constraints
>            Reporter: Bernardo Botella Corbi
>            Assignee: Bernardo Botella Corbi
>            Priority: Normal
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Add a new constraint type that allows to check the actual serialized size of 
> a string type. This is different than LENGTH constraint, as that one checks 
> the actual length of the string.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to