Skip to content

[GLib][FlightRPC] Add gaflightsql_client_close_session() #55627

Open

Description

@kou

Describe the enhancement requested

Apache Arrow Flight SQL PostgreSQL adapter wants to support CloseSession to close a session explicitly: apache/arrow-flight-sql-postgresql#13

Its tests use the Ruby bindings (Red Arrow Flight SQL) but we can't send CloseSession from Ruby. C++ has arrow::flight::sql::FlightSqlClient::CloseSession() but GAFlightSQLClient doesn't have the corresponding function.

We can add the following API:

typedef enum {
  GAFLIGHT_CLOSE_SESSION_STATUS_UNSPECIFIED,
  GAFLIGHT_CLOSE_SESSION_STATUS_CLOSED,
  GAFLIGHT_CLOSE_SESSION_STATUS_CLOSING,
  GAFLIGHT_CLOSE_SESSION_STATUS_NOT_CLOSABLE,
} GAFlightCloseSessionStatus;

GAFlightCloseSessionStatus
gaflightsql_client_close_session(GAFlightSQLClient *client,
                                 GAFlightCallOptions *options,
                                 GError **error);

GAFlightCloseSessionStatus corresponds to arrow::flight::CloseSessionStatus. CloseSessionRequest is empty, so we don't need an object for it for now.

We can use it from Ruby by ArrowFlightSQL::Client#close_session(options) automatically.

SetSessionOptions() and GetSessionOptions() aren't needed for this use case. We can add them later as separated tasks.

Component(s)

FlightRPC, GLib

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions