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

[Format] Add AdbcStatementExecuteSchema #318

Closed
lidavidm opened this issue Jan 6, 2023 · 2 comments · Fixed by #971
Closed

[Format] Add AdbcStatementExecuteSchema #318

lidavidm opened this issue Jan 6, 2023 · 2 comments · Fixed by #971

Comments

@lidavidm
Copy link
Member

lidavidm commented Jan 6, 2023

It would be useful to be able to get the schema of a query's result set without actually executing it. For example, Ibis uses this to allow embedding arbitrary SQL within its DSL. And Flight SQL already supports this.

We could add a new function:

AdbcStatusCode AdbcStatementExecuteSchema(
  struct AdbcStatement* statement,
  struct ArrowSchema* schema,
  struct AdbcError* error);
  • Drivers may implement this by executing the query.
  • They may attempt to transform the query to limit side effects and execution time, however, this is not guaranteed.
    • In other words, don’t use this with DML/DDL queries, though that doesn’t really make sense in the first place.
    • If the client itself is able to transform the query to limit execution time, this is still a good idea.

This applies across languages. See #317 for how backwards compatibility would be managed.

@lidavidm lidavidm added this to the ADBC API Specification 1.1.0 milestone Jan 6, 2023
@lidavidm lidavidm changed the title [Format][C] Add AdbcStatementExecuteSchema [Format] Add AdbcStatementExecuteSchema Jan 6, 2023
@tokoko
Copy link
Contributor

tokoko commented Jan 12, 2023

I started rewriting spark-flight-sql data source to spark-adbc (https://github.com/tokoko/spark-adbc), this function would greatly simplify efficient schema inference. I can give implementing this a try (at least in Java) if that's okay with you.

P.S. Wouldn't it make more sense for the drivers to fail if schema detection can't be accomplished without significant execution time? (up to drivers to decide what "significant" means) I'm thinking of stored procedures in case of jdbc, for example. It would force clients to explicitly call executeQuery in such cases and avoid inadvertently executing long-running queries.

@lidavidm
Copy link
Member Author

Failing probably makes more sense, we should make sure to define the error code in that case.

Since this affects the spec, we're still deciding how best to handle the development process; if you're interested, please chime in on the mailing list. https://lists.apache.org/thread/3y73755p0w4n25rd5ry2ppnhzkz3thv3

lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue May 17, 2023
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue May 17, 2023
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue May 17, 2023
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jun 26, 2023
A draft implementation of the new StatementExecuteSchema method
for the PostgreSQL driver.

See apache#318.
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jun 27, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jun 27, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jun 27, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA) (apache#319)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jun 27, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA) (apache#319)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jun 28, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (apache#319)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jun 28, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (apache#319)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jun 29, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (apache#319)
- Get/SetOption
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jun 29, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (apache#319)
- Get/SetOption
- error_details (apache#755)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jun 29, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (apache#319)
- Get/SetOption
- error_details (apache#755)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jun 29, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (apache#319)
- Get/SetOption
- error_details (apache#755)
- GetStatistics (apache#685)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jun 29, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (apache#319)
- Get/SetOption
- error_details (apache#755)
- GetStatistics (apache#685)
- New ingest modes (apache#541)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jun 29, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA) (apache#319)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jun 30, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (apache#319)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jul 5, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (apache#319)
- error_details (apache#755)
- GetStatistics (apache#685)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jul 10, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (apache#319)
- Get/SetOption
- error_details (apache#755)
- GetStatistics (apache#685)
- New ingest modes (apache#541)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jul 10, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (apache#319)
- Get/SetOption
- error_details (apache#755)
- GetStatistics (apache#685)
- New ingest modes (apache#541)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jul 10, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (apache#319)
- Get/SetOption
- error_details (apache#755)
- GetStatistics (apache#685)
- New ingest modes (apache#541)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jul 10, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (apache#319)
- Get/SetOption
- error_details (apache#755)
- GetStatistics (apache#685)
- New ingest modes (apache#541)
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jul 24, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA) (apache#319)
- ConnectionCancel/StatementCancel
- GetOption/SetOption
- Ingest modes
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jul 25, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA) (apache#319)
- ConnectionCancel/StatementCancel
- GetOption/SetOption
- Ingest modes
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jul 25, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA) (apache#319)
- ConnectionCancel/StatementCancel
- GetOption/SetOption
- Ingest modes
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jul 25, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA) (apache#319)
- ConnectionCancel/StatementCancel
- GetOption/SetOption
- Ingest modes
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jul 25, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA) (apache#319)
- ConnectionCancel/StatementCancel
- GetOption/SetOption
- Ingest modes
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jul 26, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA) (apache#319)
- ConnectionCancel/StatementCancel
- GetOption/SetOption
- Ingest modes
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jul 26, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA) (apache#319)
- ConnectionCancel/StatementCancel
- GetOption/SetOption
- Ingest modes
lidavidm added a commit to lidavidm/arrow-adbc that referenced this issue Jul 26, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (apache#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA) (apache#319)
- ConnectionCancel/StatementCancel
- GetOption/SetOption
- Ingest modes
lidavidm added a commit that referenced this issue Jul 26, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- Cancellation
- Get/SetOption
- New ingest modes
lidavidm added a commit that referenced this issue Aug 3, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- Get/SetOption
- error_details (#755)
- GetStatistics (#685)
- New ingest modes (#541)
lidavidm added a commit that referenced this issue Aug 3, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- error_details (#755)
- GetStatistics (#685)
lidavidm added a commit that referenced this issue Aug 3, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- Cancellation
- Get/SetOption
- New ingest modes
lidavidm added a commit that referenced this issue Aug 3, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- Cancellation
- Get/SetOption
- New ingest modes
lidavidm added a commit that referenced this issue Aug 10, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- Get/SetOption
- error_details (#755)
- GetStatistics (#685)
- New ingest modes (#541)
lidavidm added a commit that referenced this issue Aug 10, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- error_details (#755)
- GetStatistics (#685)
lidavidm added a commit that referenced this issue Aug 10, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- Cancellation
- Get/SetOption
- New ingest modes
lidavidm added a commit that referenced this issue Aug 10, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- Get/SetOption
- error_details (#755)
- GetStatistics (#685)
- New ingest modes (#541)
lidavidm added a commit that referenced this issue Aug 10, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- error_details (#755)
- GetStatistics (#685)
lidavidm added a commit that referenced this issue Aug 10, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- Cancellation
- Get/SetOption
- New ingest modes
lidavidm added a commit that referenced this issue Aug 10, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- Get/SetOption
- error_details (#755)
- GetStatistics (#685)
- New ingest modes (#541)
lidavidm added a commit that referenced this issue Aug 10, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- error_details (#755)
- GetStatistics (#685)
lidavidm added a commit that referenced this issue Aug 10, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- Cancellation
- Get/SetOption
- New ingest modes
lidavidm added a commit that referenced this issue Aug 28, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- Get/SetOption
- error_details (#755)
- GetStatistics (#685)
- New ingest modes (#541)
lidavidm added a commit that referenced this issue Aug 28, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- error_details (#755)
- GetStatistics (#685)
lidavidm added a commit that referenced this issue Aug 28, 2023
- ADBC_INFO_DRIVER_ADBC_VERSION
- StatementExecuteSchema (#318)
- ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (#319)
- Cancellation
- Get/SetOption
- New ingest modes
lidavidm added a commit that referenced this issue Aug 28, 2023
Fixes #55.
Fixes #317.
Fixes #318.
Fixes #319.
Fixes #442.
Fixes #458.
Fixes #459.
Fixes #541.
Fixes #620.
Fixes #685.
Fixes #736.
Fixes #755.
Fixes #939.
Fixes #940.
Fixes #942.
Fixes #962.

---------

Co-authored-by: Matt Topol <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Will Jones <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants