[jira] [Commented] (CASSANDRA-4739) Prepared Statements don't support collections
[ https://issues.apache.org/jira/browse/CASSANDRA-4739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13469549#comment-13469549 ] Jonathan Ellis commented on CASSANDRA-4739: --- +1, although it seems weird to have partly-prepared statements to me. Weird in the I hope this doesn't get a lot more complicated and cause us grief in the future kind of way. :) Prepared Statements don't support collections - Key: CASSANDRA-4739 URL: https://issues.apache.org/jira/browse/CASSANDRA-4739 Project: Cassandra Issue Type: Bug Affects Versions: 1.2.0 beta 1 Environment: Cassandra 937f15e1 OS X 10.8.2 java version 1.6.0_35 Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811) Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode) Reporter: Jonathan Rudenberg Assignee: Sylvain Lebresne Fix For: 1.2.0 beta 2 Attachments: 4739.txt I'm putting a collection onto the wire in an EXECUTE request with exactly the same bytes that Cassandra encodes the same data in a response: Can't apply operation on column with org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type) type Here's the full trace log from cassandra: {noformat} DEBUG 19:24:15,414 Received: PREPARE INSERT INTO things (id, set_text) VALUES (?, ?); TRACE 19:24:15,414 CQL QUERY: INSERT INTO things (id, set_text) VALUES (?, ?); TRACE 19:24:15,415 Stored prepared statement #413587006 with 2 bind markers DEBUG 19:24:15,415 Responding: RESULT PREPARED 413587006 [id(gocql_collections, things), org.apache.cassandra.db.marshal.TimeUUIDType][set_text(gocql_collections, things), org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type)] DEBUG 19:24:15,416 Received: EXECUTE 413587006 with 2 values TRACE 19:24:15,416 [1] 'java.nio.HeapByteBuffer[pos=18 lim=34 cap=53]' TRACE 19:24:15,416 [2] 'java.nio.HeapByteBuffer[pos=38 lim=51 cap=53]' DEBUG 19:24:15,417 Responding: ERROR INVALID: Can't apply operation on column with org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type) type. {noformat} The prepared statement is: {noformat} INSERT INTO things (id, set_text) VALUES (?, ?); {noformat} and the collection value ({'asdf', 'sdf'}) is encoded as: {noformat} 00 02 00 04 61 73 64 66 00 03 73 64 66 {noformat} which is byte-for-byte exactly the same as what I get from Cassandra off the wire when I do a query for the same data. I already have the driver working with other queries/inserts with all other types, so this is just a collection encoding problem. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-4739) Prepared Statements don't support collections
[ https://issues.apache.org/jira/browse/CASSANDRA-4739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13468758#comment-13468758 ] Jonathan Rudenberg commented on CASSANDRA-4739: --- I've been testing this patch out a bit, and it's mostly working, but I ran into an issue when using a maptimestamp,int ({1349286846012: 2}): Expected 8 or 0 byte long for date (4) The map is encoded in the exact same format that I get from the server when querying the same value: {noformat} 00 01 00 08 00 00 01 3a 27 c3 5e 3c 00 04 00 00 00 02 {noformat} Prepared Statements don't support collections - Key: CASSANDRA-4739 URL: https://issues.apache.org/jira/browse/CASSANDRA-4739 Project: Cassandra Issue Type: Bug Affects Versions: 1.2.0 beta 1 Environment: Cassandra 937f15e1 OS X 10.8.2 java version 1.6.0_35 Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811) Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode) Reporter: Jonathan Rudenberg Assignee: Sylvain Lebresne Fix For: 1.2.0 beta 2 Attachments: 4739.txt I'm putting a collection onto the wire in an EXECUTE request with exactly the same bytes that Cassandra encodes the same data in a response: Can't apply operation on column with org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type) type Here's the full trace log from cassandra: {noformat} DEBUG 19:24:15,414 Received: PREPARE INSERT INTO things (id, set_text) VALUES (?, ?); TRACE 19:24:15,414 CQL QUERY: INSERT INTO things (id, set_text) VALUES (?, ?); TRACE 19:24:15,415 Stored prepared statement #413587006 with 2 bind markers DEBUG 19:24:15,415 Responding: RESULT PREPARED 413587006 [id(gocql_collections, things), org.apache.cassandra.db.marshal.TimeUUIDType][set_text(gocql_collections, things), org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type)] DEBUG 19:24:15,416 Received: EXECUTE 413587006 with 2 values TRACE 19:24:15,416 [1] 'java.nio.HeapByteBuffer[pos=18 lim=34 cap=53]' TRACE 19:24:15,416 [2] 'java.nio.HeapByteBuffer[pos=38 lim=51 cap=53]' DEBUG 19:24:15,417 Responding: ERROR INVALID: Can't apply operation on column with org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type) type. {noformat} The prepared statement is: {noformat} INSERT INTO things (id, set_text) VALUES (?, ?); {noformat} and the collection value ({'asdf', 'sdf'}) is encoded as: {noformat} 00 02 00 04 61 73 64 66 00 03 73 64 66 {noformat} which is byte-for-byte exactly the same as what I get from Cassandra off the wire when I do a query for the same data. I already have the driver working with other queries/inserts with all other types, so this is just a collection encoding problem. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-4739) Prepared Statements don't support collections
[ https://issues.apache.org/jira/browse/CASSANDRA-4739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13467820#comment-13467820 ] Jonathan Ellis commented on CASSANDRA-4739: --- bq. this require a little bit of specific code because we must deserialize the sent list to be able to insert internally one column per element How is this different from Collection support in non-prepared statements? Prepared Statements don't support collections - Key: CASSANDRA-4739 URL: https://issues.apache.org/jira/browse/CASSANDRA-4739 Project: Cassandra Issue Type: Bug Affects Versions: 1.2.0 beta 1 Environment: Cassandra 937f15e1 OS X 10.8.2 java version 1.6.0_35 Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811) Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode) Reporter: Jonathan Rudenberg Assignee: Sylvain Lebresne Fix For: 1.2.0 beta 2 Attachments: 4739.txt I'm putting a collection onto the wire in an EXECUTE request with exactly the same bytes that Cassandra encodes the same data in a response: Can't apply operation on column with org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type) type Here's the full trace log from cassandra: {noformat} DEBUG 19:24:15,414 Received: PREPARE INSERT INTO things (id, set_text) VALUES (?, ?); TRACE 19:24:15,414 CQL QUERY: INSERT INTO things (id, set_text) VALUES (?, ?); TRACE 19:24:15,415 Stored prepared statement #413587006 with 2 bind markers DEBUG 19:24:15,415 Responding: RESULT PREPARED 413587006 [id(gocql_collections, things), org.apache.cassandra.db.marshal.TimeUUIDType][set_text(gocql_collections, things), org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type)] DEBUG 19:24:15,416 Received: EXECUTE 413587006 with 2 values TRACE 19:24:15,416 [1] 'java.nio.HeapByteBuffer[pos=18 lim=34 cap=53]' TRACE 19:24:15,416 [2] 'java.nio.HeapByteBuffer[pos=38 lim=51 cap=53]' DEBUG 19:24:15,417 Responding: ERROR INVALID: Can't apply operation on column with org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type) type. {noformat} The prepared statement is: {noformat} INSERT INTO things (id, set_text) VALUES (?, ?); {noformat} and the collection value ({'asdf', 'sdf'}) is encoded as: {noformat} 00 02 00 04 61 73 64 66 00 03 73 64 66 {noformat} which is byte-for-byte exactly the same as what I get from Cassandra off the wire when I do a query for the same data. I already have the driver working with other queries/inserts with all other types, so this is just a collection encoding problem. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-4739) Prepared Statements don't support collections
[ https://issues.apache.org/jira/browse/CASSANDRA-4739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13467833#comment-13467833 ] Sylvain Lebresne commented on CASSANDRA-4739: - bq. How is this different from Collection support in non-prepared statements? That's dealt with by the parser. Prepared Statements don't support collections - Key: CASSANDRA-4739 URL: https://issues.apache.org/jira/browse/CASSANDRA-4739 Project: Cassandra Issue Type: Bug Affects Versions: 1.2.0 beta 1 Environment: Cassandra 937f15e1 OS X 10.8.2 java version 1.6.0_35 Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811) Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode) Reporter: Jonathan Rudenberg Assignee: Sylvain Lebresne Fix For: 1.2.0 beta 2 Attachments: 4739.txt I'm putting a collection onto the wire in an EXECUTE request with exactly the same bytes that Cassandra encodes the same data in a response: Can't apply operation on column with org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type) type Here's the full trace log from cassandra: {noformat} DEBUG 19:24:15,414 Received: PREPARE INSERT INTO things (id, set_text) VALUES (?, ?); TRACE 19:24:15,414 CQL QUERY: INSERT INTO things (id, set_text) VALUES (?, ?); TRACE 19:24:15,415 Stored prepared statement #413587006 with 2 bind markers DEBUG 19:24:15,415 Responding: RESULT PREPARED 413587006 [id(gocql_collections, things), org.apache.cassandra.db.marshal.TimeUUIDType][set_text(gocql_collections, things), org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type)] DEBUG 19:24:15,416 Received: EXECUTE 413587006 with 2 values TRACE 19:24:15,416 [1] 'java.nio.HeapByteBuffer[pos=18 lim=34 cap=53]' TRACE 19:24:15,416 [2] 'java.nio.HeapByteBuffer[pos=38 lim=51 cap=53]' DEBUG 19:24:15,417 Responding: ERROR INVALID: Can't apply operation on column with org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type) type. {noformat} The prepared statement is: {noformat} INSERT INTO things (id, set_text) VALUES (?, ?); {noformat} and the collection value ({'asdf', 'sdf'}) is encoded as: {noformat} 00 02 00 04 61 73 64 66 00 03 73 64 66 {noformat} which is byte-for-byte exactly the same as what I get from Cassandra off the wire when I do a query for the same data. I already have the driver working with other queries/inserts with all other types, so this is just a collection encoding problem. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira