Skip to content

feat(athena): Part 0 — map Backend::Athena to its driver entrypoint and send the driver's output-location option - #16365

Open
aoelvp94 wants to merge 3 commits into
dbt-labs:mainfrom
aoelvp94:athena/part-0-adbc-driver
Open

aoelvp94 wants to merge 3 commits into
dbt-labs:mainfrom
aoelvp94:athena/part-0-adbc-driver

Conversation

@aoelvp94

@aoelvp94 aoelvp94 commented Sep 18, 2026 •

Copy link
Copy Markdown

Part of #16252. Related: #13822. Independent PR; the sequence is at the bottom.

Problem

Two gaps between dbt-adbc and the dbt-labs/athena Go driver:

  1. Backend::Athena has no explicit entrypoint mapping. The driver manager derives AdbcAthenaInit from the filename, which happens to work, but every other backend maps its Adbc<Name>Init symbol explicitly (Snowflake precedent) and the derived form breaks if the library is ever renamed.
  2. Fusion sends the query-result location as athena.s3_staging_dir. The driver reads athena.output_location (go/driver.go), so the profile's s3_staging_dir never reached it and every query failed on a missing output location.

Solution

  • driver.rs: Backend::Athena => "AdbcDriverAthenaInit" next to the other explicit mappings.
  • athena.rs: one constant renamed so the option key matches the driver. The other nine option keys already match.

No behaviour change for any other backend. Per .agents/adapters.md, dbt-adbc takes no new functionality; this touches only an option-key constant and one entry in the existing entrypoint map.

Verification

With driver v0.1.0 built from dbt-labs/athena (cd go/pkg && make) and placed under lib/ next to the binary, dbt debug on an athena profile loads the driver and completes the connection test. Before this change it failed with a missing output location.

cargo fmt --check, cargo clippy -p dbt-adbc --all-targets --all-features clean on the pinned toolchain.

Feedback wanted: whether the explicit entrypoint mapping is wanted at all, given the filename-derived one works.

Sequence (independent PRs, each compiles alone against main)

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes.

aoelvp94 and others added 3 commits September 18, 2026 12:22
adbc_driver_entrypoint() returned None for Athena. The ADBC driver
manager derives `Adbc<Name>Init` from the library name in that case, and
this was verified empirically: a binary WITHOUT this mapping found
target/release/lib/libadbc_driver_athena.dylib, initialized the driver,
and proceeded to option parsing. So the mapping is not required for the
load to succeed.

It is kept for the same reason Snowflake has an explicit
`SnowflakeDriverInit`: the symbol is a contract with a separately
released driver (github.com/dbt-labs/athena, generated with
`-prefix Athena`, which exports AdbcDriverAthenaInit and does NOT export
the generic AdbcDriverInit — confirmed with nm), and naming it here makes
that contract greppable rather than implicit in a filename convention.

An earlier version of this message claimed the load fails without the
mapping. That was wrong.

For the record, how the library is found on macOS arm64
(try_load_driver_from_name): linker defaults, then a `lib/` directory
found by climbing up to five levels from the executable's directory, then
/opt/homebrew/lib. `target/release/lib/libadbc_driver_athena.dylib` works
with no system directory and no environment variable — verified.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…location

The Fusion side sent `athena.s3_staging_dir`; the driver
(github.com/dbt-labs/athena, driver.go:39 `OptionOutputLocation`) accepts
`athena.output_location` and rejects the other with "Unknown database
option". Found by loading the locally built driver: the connection
attempt failed on this key before reaching AWS.

After this change the set of `athena.*` keys Fusion sends is identical to
the set the driver accepts (10/10, checked by grep on both trees).

The Rust constant keeps its name, S3_STAGING_DIR, because callers in
dbt-auth read it against the dbt profile field of that name; only the
wire value changes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@aoelvp94
aoelvp94 requested a review from a team as a code owner September 18, 2026 19:41
@cla-bot

cla-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.

CLA has not been signed by users: @aoelvp94

@aoelvp94

Copy link
Copy Markdown
Author

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.

CLA has not been signed by users: @aoelvp94

done, check

@aoelvp94

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla:yes label Sep 18, 2026
@cla-bot

cla-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant