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

feat: Add Flight SQL server support #365

Open
deephaven-internal opened this issue Nov 21, 2024 · 1 comment
Open

feat: Add Flight SQL server support #365

deephaven-internal opened this issue Nov 21, 2024 · 1 comment

Comments

@deephaven-internal
Copy link

This issue was auto-generated

PR: deephaven/deephaven-core#6023
Author: devinrsmith

Original PR Body

This adds Arrow Flight SQL support to the Deephaven server, with the goal of supporting various SQL drivers built on top of Flight SQL (JDBC, ADBC, ODBC). It is limited to query statements (ie, no UPDATEs). The implementation supports ad-hoc query statements and ad-hoc looking prepared query statements, but not parameterized prepared statements. Queries are able to reference tables from the global scope by name; we might be able to expand support to other resolvers in the future, potentially with catalogs and namespaces. The scope of supported queries is guided by our Sql engine io.deephaven.engine.sql.Sql which is based on a Calcite query parser.

It is important to note that while the Flight SQL implementation respects io.deephaven.server.session.TicketResolver.Authorization.transform it is not hooked up to io.deephaven.auth.ServiceAuthWiring nor io.deephaven.server.table.validation.ColumnExpressionValidator. So while Flight SQL does not allow users script execution, it does not limit the table operations a user may perform, nor does it restrict the calling of arbitrary functions from a formula. As such, the security posture of Flight SQL sits somewhere between "full access" and "limited access".

A cookie-based authentication extension has been added to support some Flight SQL clients which don't operate via the normal Flight authentication "Authorization" header (yes, it's a misnomer), and instead expect the server to send "Set-Cookie" to the clients, and for the clients to echo back the cookie(s) via the "Cookie" header. The server will only send the authentication token as a cookie when the client sends the header and value "x-deephaven-auth-cookie-request=true". To support this, the io.grpc.Context has been captured and preserved during the export submission logic.

The full Flight SQL action and command spectrum has been skeleton-ed out with appropriate "unimplemented" messages in anticipation that we will want to expand the scope of the Flight SQL implementation in the future. It also serves as a more explicit guide to readers of the code for what is and is not supported.

Fixes #5339

@devinrsmith
Copy link
Member

The main documentation effort here will be in regards to "how do I connect a client to Deephaven Flight SQL"

devinrsmith added a commit to devinrsmith/deephaven-core that referenced this issue Nov 25, 2024
This is adding Flight SQL Java ADBC tests, mainly in support of a documentation effort on how to connect different clients to Deephaven Flight SQL, see deephaven/deephaven-docs-community#365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants