Conversation
Fills the two execution-layer `todo!("Athena")` sites so that commands
which construct a metadata adapter (`show`, `compile`, `run`) no longer
panic at `adapter_impl.rs` / `get_relation.rs`.
Athena is Trino over the Glue catalog, so every metadata read is a query
against `information_schema` over the ADBC connection, modelled on the
Exasol adapter:
- `list_relations_schemas_inner`: zero-row probe (`select * from x where
false limit 0`); Athena returns ResultSetMetadata for empty results, which
the driver maps to an Arrow schema.
- `list_relations_in_parallel_inner` + `athena::list_relations`: cache
hydration over `information_schema.tables` (`BASE TABLE` / `VIEW`); a
missing schema yields zero rows, not an error. `AdapterImpl::list_relations`
now dispatches Athena here instead of the "not implemented" group, so
`adapter.list_relations_without_caching` in the vendored macros works.
- `athena_get_relation`: single-row `information_schema.tables` lookup.
- `build_schemas_from_stats_sql` / `build_columns_from_get_columns`:
`information_schema`-shaped batch; `column_index` is Trino's bigint
`ordinal_position`.
- Metadata-based freshness and pattern listing return `NotSupported`, as
Exasol does. Glue exposes no last-altered timestamp via
`information_schema`.
Identifier literals are lowercased on both sides: Athena folds every
identifier, quoted or not, and Glue stores names lowercased.
`dbt-init/profile_setup.rs` (`dbt init` scaffolding) is the only
`todo!("Athena")` left.
This was referenced Sep 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #16252. Related: #13822. Independent PR; the sequence is at the bottom.
Problem
dbt show,compileandrunconstruct aMetadataAdapter; for Athena that arm istodo!()and the process panics.get_relationhas the sametodo!().Solution
AthenaMetadataAdapter, shaped afterExasolMetadataAdapter: every method is SQL overinformation_schemathrough the ADBC connection (tablesfor relations and types,columnsfor schemas,schematafor schema listing). No Glue API.athena_get_relation: Athena lowercases every identifier, quoted or not, so the lookup is case-insensitive on both sides;table_typemapsBASE TABLE/VIEW; a missing schema yields zero rows, not an error.AdapterImpl::list_relations, leaving the grouped "unsupported" arm.list_schemasreceives the database already quoted; the SQL strips it.Verification
cargo fmt --check,cargo clippy -p dbt-adapter --all-targets --all-features,cargo nextest run -p dbt-adapter -E 'test(athena)'on the pinned toolchain: the unit tests cover the literal escaping and thetable_typemapping.dbt show --inline 'select 1 as n'returns one row;dbt showon an incremental model returns real rows;dbt compileon that model logs theinformation_schema.tableshydration query, evaluatesis_incremental()to true and renders the merge watermark query.Feedback wanted:
information_schemaqueries vs. driver metadata calls once the driver exposes them; this PR chose SQL to stay driver-version independent.Sequence (independent PRs, each compiles alone against main)
table/incrementalhelpers (athena/parts-6-7-execution); see also feat(athena): Part 6 — AthenaAdapter methods behind the dbt-athena macros #16376Checklist