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] Add an interface to FlightSqlService for retrieving the schema key in the request metadata #6562

Open
niebayes opened this issue Oct 15, 2024 · 1 comment
Labels
enhancement Any new improvement worthy of a entry in the changelog

Comments

@niebayes
Copy link

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

Some SQL statements require a schema or even a catalog to be specified for successful execution. For example, SELECT * FROM my_table might fail on certain databases since the context is not fully specified, i.e. on which catalog.schema.table the statement is executing.

To provide such context, we use set_header on the client side to encode it into the request metadata. For instance, our implementation calls flight_sql_client.set_header("database", schema_name) to specify the schema. However, the schema key database is determined by the server, and the client has no way to retrieve this key dynamically. Worse, if the key changes on the server side, client code may break.

I propose adding an interface to FlightSqlService that allows the client to retrieve the schema or catalog key for encoding context in request metadata. This would enhance flexibility for client-server interaction.

Describe the solution you'd like

Add a interface to FlightSqlService, such as do_get_schema_key, that allows a client to get the schema key from the server.

Describe alternatives you've considered

Adding a protocol-determined constant SCHEMA_KEY may also work but not very flexible.

Additional context

@niebayes niebayes added the enhancement Any new improvement worthy of a entry in the changelog label Oct 15, 2024
@alamb
Copy link
Contributor

alamb commented Oct 15, 2024

Thank you for the suggestion @niebayes

If this is part of the flightsql specification it makes sense. If this is an extension (not part of Arrow FlightSQL) then I think it would be better kept in users of the crate (rather than adding a new API)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Any new improvement worthy of a entry in the changelog
Projects
None yet
Development

No branches or pull requests

2 participants