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


##########
go/arrow/flight/flightsql/server.go:
##########
@@ -511,8 +511,36 @@ func (BaseServer) BeginSavepoint(context.Context, 
ActionBeginSavepointRequest) (
        return nil, status.Error(codes.Unimplemented, "BeginSavepoint not 
implemented")
 }
 
-func (BaseServer) CancelQuery(context.Context, ActionCancelQueryRequest) 
(CancelResult, error) {
-       return CancelResultUnspecified, status.Error(codes.Unimplemented, 
"CancelQuery not implemented")
+func (b *BaseServer) CancelQuery(context context.Context, request 
ActionCancelQueryRequest) (CancelResult, error) {
+       result, err := b.CancelFlightInfo(context, request.GetInfo())
+       if err != nil {
+               return CancelResultUnspecified, err
+       }

Review Comment:
   This won't do what you expect. Go embedding doesn't work like C++ 
polymorphism, this method isn't a virtual call and will *always* call the 
BaseServer version of `CancelFlightInfo`. A user would need to override 
`CancelQuery` in order to call their own `CancelFlightInfo`. So it's probably 
not worthwhile to have this base implementation. 
   
   You should move this implementation to `flightSqlServer` and then call 
`f.srv.CancelFlightInfo` like we do for the other actions. Probably should also 
remove the `CancelQuery` from the `Server` interface here so that users ONLY 
have to implement `CancelFlightInfo`. 
   
   If we're concerned about breaking changes, then we'd need to likely use 
reflection to check if they have their own `CancelQuery` implementation and 
call that, otherwise fallback to calling `f.srv.CancelFlightInfo`



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