lidavidm commented on code in PR #1577:
URL: https://github.com/apache/arrow-adbc/pull/1577#discussion_r1509368227


##########
go/adbc/driver/flightsql/utils.go:
##########
@@ -92,19 +93,37 @@ func adbcFromFlightStatusWithDetails(err error, header, 
trailer metadata.MD, con
        // XXX: must check both headers and trailers because some 
implementations
        // (like gRPC-Java) will consolidate trailers into headers for failed 
RPCs
        for key, values := range header {
-               switch key {
-               case "content-type", "grpc-status-details-bin":
+               switch {
+               case key == "content-type":
+                       // Not useful info
                        continue
+               case key == "grpc-status-details-bin":
+                       // gRPC library parses this above via grpcStatus.Proto()
+                       continue
+               case strings.HasSuffix(key, "-bin"):
+                       for _, value := range values {
+                               // that's right, gRPC stuffs binary data into a 
"string"
+                               details = append(details, 
&adbc.BinaryErrorDetail{Name: key, Detail: []byte(value)})
+                       }
                default:
                        for _, value := range values {
                                details = append(details, 
&adbc.TextErrorDetail{Name: key, Detail: value})
                        }
                }

Review Comment:
   Also, we already call Convert above...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to