Repository navigation
[Bug] DuckDB endpoint_type is validated but never emitted into ATTACH, breaking Glue and S3 Tables #15725
Description
Rewritten 2026-07-29. The first version of this issue was written against a stale checkout and framed the problem as Glue-specific auth defaulting. Re-verified against
main: the actual defect is broader and simpler —endpoint_typeis accepted by the schema and then silently discarded. That breaks both Glue and S3 Tables.
Summary
config.duckdb.endpoint_type (GLUE | S3_TABLES) is fully validated by the catalogs.yml v2 schema but is never emitted into the ATTACH statement. A user's catalog configuration is accepted and then dropped, producing an ATTACH that cannot connect to the intended catalog.
Evidence
The schema validates it. crates/dbt-schemas/src/schemas/dbt_catalogs_v2.rs:
const DUCKDB_ENDPOINT_TYPES: &[&str] = &["GLUE", "S3_TABLES"];endpointandendpoint_typeare mutually exclusive, and exactly one is requiredendpoint_type: S3_TABLESadditionally requireswarehouseauthorization_typecannot be combined withendpoint_type
The attach builder never emits it. build_duckdb_catalog_attach_stmt in crates/dbt-adapter/src/engine/duckdb_attach.rs emits ENDPOINT when endpoint is set, and there is no ENDPOINT_TYPE branch anywhere in the crate — git grep ENDPOINT_TYPE over crates/**/*.rs returns only the schema and an unrelated dbt-auth BigQuery constant.
Net effect for the documented Glue shortcut. Configuring endpoint_type: GLUE:
- passes validation,
- forbids you from setting
authorization_typeyourself, - produces an ATTACH with no
ENDPOINT, noENDPOINT_TYPE, and noAUTHORIZATION_TYPE.
DuckDB then falls back to its own defaults (oauth2), which is wrong for Glue. The schema actively prevents the user from working around it.
This is a regression
ENDPOINT_TYPE emission was added by #9727 and removed when the part 1 catalogs stack landed (dfe9a517c), while the schema-side validation was kept. The Glue attach fixtures (glue_minimal, glue_with_secret_and_endpoint_type, multi_catalog_glue_plus_iceberg_rest) were deleted in the same change — there is no Glue fixture anywhere on main today, which is why no test caught it.
catalog_attach_defaults presets write-compat options for Horizon and Unity only (_ => &[]), so Glue also receives no AUTHORIZATION_TYPE 'SIGV4' default.
Secondary: endpoint scheme handling
endpoint is interpolated verbatim:
opts.push(format!("ENDPOINT '{}'", escape_string_literal(ep, AdapterType::DuckDB)));DuckDB's iceberg extension prepends its own scheme, so a value written as a "full URL" (https://glue.us-east-1.amazonaws.com/iceberg) yields https://https://…. The field's own doc string says "Full REST catalog URL", so docs and behavior disagree. Either normalize the scheme or document a bare host.
Fix
- Emit
ENDPOINT_TYPE '<value>'whenendpoint_typeis set - Give
Glueacatalog_attach_defaultsentry withAUTHORIZATION_TYPE 'SIGV4'(and confirm whatS3_TABLESneeds — SigV4 with thes3tablessigning name) - Restore Glue attach fixtures, and add an
endpoint_type: S3_TABLESfixture, so emission is snapshot-tested — validation-only tests did not catch this - Normalize or document
endpointscheme handling - Re-check whether the
authorization_type×endpoint_typeexclusivity rule is still the contract we want once emission works
Currently-working configuration
Sidesteps endpoint_type entirely:
catalogs:
- name: glue_cld
type: iceberg_rest
table_format: iceberg
config:
duckdb:
endpoint: "glue.{{ env_var('AWS_REGION', 'us-east-1') }}.amazonaws.com/iceberg" # NO scheme
warehouse: "{{ env_var('DBT_GLUE_CATALOG_ID') }}" # AWS account id == Glue catalog id
authorization_type: SIGV4
secret: glue_s3Blocks
- Support Amazon S3 Tables catalog (DuckDB Iceberg REST) #15267 — Amazon S3 Tables cannot attach until
endpoint_typeis emitted - AWS Glue Iceberg REST catalog: full DuckDB write support #15268 — AWS Glue writes; Glue cannot attach at all today, so reads must be fixed first
Parent: #15265
Activity
[-][Bug] DuckDB `type: glue` is half-supported: documented `endpoint_type: GLUE` path always fails[/-][+][Bug] DuckDB `endpoint_type` is validated but never emitted into ATTACH, breaking Glue and S3 Tables[/+]dataders commentedon Oct 8, 2026
This looks fixed on main: DuckDB
endpoint_type(GLUE/S3_TABLES) is now validated and emitted into ATTACH, with ans3_tables_endpoint_typefixture. Leaving open for a maintainer to verify and close.VersusFacit commentedon Oct 23, 2026
Shipped a fix for this in the backend