Summary
When using dbt-duckdb with an ATTACH-based Iceberg REST catalog (e.g. Apache Polaris), the OpenLineage dataset namespace is derived from the local DuckDB file path (duckdb:///tmp/my_db.duckdb) rather than from the attached catalog endpoint URI.
The adapter knows the Iceberg endpoint for each ATTACH alias, but this information is not surfaced to OpenLineage integrations (e.g. openlineage-dbt), which fall back to the DuckDB file path as the namespace.
Profile configuration
local_runtime:
type: duckdb
path: "/tmp/openlakeforge-sales-dbt.duckdb"
attach:
- path: "sales_dev"
alias: sales_dev
options:
type: iceberg
endpoint: "http://polaris:8181/api/catalog"
dbt_project.yml
models:
my_project:
+database: sales_dev # matches the ATTACH alias
+schema: gold
+materialized: iceberg_table
Actual OL dataset emitted by openlineage-dbt
{
"namespace": "duckdb:///tmp/openlakeforge-sales-dbt.duckdb",
"name": "sales_dev.gold.mart_revenue_by_product"
}
Expected OL dataset
{
"namespace": "http://polaris:8181/api/catalog",
"name": "sales_dev.gold.mart_revenue_by_product"
}
Because the namespace does not match any registered catalog service (e.g. in OpenMetadata), the lineage edge is silently dropped even though the dataset name itself is correct.
Root cause
openlineage-dbt calls into the dbt adapter to determine the dataset namespace. For dbt-duckdb, it reads credentials.path (the local DuckDB file). The ATTACH endpoint — which is the authoritative catalog URI for any model whose database matches the alias — is not exposed through any standard dbt adapter interface.
Proposed fix
dbt-duckdb should expose the ATTACH catalog endpoint for OpenLineage-aware integrations. Two possible approaches:
Option A — dispatch macro
Implement a dbt_duckdb__get_openlineage_dataset_namespace(relation) dispatch macro that, for a given relation, checks if relation.database matches an ATTACH alias with options.type: iceberg, and returns options.endpoint if so.
Option B — connection metadata
Expose an ATTACH alias → endpoint mapping on the connection credentials object so that openlineage-dbt (or any other OL integration) can look up the correct namespace from the adapter's credentials.
Environment
- dbt-duckdb 1.9.6
- dbt-core 1.9.x
- openlineage-dbt 1.16
- Apache Polaris 1.0.0
- OpenMetadata 1.12.10
- Kubernetes (local kind cluster)
Summary
When using
dbt-duckdbwith anATTACH-based Iceberg REST catalog (e.g. Apache Polaris), the OpenLineage dataset namespace is derived from the local DuckDB filepath(duckdb:///tmp/my_db.duckdb) rather than from the attached catalog endpoint URI.The adapter knows the Iceberg endpoint for each ATTACH alias, but this information is not surfaced to OpenLineage integrations (e.g.
openlineage-dbt), which fall back to the DuckDB file path as the namespace.Profile configuration
dbt_project.yml
Actual OL dataset emitted by openlineage-dbt
{ "namespace": "duckdb:///tmp/openlakeforge-sales-dbt.duckdb", "name": "sales_dev.gold.mart_revenue_by_product" }Expected OL dataset
{ "namespace": "http://polaris:8181/api/catalog", "name": "sales_dev.gold.mart_revenue_by_product" }Because the namespace does not match any registered catalog service (e.g. in OpenMetadata), the lineage edge is silently dropped even though the dataset
nameitself is correct.Root cause
openlineage-dbtcalls into the dbt adapter to determine the dataset namespace. Fordbt-duckdb, it readscredentials.path(the local DuckDB file). The ATTACH endpoint — which is the authoritative catalog URI for any model whosedatabasematches the alias — is not exposed through any standard dbt adapter interface.Proposed fix
dbt-duckdbshould expose the ATTACH catalog endpoint for OpenLineage-aware integrations. Two possible approaches:Option A — dispatch macro
Implement a
dbt_duckdb__get_openlineage_dataset_namespace(relation)dispatch macro that, for a given relation, checks ifrelation.databasematches an ATTACH alias withoptions.type: iceberg, and returnsoptions.endpointif so.Option B — connection metadata
Expose an ATTACH alias → endpoint mapping on the connection credentials object so that
openlineage-dbt(or any other OL integration) can look up the correct namespace from the adapter's credentials.Environment