Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FlightSQL] Allow implementations of FlightSqlService to handle custom actions and commands #4439

Closed
amartins23 opened this issue Jun 21, 2023 · 0 comments · Fixed by #4463
Closed
Labels
arrow Changes to the arrow crate arrow-flight Changes to the arrow-flight crate enhancement Any new improvement worthy of a entry in the changelog

Comments

@amartins23
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

The current FlightSqlService trait allows the implementer to handle custom commands in the DoGet call via do_get_fallback method implementation. However, no such possibility is offered for DoPut, DoAction and ListActions.

A similar case could be made for DoExchange.

Describe the solution you'd like

Create new methods (with default implementations) in the FlightSqlService trait: do_put_fallback, do_action_fallback, with equivalent behavior as the do_get_fallback method. Furthermore, add a method that enables the implementation of the FlightSqlService trait to fill in additional actions to the actions returned by ListActions (

let actions: Vec<Result<ActionType, Status>> = vec![
Ok(create_prepared_statement_action_type),
Ok(close_prepared_statement_action_type),
Ok(create_prepared_substrait_plan_action_type),
Ok(begin_transaction_action_type),
Ok(end_transaction_action_type),
Ok(begin_savepoint_action_type),
Ok(end_savepoint_action_type),
Ok(cancel_query_action_type),
];
), maybe named add_custom_actions that adds the actions to the existing vector, or a list_custom_actions that returns a (optional) vector that is appended to the existing vector.

Describe alternatives you've considered

The alternative is to create a wrapper FlightService implementation that has custom handling, then forwards everything to the existing implementation provided by implementing FlightSqlService.

Additional context

@amartins23 amartins23 added the enhancement Any new improvement worthy of a entry in the changelog label Jun 21, 2023
@amartins23 amartins23 changed the title Allow implementations of FlightSqlService to handle custom actions and commands [FlightSQL] Allow implementations of FlightSqlService to handle custom actions and commands Jun 21, 2023
@tustvold tustvold added arrow Changes to the arrow crate arrow-flight Changes to the arrow-flight crate labels Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate arrow-flight Changes to the arrow-flight crate enhancement Any new improvement worthy of a entry in the changelog
Projects
None yet
2 participants