joellubi commented on code in PR #40284:
URL: https://github.com/apache/arrow/pull/40284#discussion_r1508390918
##########
go/arrow/flight/server.go:
##########
@@ -54,15 +55,86 @@ type (
Result = flight.Result
CancelFlightInfoResult = flight.CancelFlightInfoResult
CancelStatus = flight.CancelStatus
+ SessionOptionValue = flight.SessionOptionValue
+ SetSessionOptionsRequest = flight.SetSessionOptionsRequest
+ SetSessionOptionsResult = flight.SetSessionOptionsResult
+ SetSessionOptionsResultError = flight.SetSessionOptionsResult_Error
+ GetSessionOptionsRequest = flight.GetSessionOptionsRequest
+ GetSessionOptionsResult = flight.GetSessionOptionsResult
+ CloseSessionRequest = flight.CloseSessionRequest
+ CloseSessionResult = flight.CloseSessionResult
Empty = flight.Empty
)
// Constants for Action types
const (
CancelFlightInfoActionType = "CancelFlightInfo"
RenewFlightEndpointActionType = "RenewFlightEndpoint"
+ SetSessionOptionsActionType = "SetSessionOptions"
+ GetSessionOptionsActionType = "GetSessionOptions"
+ CloseSessionActionType = "CloseSession"
)
+const (
+ // The set option error is unknown. Servers should avoid
+ // using this value (send a NOT_FOUND error if the requested
+ // FlightInfo is not known). Clients can retry the request.
+ SetSessionOptionsResultErrorUnspecified =
flight.SetSessionOptionsResult_UNSPECIFIED
+ // The given session option name is invalid.
+ SetSessionOptionsResultErrorInvalidName =
flight.SetSessionOptionsResult_INVALID_NAME
+ // The session option value or type is invalid.
+ SetSessionOptionsResultErrorInvalidValue =
flight.SetSessionOptionsResult_INVALID_VALUE
+ // The session option cannot be set.
+ SetSessionOptionsResultErrorError = flight.SetSessionOptionsResult_ERROR
+)
+
+const (
+ // The close session status is unknown. Servers should avoid
+ // using this value (send a NOT_FOUND error if the requested
+ // FlightInfo is not known). Clients can retry the request.
+ CloseSessionResultUnspecified = flight.CloseSessionResult_UNSPECIFIED
+ // The session close request is complete.
+ CloseSessionResultClosed = flight.CloseSessionResult_CLOSED
+ // The session close request is in progress. The client may retry the
request.
+ CloseSessionResultClosing = flight.CloseSessionResult_CLOSING
+ // The session is not closeable.
+ CloseSessionResultNotCloseable = flight.CloseSessionResult_NOT_CLOSEABLE
+)
+
+func NewSessionOptionValues(options map[string]any)
(map[string]*flight.SessionOptionValue, error) {
Review Comment:
Updated
##########
go/arrow/flight/server.go:
##########
@@ -54,15 +55,86 @@ type (
Result = flight.Result
CancelFlightInfoResult = flight.CancelFlightInfoResult
CancelStatus = flight.CancelStatus
+ SessionOptionValue = flight.SessionOptionValue
+ SetSessionOptionsRequest = flight.SetSessionOptionsRequest
+ SetSessionOptionsResult = flight.SetSessionOptionsResult
+ SetSessionOptionsResultError = flight.SetSessionOptionsResult_Error
+ GetSessionOptionsRequest = flight.GetSessionOptionsRequest
+ GetSessionOptionsResult = flight.GetSessionOptionsResult
+ CloseSessionRequest = flight.CloseSessionRequest
+ CloseSessionResult = flight.CloseSessionResult
Empty = flight.Empty
)
// Constants for Action types
const (
CancelFlightInfoActionType = "CancelFlightInfo"
RenewFlightEndpointActionType = "RenewFlightEndpoint"
+ SetSessionOptionsActionType = "SetSessionOptions"
+ GetSessionOptionsActionType = "GetSessionOptions"
+ CloseSessionActionType = "CloseSession"
)
+const (
+ // The set option error is unknown. Servers should avoid
+ // using this value (send a NOT_FOUND error if the requested
+ // FlightInfo is not known). Clients can retry the request.
+ SetSessionOptionsResultErrorUnspecified =
flight.SetSessionOptionsResult_UNSPECIFIED
+ // The given session option name is invalid.
+ SetSessionOptionsResultErrorInvalidName =
flight.SetSessionOptionsResult_INVALID_NAME
+ // The session option value or type is invalid.
+ SetSessionOptionsResultErrorInvalidValue =
flight.SetSessionOptionsResult_INVALID_VALUE
+ // The session option cannot be set.
+ SetSessionOptionsResultErrorError = flight.SetSessionOptionsResult_ERROR
+)
+
+const (
+ // The close session status is unknown. Servers should avoid
+ // using this value (send a NOT_FOUND error if the requested
+ // FlightInfo is not known). Clients can retry the request.
+ CloseSessionResultUnspecified = flight.CloseSessionResult_UNSPECIFIED
+ // The session close request is complete.
+ CloseSessionResultClosed = flight.CloseSessionResult_CLOSED
+ // The session close request is in progress. The client may retry the
request.
+ CloseSessionResultClosing = flight.CloseSessionResult_CLOSING
+ // The session is not closeable.
+ CloseSessionResultNotCloseable = flight.CloseSessionResult_NOT_CLOSEABLE
+)
+
+func NewSessionOptionValues(options map[string]any)
(map[string]*flight.SessionOptionValue, error) {
+ sessionOptions := make(map[string]*flight.SessionOptionValue,
len(options))
+ for key, val := range options {
+ optval, err := NewSessionOptionValue(val)
+ if err != nil {
+ return nil, err
+ }
+ sessionOptions[key] = &optval
+ }
+
+ return sessionOptions, nil
+}
+
+func NewSessionOptionValue(value any) (flight.SessionOptionValue, error) {
Review Comment:
Updated
--
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]