Commit b3a2a9d
fix(redshift): detect existing DWH schema via svv_all_schemas (SCS-1193) (#2789)
The Diagnostics Warehouse existence check queried information_schema.schemata, which on Redshift only lists schemas the current user OWNS. A pre-provisioned DWH schema the service user merely has USAGE/CREATE on was therefore invisible, so Soda issued CREATE SCHEMA -- which needs CREATE-on-database and failed with 'permission denied for database' even though the schema already existed.
Override the schemas metadata query on Redshift to use pg_catalog.svv_all_schemas (visible by access, not ownership), matching the existing svv_tables/svv_columns overrides. Base dialect behaviour is unchanged via a new build_schemas_metadata_from_clause() hook.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent ddc39ec commit b3a2a9d
3 files changed
Lines changed: 51 additions & 3 deletions
File tree
- soda-core/src/soda_core/common
- soda-redshift
- src/soda_redshift/common/data_sources
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1576 | 1576 | | |
1577 | 1577 | | |
1578 | 1578 | | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
1579 | 1590 | | |
1580 | 1591 | | |
1581 | 1592 | | |
| |||
1587 | 1598 | | |
1588 | 1599 | | |
1589 | 1600 | | |
1590 | | - | |
1591 | | - | |
1592 | 1601 | | |
1593 | 1602 | | |
1594 | | - | |
| 1603 | + | |
1595 | 1604 | | |
1596 | 1605 | | |
1597 | 1606 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
11 | 33 | | |
12 | 34 | | |
13 | 35 | | |
| |||
0 commit comments