Skip to content

Commit d990549

Browse files
Add: Schema-qualified table names in Bruin
Closes #214
1 parent fa31632 commit d990549

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
id: 8ef4012c69
3+
question: Why do downstream Bruin assets fail with 'Table does not exist' error even
4+
though the upstream ingestion asset succeeded?
5+
sort_order: 5
6+
---
7+
8+
Bruin creates tables inside schemas (for example ingestion, staging, reports). If you reference a table without its schema, DuckDB will not find it and will raise a “Table does not exist” error, even if the upstream ingestion asset ran successfully. Always use schema-qualified names in downstream assets. You can verify existing tables with:
9+
10+
```bash
11+
bruin query -c duckdb-default -q "SELECT table_schema, table_name FROM information_schema.tables;"
12+
```
13+
14+
Example of the pitfall and the fix:
15+
16+
```
17+
-- This will fail if the table was created as ingestion.trips_raw
18+
SELECT * FROM trips_raw;
19+
20+
-- Correct:
21+
SELECT * FROM ingestion.trips_raw;
22+
```
23+
24+
Notes:
25+
- Always reference the fully-qualified table name that the upstream asset created (e.g., ingestion.trips_raw, staging.orders, reports.sales_summary).
26+
- If you’re unsure which schema a table lives in, list tables with the command above and inspect the schema column.
27+
- Consider using explicit schema qualification in all downstream assets to prevent these errors.

0 commit comments

Comments
 (0)