zeroshade commented on code in PR #40311:
URL: https://github.com/apache/arrow/pull/40311#discussion_r1561744073


##########
go/arrow/flight/flightsql/example/sqlite_server.go:
##########
@@ -618,21 +618,21 @@ func getParamsForStatement(rdr flight.MessageReader) 
(params [][]interface{}, er
        return params, rdr.Err()
 }
 
-func (s *SQLiteFlightSQLServer) DoPutPreparedStatementQuery(_ context.Context, 
cmd flightsql.PreparedStatementQuery, rdr flight.MessageReader, _ 
flight.MetadataWriter) error {
+func (s *SQLiteFlightSQLServer) DoPutPreparedStatementQuery(_ context.Context, 
cmd flightsql.PreparedStatementQuery, rdr flight.MessageReader, _ 
flight.MetadataWriter) ([]byte, error) {
        val, ok := s.prepared.Load(string(cmd.GetPreparedStatementHandle()))
        if !ok {
-               return status.Error(codes.InvalidArgument, "prepared statement 
not found")
+               return nil, status.Error(codes.InvalidArgument, "prepared 
statement not found")
        }
 
        stmt := val.(Statement)
        args, err := getParamsForStatement(rdr)
        if err != nil {
-               return status.Errorf(codes.Internal, "error gathering 
parameters for prepared statement query: %s", err.Error())
+               return nil, status.Errorf(codes.Internal, "error gathering 
parameters for prepared statement query: %s", err.Error())
        }
 
        stmt.params = args
        s.prepared.Store(string(cmd.GetPreparedStatementHandle()), stmt)

Review Comment:
   Because the handles are completely opaque to the protocol, it would depend 
entirely on how a given server chooses to represent its handle. The example 
server just uses a random character string as the handle which is a key into 
the map. But the handle could just as easily be a serialized protobuf message, 
etc. if desired.



-- 
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