You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2022-09-15 17:57:11.594602 (Thread-4): On model.mart.DataMart__AzureAD__USERS:
SELECT
column_name,
data_type,
character_maximum_length,
numeric_precision,
numeric_scale
FROM
(select
ordinal_position,
column_name,
data_type,
character_maximum_length,
numeric_precision,
numeric_scale
from [DataMart].INFORMATION_SCHEMA.COLUMNS
where table_name = '#USERS__dbt_tmp'
and table_schema = 'AzureAD'
UNION ALL
select
ordinal_position,
column_name collate database_default,
data_type collate database_default,
character_maximum_length,
numeric_precision,
numeric_scale
from tempdb.INFORMATION_SCHEMA.COLUMNS
where table_name like '#USERS__dbt_tmp%') cols
order by ordinal_position
My issue is that I have a schema AzrueAD with a table Users and another Schema with a table Users so I get columns from the wrong table in the relation.
The text was updated successfully, but these errors were encountered:
visch
changed the title
get_columns_in_relation() returns wrong columns for Models with the same relation identifier (table) as other schemas
get_columns_in_relation() returns wrong columns for Temp Relations with the same relation identifier (table) as other schemas
Sep 19, 2022
visch
added a commit
to visch/dbt-sqlserver
that referenced
this issue
Sep 19, 2022
Ended up being a threading issue as we have multiple queries with a "Users" identifier being run. Lots of potential fixes, easiest I thought was to just give the Temp table a unique name PR is in
This sql comes from https://github.com/dbt-msft/dbt-sqlserver/blob/master/dbt/include/sqlserver/macros/adapters/columns.sql#L27
My issue is that I have a schema
AzrueAD
with a tableUsers
and another Schema with a tableUsers
so I get columns from the wrong table in the relation.The text was updated successfully, but these errors were encountered: