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

Sylvain Lebresne commented on CASSANDRA-11424:
----------------------------------------------

But to finish my train of though and explore options, we could slightly extend 
the idea of allowing column declarations by saying that the columns you provide 
are the "mandatory" columns, which are set to {{null}} if absent from the 
value, but that other values can be provided in the JSON, in which case the 
equivalent of {{IGNORE_OMITTED}} would be:
{noformat}
INSERT INTO t() JSON '{"k": "v"}';
{noformat}
but I admittedly worries that it will be confusing that the two following 
queries aren't equivalent:
{noformat}
INSERT INTO t() JSON '{"k": "v"}';  // Would leave any column outside of k unset
INSERT INTO t JSON '{"k": "v"}';    // Would set any column outside of k to null
{noformat}


> Add support to "unset" JSON fields in prepared statements
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-11424
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11424
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Ralf Steppacher
>
> CASSANDRA-7304 introduced the ability to distinguish between {{NULL}} and 
> {{UNSET}} prepared statement parameters.
> When inserting JSON objects it is not possible to profit from this as a 
> prepared statement only has one parameter that is bound to the JSON object as 
> a whole. There is no way to control {{NULL}} vs {{UNSET}} behavior for 
> columns omitted from the JSON object.
> Please extend on CASSANDRA-7304 to include JSON support.
> {color:grey}
> (My personal requirement is to be able to insert JSON objects with optional 
> fields without incurring the overhead of creating a tombstone of every column 
> not covered by the JSON object upon initial(!) insert.)
> {color}



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

Reply via email to