[ https://issues.apache.org/jira/browse/CASSANDRA-3634?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13187847#comment-13187847 ]
Rick Shaw commented on CASSANDRA-3634: -------------------------------------- If we settle on {{ByteBuffer}} as the encoding of arguments then I believe we must accompany it with a indicator of how it was encoded. Without it, on the server side we will have to trust that the caller encoded the argument to _exactly_ match the proper encoding for the validator or comparator used in the {{Term}}. With {{String}} encoding as the argument, there is no such requirement because every validator or comparator can use {{fromString()}} method. Complicating this in the JDBC driver is that the notion that the caller is free to provide almost any compatible type to the "setter" method and the "right" data will be passed to the server side. The client side does not have explicit knowledge of the required data types that have been dictated by the CQL that was prepared on the server side. Really no problem with string because all args are passed as a string to be dealt with on the other side; but with {{ByteBuffer}} if you let the user pass a number as a string for something that has a validator of type: {{varint}} it will throw an {{Exception}}. If we pass the encoding method in addition to {{ByteBuffer}} we will have enough into on the server side to transpose the data to the required format that is dictated by the validator or comparator. > compare string vs. binary prepared statement parameters > ------------------------------------------------------- > > Key: CASSANDRA-3634 > URL: https://issues.apache.org/jira/browse/CASSANDRA-3634 > Project: Cassandra > Issue Type: Sub-task > Components: API, Core > Reporter: Eric Evans > Assignee: Eric Evans > Priority: Minor > Labels: cql > Fix For: 1.1 > > > Perform benchmarks to compare the performance of string and pre-serialized > binary parameters to prepared statements. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira