[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2016-07-18 Thread Russell Spitzer (JIRA)

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

Russell Spitzer commented on CASSANDRA-7304:


Fixed in related ticket CASSANDRA-11207

> Ability to distinguish between NULL and UNSET values in Prepared Statements
> ---
>
> Key: CASSANDRA-7304
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
> Project: Cassandra
>  Issue Type: Sub-task
>Reporter: Drew Kutcharian
>Assignee: Oded Peer
>  Labels: client-impacting, cql, protocolv4
> Fix For: 2.2.0 beta 1
>
> Attachments: 7304-03.patch, 7304-04.patch, 7304-05.patch, 
> 7304-06.patch, 7304-07.patch, 7304-2.patch, 7304-V8.txt, 7304.patch
>
>
> Currently Cassandra inserts tombstones when a value of a column is bound to 
> NULL in a prepared statement. At higher insert rates managing all these 
> tombstones becomes an unnecessary overhead. This limits the usefulness of the 
> prepared statements since developers have to either create multiple prepared 
> statements (each with a different combination of column names, which at times 
> is just unfeasible because of the sheer number of possible combinations) or 
> fall back to using regular (non-prepared) statements.
> This JIRA is here to explore the possibility of either:
> A. Have a flag on prepared statements that once set, tells Cassandra to 
> ignore null columns
> or
> B. Have an "UNSET" value which makes Cassandra skip the null columns and not 
> tombstone them
> Basically, in the context of a prepared statement, a null value means delete, 
> but we don’t have anything that means "ignore" (besides creating a new 
> prepared statement without the ignored column).
> Please refer to the original conversation on DataStax Java Driver mailing 
> list for more background:
> https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
> *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
> The motivation hasn't changed.
> Protocol version 4 specifies that bind variables do not require having a 
> value when executing a statement. Bind variables without a value are called 
> 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
> without following bytes.
> \\
> \\
> * An unset bind variable in an EXECUTE or BATCH request
> ** On a {{value}} does not modify the value and does not create a tombstone
> ** On the {{ttl}} clause is treated as 'unlimited'
> ** On the {{timestamp}} clause is treated as 'now'
> ** On a map key or a list index throws {{InvalidRequestException}}
> ** On a {{counter}} increment or decrement operation does not change the 
> counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
> the value of counter {{c}}
> ** On a tuple field or UDT field throws {{InvalidRequestException}}
> * An unset bind variable in a QUERY request
> ** On a partition column, clustering column or index column in the {{WHERE}} 
> clause throws {{InvalidRequestException}}
> ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2016-07-18 Thread Sylvain Lebresne (JIRA)

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

Sylvain Lebresne commented on CASSANDRA-7304:
-

Probably an oversight, as using the table default definitively sounds more 
logical to me. Mind opening a followup ticket though?

> Ability to distinguish between NULL and UNSET values in Prepared Statements
> ---
>
> Key: CASSANDRA-7304
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
> Project: Cassandra
>  Issue Type: Sub-task
>Reporter: Drew Kutcharian
>Assignee: Oded Peer
>  Labels: client-impacting, cql, protocolv4
> Fix For: 2.2.0 beta 1
>
> Attachments: 7304-03.patch, 7304-04.patch, 7304-05.patch, 
> 7304-06.patch, 7304-07.patch, 7304-2.patch, 7304-V8.txt, 7304.patch
>
>
> Currently Cassandra inserts tombstones when a value of a column is bound to 
> NULL in a prepared statement. At higher insert rates managing all these 
> tombstones becomes an unnecessary overhead. This limits the usefulness of the 
> prepared statements since developers have to either create multiple prepared 
> statements (each with a different combination of column names, which at times 
> is just unfeasible because of the sheer number of possible combinations) or 
> fall back to using regular (non-prepared) statements.
> This JIRA is here to explore the possibility of either:
> A. Have a flag on prepared statements that once set, tells Cassandra to 
> ignore null columns
> or
> B. Have an "UNSET" value which makes Cassandra skip the null columns and not 
> tombstone them
> Basically, in the context of a prepared statement, a null value means delete, 
> but we don’t have anything that means "ignore" (besides creating a new 
> prepared statement without the ignored column).
> Please refer to the original conversation on DataStax Java Driver mailing 
> list for more background:
> https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
> *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
> The motivation hasn't changed.
> Protocol version 4 specifies that bind variables do not require having a 
> value when executing a statement. Bind variables without a value are called 
> 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
> without following bytes.
> \\
> \\
> * An unset bind variable in an EXECUTE or BATCH request
> ** On a {{value}} does not modify the value and does not create a tombstone
> ** On the {{ttl}} clause is treated as 'unlimited'
> ** On the {{timestamp}} clause is treated as 'now'
> ** On a map key or a list index throws {{InvalidRequestException}}
> ** On a {{counter}} increment or decrement operation does not change the 
> counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
> the value of counter {{c}}
> ** On a tuple field or UDT field throws {{InvalidRequestException}}
> * An unset bind variable in a QUERY request
> ** On a partition column, clustering column or index column in the {{WHERE}} 
> clause throws {{InvalidRequestException}}
> ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2016-07-15 Thread Russell Alexander Spitzer (JIRA)

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

Russell Alexander Spitzer commented on CASSANDRA-7304:
--

Why is TTL unlimited and not the Table Default?

> Ability to distinguish between NULL and UNSET values in Prepared Statements
> ---
>
> Key: CASSANDRA-7304
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
> Project: Cassandra
>  Issue Type: Sub-task
>Reporter: Drew Kutcharian
>Assignee: Oded Peer
>  Labels: client-impacting, cql, protocolv4
> Fix For: 2.2.0 beta 1
>
> Attachments: 7304-03.patch, 7304-04.patch, 7304-05.patch, 
> 7304-06.patch, 7304-07.patch, 7304-2.patch, 7304-V8.txt, 7304.patch
>
>
> Currently Cassandra inserts tombstones when a value of a column is bound to 
> NULL in a prepared statement. At higher insert rates managing all these 
> tombstones becomes an unnecessary overhead. This limits the usefulness of the 
> prepared statements since developers have to either create multiple prepared 
> statements (each with a different combination of column names, which at times 
> is just unfeasible because of the sheer number of possible combinations) or 
> fall back to using regular (non-prepared) statements.
> This JIRA is here to explore the possibility of either:
> A. Have a flag on prepared statements that once set, tells Cassandra to 
> ignore null columns
> or
> B. Have an "UNSET" value which makes Cassandra skip the null columns and not 
> tombstone them
> Basically, in the context of a prepared statement, a null value means delete, 
> but we don’t have anything that means "ignore" (besides creating a new 
> prepared statement without the ignored column).
> Please refer to the original conversation on DataStax Java Driver mailing 
> list for more background:
> https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
> *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
> The motivation hasn't changed.
> Protocol version 4 specifies that bind variables do not require having a 
> value when executing a statement. Bind variables without a value are called 
> 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
> without following bytes.
> \\
> \\
> * An unset bind variable in an EXECUTE or BATCH request
> ** On a {{value}} does not modify the value and does not create a tombstone
> ** On the {{ttl}} clause is treated as 'unlimited'
> ** On the {{timestamp}} clause is treated as 'now'
> ** On a map key or a list index throws {{InvalidRequestException}}
> ** On a {{counter}} increment or decrement operation does not change the 
> counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
> the value of counter {{c}}
> ** On a tuple field or UDT field throws {{InvalidRequestException}}
> * An unset bind variable in a QUERY request
> ** On a partition column, clustering column or index column in the {{WHERE}} 
> clause throws {{InvalidRequestException}}
> ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2015-04-16 Thread Benjamin Lerer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14497801#comment-14497801
 ] 

Benjamin Lerer commented on CASSANDRA-7304:
---

[~slebresne] can you commit?

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
Assignee: Oded Peer
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-04.patch, 7304-05.patch, 
 7304-06.patch, 7304-07.patch, 7304-2.patch, 7304-V8.txt, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
 *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
 The motivation hasn't changed.
 Protocol version 4 specifies that bind variables do not require having a 
 value when executing a statement. Bind variables without a value are called 
 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
 without following bytes.
 \\
 \\
 * An unset bind variable in an EXECUTE or BATCH request
 ** On a {{value}} does not modify the value and does not create a tombstone
 ** On the {{ttl}} clause is treated as 'unlimited'
 ** On the {{timestamp}} clause is treated as 'now'
 ** On a map key or a list index throws {{InvalidRequestException}}
 ** On a {{counter}} increment or decrement operation does not change the 
 counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
 the value of counter {{c}}
 ** On a tuple field or UDT field throws {{InvalidRequestException}}
 * An unset bind variable in a QUERY request
 ** On a partition column, clustering column or index column in the {{WHERE}} 
 clause throws {{InvalidRequestException}}
 ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2015-04-13 Thread Benjamin Lerer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14492338#comment-14492338
 ] 

Benjamin Lerer commented on CASSANDRA-7304:
---

{quote}
Since functions do not accept bind variables as input, only column identifiers, 
and A column value can not be an unset value.
I added a comment to FunctionCall stating why there is no need in checking for 
unset variables in functions.
{quote}

Function do accept bind variables. You can check in the {{Cql.g}} file or with 
the java driver.

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
Assignee: Oded Peer
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-04.patch, 7304-05.patch, 
 7304-06.patch, 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
 *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
 The motivation hasn't changed.
 Protocol version 4 specifies that bind variables do not require having a 
 value when executing a statement. Bind variables without a value are called 
 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
 without following bytes.
 \\
 \\
 * An unset bind variable in an EXECUTE or BATCH request
 ** On a {{value}} does not modify the value and does not create a tombstone
 ** On the {{ttl}} clause is treated as 'unlimited'
 ** On the {{timestamp}} clause is treated as 'now'
 ** On a map key or a list index throws {{InvalidRequestException}}
 ** On a {{counter}} increment or decrement operation does not change the 
 counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
 the value of counter {{c}}
 ** On a tuple field or UDT field throws {{InvalidRequestException}}
 * An unset bind variable in a QUERY request
 ** On a partition column, clustering column or index column in the {{WHERE}} 
 clause throws {{InvalidRequestException}}
 ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2015-04-08 Thread Benjamin Lerer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14485021#comment-14485021
 ] 

Benjamin Lerer commented on CASSANDRA-7304:
---

Sorry for the delay [~odedpeer]. Right now my focus is on the review of 
#CASSANDRA-8099. I will review this ticket as soon as I can.

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
Assignee: Oded Peer
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-04.patch, 7304-05.patch, 
 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
 *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
 The motivation hasn't changed.
 Protocol version 4 specifies that bind variables do not require having a 
 value when executing a statement. Bind variables without a value are called 
 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
 without following bytes.
 \\
 \\
 * An unset bind variable in an EXECUTE or BATCH request
 ** On a {{value}} does not modify the value and does not create a tombstone
 ** On the {{ttl}} clause is treated as 'unlimited'
 ** On the {{timestamp}} clause is treated as 'now'
 ** On a map key or a list index throws {{InvalidRequestException}}
 ** On a {{counter}} increment or decrement operation does not change the 
 counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
 the value of counter {{c}}
 ** On a tuple field or UDT field throws {{InvalidRequestException}}
 * An unset bind variable in a QUERY request
 ** On a partition column, clustering column or index column in the {{WHERE}} 
 clause throws {{InvalidRequestException}}
 ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2015-04-08 Thread Oded Peer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14484950#comment-14484950
 ] 

Oded Peer commented on CASSANDRA-7304:
--

[~blerer] Pinging for code review

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
Assignee: Oded Peer
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-04.patch, 7304-05.patch, 
 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
 *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
 The motivation hasn't changed.
 Protocol version 4 specifies that bind variables do not require having a 
 value when executing a statement. Bind variables without a value are called 
 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
 without following bytes.
 \\
 \\
 * An unset bind variable in an EXECUTE or BATCH request
 ** On a {{value}} does not modify the value and does not create a tombstone
 ** On the {{ttl}} clause is treated as 'unlimited'
 ** On the {{timestamp}} clause is treated as 'now'
 ** On a map key or a list index throws {{InvalidRequestException}}
 ** On a {{counter}} increment or decrement operation does not change the 
 counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
 the value of counter {{c}}
 ** On a tuple field or UDT field throws {{InvalidRequestException}}
 * An unset bind variable in a QUERY request
 ** On a partition column, clustering column or index column in the {{WHERE}} 
 clause throws {{InvalidRequestException}}
 ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2015-03-27 Thread Sylvain Lebresne (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14383826#comment-14383826
 ] 

Sylvain Lebresne commented on CASSANDRA-7304:
-

I apologize for not getting back on this one, it kind of slipped out of my 
review list, but we need to get that ready for 3.0. [~odpeer] would you have 
the time to rebase this to trunk?

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
Assignee: Oded Peer
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-04.patch, 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
 *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
 The motivation hasn't changed.
 Protocol version 4 specifies that bind variables do not require having a 
 value when executing a statement. Bind variables without a value are called 
 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
 without following bytes.
 \\
 \\
 * An unset bind variable in an EXECUTE or BATCH request
 ** On a {{value}} does not modify the value and does not create a tombstone
 ** On the {{ttl}} clause is treated as 'unlimited'
 ** On the {{timestamp}} clause is treated as 'now'
 ** On a map key or a list index throws {{InvalidRequestException}}
 ** On a {{counter}} increment or decrement operation does not change the 
 counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
 the value of counter {{c}}
 ** On a tuple field or UDT field throws {{InvalidRequestException}}
 * An unset bind variable in a QUERY request
 ** On a partition column, clustering column or index column in the {{WHERE}} 
 clause throws {{InvalidRequestException}}
 ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2015-03-27 Thread Oded Peer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14383897#comment-14383897
 ] 

Oded Peer commented on CASSANDRA-7304:
--

Yes. I will rebase next week.
Thanks

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
Assignee: Oded Peer
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-04.patch, 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
 *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
 The motivation hasn't changed.
 Protocol version 4 specifies that bind variables do not require having a 
 value when executing a statement. Bind variables without a value are called 
 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
 without following bytes.
 \\
 \\
 * An unset bind variable in an EXECUTE or BATCH request
 ** On a {{value}} does not modify the value and does not create a tombstone
 ** On the {{ttl}} clause is treated as 'unlimited'
 ** On the {{timestamp}} clause is treated as 'now'
 ** On a map key or a list index throws {{InvalidRequestException}}
 ** On a {{counter}} increment or decrement operation does not change the 
 counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
 the value of counter {{c}}
 ** On a tuple field or UDT field throws {{InvalidRequestException}}
 * An unset bind variable in a QUERY request
 ** On a partition column, clustering column or index column in the {{WHERE}} 
 clause throws {{InvalidRequestException}}
 ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-12-20 Thread Oded Peer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14255055#comment-14255055
 ] 

Oded Peer commented on CASSANDRA-7304:
--

bq. Will this generate a tombstone because I didn't set the column C?
No. This won't create a tombstone.

bq. this problem comes from the java driver, but since is a protocol issue I 
assume is affecting all right?
Right, assuming the driver you are using supports prepared statements and does 
not enforce setting concrete values for all the bind variables. The Java driver 
[enforces having concrete values for every bind 
variable|https://datastax-oss.atlassian.net/browse/JAVA-410] as of driver 
version 2.1.0

bq. the query above *without prepared* statements is not going to generate any 
tombstone right?
Both queries, prepared and simple won't create tombstones.

bq. Can some of you provide examples of cases where we can generate tombstones 
using prepared statements?
When you execute the following statement {{INSERT INTO test  (A, B) VALUES (1, 
?)}} and you do not set a value for the bind variable then Cassandra will set 
the value of {{B}} to null and create a tombstone for the column.


 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
Assignee: Oded Peer
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-04.patch, 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
 *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
 The motivation hasn't changed.
 Protocol version 4 specifies that bind variables do not require having a 
 value when executing a statement. Bind variables without a value are called 
 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
 without following bytes.
 \\
 \\
 * An unset bind variable in an EXECUTE or BATCH request
 ** On a {{value}} does not modify the value and does not create a tombstone
 ** On the {{ttl}} clause is treated as 'unlimited'
 ** On the {{timestamp}} clause is treated as 'now'
 ** On a map key or a list index throws {{InvalidRequestException}}
 ** On a {{counter}} increment or decrement operation does not change the 
 counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
 the value of counter {{c}}
 ** On a tuple field or UDT field throws {{InvalidRequestException}}
 * An unset bind variable in a QUERY request
 ** On a partition column, clustering column or index column in the {{WHERE}} 
 clause throws {{InvalidRequestException}}
 ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-12-20 Thread Oded Peer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14255054#comment-14255054
 ] 

Oded Peer commented on CASSANDRA-7304:
--

bq. Will this generate a tombstone because I didn't set the column C?
No. This won't create a tombstone.

bq. this problem comes from the java driver, but since is a protocol issue I 
assume is affecting all right?
Right, assuming the driver you are using supports prepared statements and does 
not enforce setting concrete values for all the bind variables. The Java driver 
[enforces having concrete values for every bind 
variable|https://datastax-oss.atlassian.net/browse/JAVA-410] as of driver 
version 2.1.0

bq. the query above *without prepared* statements is not going to generate any 
tombstone right?
Both queries, prepared and simple won't create tombstones.

bq. Can some of you provide examples of cases where we can generate tombstones 
using prepared statements?
When you execute the following statement {{INSERT INTO test  (A, B) VALUES (1, 
?)}} and you do not set a value for the bind variable then Cassandra will set 
the value of {{B}} to null and create a tombstone for the column.


 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
Assignee: Oded Peer
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-04.patch, 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
 *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
 The motivation hasn't changed.
 Protocol version 4 specifies that bind variables do not require having a 
 value when executing a statement. Bind variables without a value are called 
 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
 without following bytes.
 \\
 \\
 * An unset bind variable in an EXECUTE or BATCH request
 ** On a {{value}} does not modify the value and does not create a tombstone
 ** On the {{ttl}} clause is treated as 'unlimited'
 ** On the {{timestamp}} clause is treated as 'now'
 ** On a map key or a list index throws {{InvalidRequestException}}
 ** On a {{counter}} increment or decrement operation does not change the 
 counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
 the value of counter {{c}}
 ** On a tuple field or UDT field throws {{InvalidRequestException}}
 * An unset bind variable in a QUERY request
 ** On a partition column, clustering column or index column in the {{WHERE}} 
 clause throws {{InvalidRequestException}}
 ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-12-18 Thread Oded Peer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14251604#comment-14251604
 ] 

Oded Peer commented on CASSANDRA-7304:
--

[~0x6e6562] I updated the original summary.

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
Assignee: Oded Peer
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-04.patch, 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
 *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
 The motivation hasn't changed.
 Protocol version 4 specifies that bind variables do not require having a 
 value when executing a statement. Bind variables without a value are called 
 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
 without following bytes.
 \\
 \\
 * An unset bind variable in an EXECUTE or BATCH request
 ** On a {{value}} does not modify the value and does not create a tombstone
 ** On the {{ttl}} clause is treated as 'unlimited'
 ** On the {{timestamp}} clause is treated as 'now'
 ** On a map key or a list index throws {{InvalidRequestException}}
 ** On a {{counter}} increment or decrement operation does not change the 
 counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
 the value of counter {{c}}
 ** On a tuple field or UDT field throws {{InvalidRequestException}}
 * An unset bind variable in a QUERY request
 ** On a partition column, clustering column or index column in the {{WHERE}} 
 clause throws {{InvalidRequestException}}
 ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-12-18 Thread Ben Hood (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14251922#comment-14251922
 ] 

Ben Hood commented on CASSANDRA-7304:
-

Many thanks for updating the summary. Can I assume that when this patch lands, 
then there will be an observable different in the wire protocol - i.e. if a 
driver sends a values of -2, then this will avoid tombstones? If so, then a 
driver that supports this differentiation can only be used as of this updated 
of the server.

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
Assignee: Oded Peer
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-04.patch, 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
 *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
 The motivation hasn't changed.
 Protocol version 4 specifies that bind variables do not require having a 
 value when executing a statement. Bind variables without a value are called 
 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
 without following bytes.
 \\
 \\
 * An unset bind variable in an EXECUTE or BATCH request
 ** On a {{value}} does not modify the value and does not create a tombstone
 ** On the {{ttl}} clause is treated as 'unlimited'
 ** On the {{timestamp}} clause is treated as 'now'
 ** On a map key or a list index throws {{InvalidRequestException}}
 ** On a {{counter}} increment or decrement operation does not change the 
 counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
 the value of counter {{c}}
 ** On a tuple field or UDT field throws {{InvalidRequestException}}
 * An unset bind variable in a QUERY request
 ** On a partition column, clustering column or index column in the {{WHERE}} 
 clause throws {{InvalidRequestException}}
 ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-12-18 Thread Oded Peer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14252020#comment-14252020
 ] 

Oded Peer commented on CASSANDRA-7304:
--

If a driver sends a value of -2 and is using native protocol version 4 then 
this will avoid tombstones.
If the protocol version will be less than 4 then tombstones will be created 
even when the value of -2 is set for backward compatibility.
A driver that supports this differentiation can only be used after the patch is 
accepted and committed.

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
Assignee: Oded Peer
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-04.patch, 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
 *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
 The motivation hasn't changed.
 Protocol version 4 specifies that bind variables do not require having a 
 value when executing a statement. Bind variables without a value are called 
 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
 without following bytes.
 \\
 \\
 * An unset bind variable in an EXECUTE or BATCH request
 ** On a {{value}} does not modify the value and does not create a tombstone
 ** On the {{ttl}} clause is treated as 'unlimited'
 ** On the {{timestamp}} clause is treated as 'now'
 ** On a map key or a list index throws {{InvalidRequestException}}
 ** On a {{counter}} increment or decrement operation does not change the 
 counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
 the value of counter {{c}}
 ** On a tuple field or UDT field throws {{InvalidRequestException}}
 * An unset bind variable in a QUERY request
 ** On a partition column, clustering column or index column in the {{WHERE}} 
 clause throws {{InvalidRequestException}}
 ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-12-18 Thread Ben Hood (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14252148#comment-14252148
 ] 

Ben Hood commented on CASSANDRA-7304:
-

The point about needing the updated server version is important - thanks very 
much for clarifying this.

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
Assignee: Oded Peer
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-04.patch, 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
 *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
 The motivation hasn't changed.
 Protocol version 4 specifies that bind variables do not require having a 
 value when executing a statement. Bind variables without a value are called 
 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
 without following bytes.
 \\
 \\
 * An unset bind variable in an EXECUTE or BATCH request
 ** On a {{value}} does not modify the value and does not create a tombstone
 ** On the {{ttl}} clause is treated as 'unlimited'
 ** On the {{timestamp}} clause is treated as 'now'
 ** On a map key or a list index throws {{InvalidRequestException}}
 ** On a {{counter}} increment or decrement operation does not change the 
 counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
 the value of counter {{c}}
 ** On a tuple field or UDT field throws {{InvalidRequestException}}
 * An unset bind variable in a QUERY request
 ** On a partition column, clustering column or index column in the {{WHERE}} 
 clause throws {{InvalidRequestException}}
 ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-12-18 Thread Davide (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14253005#comment-14253005
 ] 

Davide commented on CASSANDRA-7304:
---

Hi guys,

I tried hard to understand this issue but it is not entirely clear to me.

I'm one that is affected by an huge amount of tombstones (and there isn't a 
single DELETE in our code)

I use prepared statements everywhere.

If I have a table with columns: _A_, _B_ and _C_.

What happens if using a *prepared statements* I do:

{code:sql}
INSERT INTO test  (A, B) VALUES (1, 2)
{code}

Will this generate a tombstone because I didn't set the column _C_?

Second question, this problem comes from the java driver, but since is a 
protocol issue I assume is affecting all right?

Last question, the query above *without* *prepared* statements is not going to 
generate any tombstone right?  _(assuming that's the case with prepared ones)_

Can some of you provide examples of cases where we can generate tombstones 
using prepared statements?

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
Assignee: Oded Peer
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-04.patch, 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion
 *EDIT 18/12/14 - [~odpeer] Implementation Notes:*
 The motivation hasn't changed.
 Protocol version 4 specifies that bind variables do not require having a 
 value when executing a statement. Bind variables without a value are called 
 'unset'. The 'unset' bind variable is serialized as the int value '-2' 
 without following bytes.
 \\
 \\
 * An unset bind variable in an EXECUTE or BATCH request
 ** On a {{value}} does not modify the value and does not create a tombstone
 ** On the {{ttl}} clause is treated as 'unlimited'
 ** On the {{timestamp}} clause is treated as 'now'
 ** On a map key or a list index throws {{InvalidRequestException}}
 ** On a {{counter}} increment or decrement operation does not change the 
 counter value, e.g. {{UPDATE my_tab SET c = c - ? WHERE k = 1}} does change 
 the value of counter {{c}}
 ** On a tuple field or UDT field throws {{InvalidRequestException}}
 * An unset bind variable in a QUERY request
 ** On a partition column, clustering column or index column in the {{WHERE}} 
 clause throws {{InvalidRequestException}}
 ** On the {{limit}} clause is treated as 'unlimited'



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-12-17 Thread Ben Hood (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14249679#comment-14249679
 ] 

Ben Hood commented on CASSANDRA-7304:
-

We've had [an issue raised with us at 
gocql|https://github.com/gocql/gocql/issues/296] that would like to take 
advantage of these changes, but I'm not 100% what the final scope of this patch 
will be. One first glance it looked like these were just driver side changes, 
and hence we were considering to what extent we could replicate this in our 
driver. There was mention that the wire protocol would be clarified to include 
the UNSET (-2) flag. But reading the latest patch, it looks like there might be 
some server side changes as well.

To be fair, it looks like the understanding of what needs to happen has evolved 
since the issue was first raised. So I was wondering whether the intention of 
this can get restated of the benefit of external readers.

Would it be possible to update the original summary to reflect the current 
motivation and scope of the change?

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
Assignee: Oded Peer
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-04.patch, 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-11-28 Thread Sylvain Lebresne (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14228247#comment-14228247
 ] 

Sylvain Lebresne commented on CASSANDRA-7304:
-

Remarks on the last patch:
* In the spec, instead of changing the meaning of {{\[bytes\]}}, I would rather 
add a new {{\[value\]}} definition that support 'unset', and use that 
exclusively in the definition of values for bind variables in QUERY and EXECUTE 
messages, so as to make it clear that it makes no sense in any other place. I 
would then add a specific {{CBUtil.readBoundValue()}} to read those.
* Making {{UNSET_CONSTANT_VALUE}} be {{new Value(null)}} is somewhat incorrect, 
it should be {{new Value(UNSET_BYTE_BUFFER)}} so that we don't lose the the 
information that it's 'unset' if {{bindAndGet}} is used. For this reason, I'd 
prefer using {{Constants.UNSET_CONSTANT_VALUE}} (renamed as {{UNSET_VALUE}}) in 
collections too (instead of adding {{Lists.UNSET_LIST_VALUE}}, ...).
* We can't have an 'unset' value inside a collection since we don't allow bind 
markers in the first place, and so there is a bit of useless code/validation 
related to that.
* There is a bunch of place that don't handle 'UNSET_BYTE_BUFFER' properly: 
Tuples, ColumnCondition (we might want to reject queries for which all 
conditions are 'unset' as going through the paxos code for no reason feels like 
the user is doing something wrong) and SelectStatement where we could get an 
'unset' pretty much anywhere where the {{values()}} or {{bound()}} method of a 
{{Restriction}} is used (and validation might be tricky in SelectStatement: if 
we have {{SELECT * FROM foo WHERE k1 = ? AND k2 = ? AND k3 = ?}}, then we 
shouldn't accept an 'unset' for {{k2}} unless {{k3}} is also unset; note that 
I'd be fine just refusing 'unset' in selects for now to simplify, but we at 
least need the validation code to reject them).
* I'd reject 'unset' indexes in {{UDPATE ... SET l\[?\] = ?}} since it's 
rejected for map keys. Unless maybe if both the key/index and value are 
'unset', but that should be coherent for lists and maps.
* In Constants.Marker.bindAndGet, we should skip validation if 'unset' (even 
though the validation will never fail because empty values are always accepted, 
it's still dodgy).
* We should have separate error messages when we reject both {{null}} and 
{{unset}}.
* I'd prefer rejecting 'unset' inside UDTs (and tuples). Making it equivalent 
to {{null}} gives it a different meaning than usual and we should avoid that.
* For the limit in SelectStatement, it would make sense to accept unset and to 
have it mean no limit (instead of being rejected).  The same applies for the 
timestamp and ttl in {{Attributes}}.
* In CBUtil.readValue(), we should throw a ProtocolException instead of an 
IllegalArgumentException.

Also a couple of nitpicks:
* In ModificationStatement.executeInternal, the body of the {{for}} loop should 
just be replaced by {{mutation.apply()}}.
* I might have put {{UNSET_BYTE_BUFFER}} in {{ByteBufferUtil}} since it's a 
{{ByteBuffer}}.
* The patch appears to have windows end-of-line and a few weird indentations. 
Could you check that?
* I'd have added an unset() in CQLTester to use in tests to make the tests 
terser.


 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
Assignee: Oded Peer
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 

[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-11-03 Thread Oded Peer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14194519#comment-14194519
 ] 

Oded Peer commented on CASSANDRA-7304:
--

[~slebresne] Pinging for code review

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-03.patch, 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-10-02 Thread Sylvain Lebresne (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14156282#comment-14156282
 ] 

Sylvain Lebresne commented on CASSANDRA-7304:
-

The general principle of using -1 for 'nulls' and -2 for 'unset' in the 
protocol is fine but:
* We need to document the changes. I've pushed a v4 spec doc on trunk which 
should be modified to document those change (and list them in the changelog at 
the end of the document).
* We should take the protocol version into account. Pre-v4 protocol assume that 
if the size of a value is  0, it represents null and we need to preserve that 
(one could hope that divers always use -1 for null in practice, but that wasn't 
specified that way so...). Which will probably mean pushing the protocol 
version to {{CBUtil.readValue}}.
* Once we have unset values in the protocol, {{Constants.Setter}} is far from 
being the only place were we could get them. In pretty much every place where 
we do a {{bind()}} (or {{bindAndGet()}}) we need to be warry of 
{{UNSET_BYTE_BUFFER}} (even if it's just to reject it as a non-sensical value).
* It's a nit, but for the v4 protocol, instead of saying -2 is unset and any 
other negative value is null, I'd just say -1 is null, -2 is unset and any 
other negative value is invalid.
* Not convinced of the {{CQLTester}} modification. Instead of modifying 
{{CQLTester}}, I'd just use plain old {{execute}} but pass 
{{CBUtil.UNSET_BYTE_BUFFER}} in the concrete tests. We should also extend tests 
to cover unset for collections, UDT, counter updates, etc... (which as said 
above are not handled properly by the current patch).

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Drew Kutcharian
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-09-15 Thread Oded Peer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14133692#comment-14133692
 ] 

Oded Peer commented on CASSANDRA-7304:
--

Pinging for code review

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian
  Labels: cql, protocolv4
 Fix For: 3.0

 Attachments: 7304-2.patch, 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



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


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-07-03 Thread Oded Peer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14051224#comment-14051224
 ] 

Oded Peer commented on CASSANDRA-7304:
--

Having two steps can still break backwards compatibility for clients skipping 
over the first step (advancing from the existing version to the step-2 version).
On second thought step 1 by itself breaks backwards compatibility by forcing 
client to change their code.
I don't see an elegant way to change existing behavior without breaking 
backwards compatibility.
As I see it you can either keep the existing syntax and semantics in-tact and 
add new syntax for the new feature (IGNORE NULLS), or break backwards 
compatibility and release this feature in a major version.



 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian
  Labels: cql
 Attachments: 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-07-03 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14051494#comment-14051494
 ] 

Jonathan Ellis commented on CASSANDRA-7304:
---

bq. step 1 by itself breaks backwards compatibility by forcing client to change 
their code

You're right, backwards safety is a better word than compatibility.

Do note that this is specific to the Java driver, not a server issue.

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian
  Labels: cql
 Attachments: 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-07-03 Thread Oded Peer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14051522#comment-14051522
 ] 

Oded Peer commented on CASSANDRA-7304:
--

bq. Do note that this is specific to the Java driver, not a server issue.
Let me verify your intent: you want to change the Java driver to throw an 
exception if not all the bind variables are set, then change the Cassandra code 
to make unset variables a no-op and finally change the Java driver code to 
allow unset variables.
IMHO this addresses safety in the java driver for a very short time period. I 
would skip the exception-throwing phase and go straight to implementing unset 
variables in the Java driver and add it to the release notes.


 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian
  Labels: cql
 Attachments: 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-07-03 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14051524#comment-14051524
 ] 

Jonathan Ellis commented on CASSANDRA-7304:
---

Correct.  And I'm happy to defer to Sylvain on the Java driver approach; I only 
note that my suggested steps can give you confidence that your application 
behavior hasn't changed subtly without your noticing.

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian
  Labels: cql
 Attachments: 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-07-02 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14050509#comment-14050509
 ] 

Jonathan Ellis commented on CASSANDRA-7304:
---

It will take two steps to address backwards compatibility:

# make unset throw error (and make people explicitly set to null if that's what 
they want)
# allow unset - no-op

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian
  Labels: cql
 Attachments: 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-07-01 Thread Oded Peer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14048588#comment-14048588
 ] 

Oded Peer commented on CASSANDRA-7304:
--

Aren't you concerned about backward compatibility?
If clients assume unset bind variables in prepared statements deletes the 
column value then ignoring unset bind variables breaks that assumption.

That said, assuming you differentiate between 'null' and 'unset' values using 
the size of the value, would it be acceptable to mark unset values with a new 
class (return UnsetByteBuffer) and using instanceof to ignore the bind 
variable?


 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian
  Labels: cql
 Attachments: 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-06-30 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14047754#comment-14047754
 ] 

Jonathan Ellis commented on CASSANDRA-7304:
---

I'm not a fan of flags or USING modifiers that mutate the semantics of a 
statement.  Much better to have straightforward semantics that say what they 
want the first time around.  So -1 on IGNORE NULLS from me.

I'm also -0 on adding an UNSET keyword.  If you don't want to set it, just 
leave it out.  However, recognizing that is not always desirable with prepared 
statements, I like [~jjordan]'s suggestion of allowing unset bind variables to 
simply be ignored.  So a statement of {{SET x = :x, y = :y}} with only :x 
bound, would ignore :y.

I note that currently this would not work with the Java driver since it 
defaults unbound variables to NULL.  However, this is clearly broken behavior 
on the Java driver's part that should be fixed anyway.

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian
 Attachments: 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-06-30 Thread Sylvain Lebresne (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14047772#comment-14047772
 ] 

Sylvain Lebresne commented on CASSANDRA-7304:
-

bq. So a statement of SET x = :x, y = :y with only :x bound, would ignore :y.

I'm good with that in theory. Though that does imply that we have way to 
distinguish between {{null}} and unset values in the protocol which we don't 
have. Though tbh, it's not extremely hard to add (currently the value is 
considered {{null}} is the size of the value is  0, but we could just say that 
{{null}} is a size of -1, while unset is a size of -2).

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian
 Attachments: 7304.patch


 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-06-20 Thread Oded Peer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14038504#comment-14038504
 ] 

Oded Peer commented on CASSANDRA-7304:
--

+1
I like {{IGNORE NULLS}} at the end as well

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian

 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-06-19 Thread Oded Peer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14037158#comment-14037158
 ] 

Oded Peer commented on CASSANDRA-7304:
--

I think it's confusing since it's applicable to regular statements as well.
The following statements all do the same thing: 

UPDATE table SET column = 3 WHERE key = 2;
UPDATE table USING IGNORE_NULLS true SET column = 3 WHERE key = 2;
UPDATE table USING IGNORE_NULLS false SET column = 3 WHERE key = 2;

I would like to avoid having more than one way to perform an action

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian

 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-06-19 Thread Sylvain Lebresne (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14037175#comment-14037175
 ] 

Sylvain Lebresne commented on CASSANDRA-7304:
-

How does having the option at the protocol level change this in any way? You're 
just hiding things a bit more making it easier for people to don't understand 
what's going on, but you'll still have statements with 'ignore null' set but 
who don't set any value to null. Besides, there's many way to have 2 different 
statements doing the same thing so it's not like we'd create some kind of 
horrible inconsistency. Take:
{noformat}
UPDATE table SET s = s + { 3 }, s = s + { 4 } WHERE k = 2;
UPDATE table SET s = s + { 3, 4 } WHERE k = 2;
UPDATE table SET s = s + { 3, 4 } WHERE k = blobAsInt(intAsBlob(2));
{noformat}
Besides, people are not stupid. No-one will get completely confused that 
IGNORE_NULLS is a no-op if there is no null in the query.

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian

 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-06-19 Thread Drew Kutcharian (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14037546#comment-14037546
 ] 

Drew Kutcharian commented on CASSANDRA-7304:


I agree with [~slebresne] here. Having it on the query is much clearer and 
easier to read. Also, I don't see a problem with having multiple statements 
that do the same thing, since:

bq. UPDATE table SET column = 3 WHERE key = 2;
This means use the default behavior

bq. UPDATE table USING IGNORE_NULLS true SET column = 3 WHERE key = 2;
This explicitly sets USING IGNORE_NULLS to true.

bq. UPDATE table USING IGNORE_NULLS false SET column = 3 WHERE key = 2;
This explicitly sets USING IGNORE_NULLS to false. Say if the default ever 
changes and you just don't want to be at the mercy of the default.

So I wouldn't say these 3 statements have the same meaning.

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian

 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-06-19 Thread Sylvain Lebresne (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14037553#comment-14037553
 ] 

Sylvain Lebresne commented on CASSANDRA-7304:
-

As an aside, syntax wise, I'm -1 on having a boolean for IGNORE_NULLS. It 
should be {{UPDATE table USING IGNORE_NULLS SET ...}}, not {{UPDATE table USING 
IGNORE_NULLS true SET ...}}. There is no default to worry about: {{null}} has 
a semantic in CQL and we won't change it, it's not a default that may or may 
not change. 

In fact, while we're on syntax, I'm not a huge fan of {{USING IGNORE_NULLS}} as 
it doesn't read well imo. I'd rather just have {{IGNORE NULLS}} at the end of 
the statement the same way we have a {{ALLOW FILTERING}} for selects.

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian

 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-06-19 Thread Drew Kutcharian (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14037705#comment-14037705
 ] 

Drew Kutcharian commented on CASSANDRA-7304:


+1 with {{IGNORE NULLS}} it's much more consistent with {{ALLOW FILTERING}}

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian

 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7304) Ability to distinguish between NULL and UNSET values in Prepared Statements

2014-06-18 Thread Oded Peer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14034913#comment-14034913
 ] 

Oded Peer commented on CASSANDRA-7304:
--

Since values are byte arrays I don't think it's possible to add special values 
like unset.
I am thinking of two ways to solve this:

1. Add a new flag to the QueryOptions, instructing Cassandra to ignore null 
values in prepared statements. The default being to create tombstones for 
backward compatibility.
The advantage of this approach is that it can defined by Cassandra and by the 
driver to be applied only to prepared statements.
The disadvantage I see in this is that since flags is a represented in a byte 
this will take up the last Flag slot and make a total of 8 flags.

2. Add a new boolean option to the INSERT and UPDATE commands named 
IGNORE_NULLS which instructs Cassandra to ignore null values instead of marking 
them as tombstones.
The advantage of this is that it is explicit and more natural as part of the 
language syntax.
The disadvantage is that it is not limited to prepared statements and will be 
confusing.

I prefer the first option.

 Ability to distinguish between NULL and UNSET values in Prepared Statements
 ---

 Key: CASSANDRA-7304
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7304
 Project: Cassandra
  Issue Type: Improvement
Reporter: Drew Kutcharian

 Currently Cassandra inserts tombstones when a value of a column is bound to 
 NULL in a prepared statement. At higher insert rates managing all these 
 tombstones becomes an unnecessary overhead. This limits the usefulness of the 
 prepared statements since developers have to either create multiple prepared 
 statements (each with a different combination of column names, which at times 
 is just unfeasible because of the sheer number of possible combinations) or 
 fall back to using regular (non-prepared) statements.
 This JIRA is here to explore the possibility of either:
 A. Have a flag on prepared statements that once set, tells Cassandra to 
 ignore null columns
 or
 B. Have an UNSET value which makes Cassandra skip the null columns and not 
 tombstone them
 Basically, in the context of a prepared statement, a null value means delete, 
 but we don’t have anything that means ignore (besides creating a new 
 prepared statement without the ignored column).
 Please refer to the original conversation on DataStax Java Driver mailing 
 list for more background:
 https://groups.google.com/a/lists.datastax.com/d/topic/java-driver-user/cHE3OOSIXBU/discussion



--
This message was sent by Atlassian JIRA
(v6.2#6252)