kou commented on code in PR #36009:
URL: https://github.com/apache/arrow/pull/36009#discussion_r1239544932


##########
go/arrow/flight/flightsql/server.go:
##########
@@ -927,10 +937,78 @@ func (f *flightSqlServer) ListActions(_ *flight.Empty, 
stream flight.FlightServi
        return nil
 }
 
+func cancelStatusToCancelResult(status flight.CancelStatus) CancelResult {
+       switch status {
+       case flight.CancelStatusUnspecified:
+               return CancelResultUnspecified
+       case flight.CancelStatusCancelled:
+               return CancelResultCancelled
+       case flight.CancelStatusCancelling:
+               return CancelResultCancelling
+       case flight.CancelStatusNotCancellable:
+               return CancelResultNotCancellable
+       default:
+               return CancelResultUnspecified
+       }
+}
+
 func (f *flightSqlServer) DoAction(cmd *flight.Action, stream 
flight.FlightService_DoActionServer) error {
        var anycmd anypb.Any
 
        switch cmd.Type {
+       case flight.CancelFlightInfoActionType:
+               var (
+                       info   flight.FlightInfo
+                       result flight.CancelFlightInfoResult
+                       err    error
+               )
+
+               if err = proto.Unmarshal(cmd.Body, &info); err != nil {
+                       return status.Errorf(codes.InvalidArgument, "unable to 
unmarshal FlightInfo for CancelFlightInfo: %s", err.Error())
+               }
+
+               if result, err = f.srv.CancelFlightInfo(stream.Context(), 
&info); err != nil {
+                       return err
+               }

Review Comment:
   Thanks! It works!



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