cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-11424) Add support to "unset" JSON fields in prepared statements
Date Wed, 06 Jul 2016 13:14:11 GMT


Sylvain Lebresne commented on CASSANDRA-11424:

I believe we discussed that on the original JSON ticket but pushed it to "later". The idea
we had however was to allow specifying the columns that you want to set like for a normal
statement. So, to allow:
INSERT INTO t(k) JSON '{"k": "v"}'
I see 2 advantages to that syntax over a new keyword:
# it avoids adding new syntax, and reuse a know syntax. And feels possibly more intuitive
as a result.
# it's actually more flexible than a single flag, as you can have some column left unset and
others defaulted to null depending.

For those reasons, this would have my personal preference.

> Add support to "unset" JSON fields in prepared statements
> ---------------------------------------------------------
>                 Key: CASSANDRA-11424
>                 URL:
>             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

View raw message