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

Josh Elser commented on CALCITE-1209:
-------------------------------------

I guess that this means that I also broke backwards compatibility with 
CALCITE-1103 (because I didn't realize we were doing it wrong). I will also 
need to add some special parsing to verify that if a protobuf message with the 
a b64 string can still be interpreted as bytes.

> Byte strings not being correctly decoded when sent to avatica using protocol 
> buffers
> ------------------------------------------------------------------------------------
>
>                 Key: CALCITE-1209
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1209
>             Project: Calcite
>          Issue Type: Bug
>          Components: avatica
>    Affects Versions: avatica-1.7.1
>            Reporter: Francis Chuang
>            Assignee: Josh Elser
>            Priority: Blocker
>             Fix For: avatica-1.8.0
>
>
> When sending a typed value as a byte string to avatica using protocol 
> buffers, it does not accept the bytes as an array of raw bytes in the 
> {{bytes_values}} field.
> To work around it, the data needs to be first base64 encoded and then sent in 
> the {{string_value}} field.
> This is the decoded protocol buffer being sent by the thin client:
> {code}
> 1: "org.apache.calcite.avatica.proto.Requests$ExecuteRequest"
> 2 {
>   1 {
>     1: "5141356e-f331-48c9-9d01-d71176ad92e8"
>     2: 126
>     3 {
>       2: "UPSERT INTO PQS.INTEGER_TABLE VALUES(?, ?)"
>       3 {
>         4: 4
>         5: "INTEGER"
>         6: "java.lang.Integer"
>         7: "?1"
>       }
>       3 {
>         4: 4294967293
>         5: "VARBINARY"
>         6: "[B"
>         7: "?2"
>       }
>       4 {
>         1: 4
>       }
>     }
>   }
>   2 {
>     1: 12
>     4: 2
>   }
>   2 {
>     1: 20
>     // Data sent in string_value and base64 encoded
>     3: "iVBORw0KGgoAAAANSUhEUgAABmIAAAiwCAYAAAAvCT8OAAAACXBI..."
>   }
>   3: 100
>   4: 1
> }
> {code}



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

Reply via email to