dev=> CREATE VIEW "dev"."public"."my_first_dbt_model" AS (
dev(> WITH source_data AS (
dev(> SELECT
dev(> 1 AS id
dev(> UNION ALL
dev(> SELECT
dev(> NULL AS id
dev(> )
dev(> SELECT
dev(> *
dev(> FROM
dev(> source_data
dev(> );
ERROR: QueryError: Invalid input syntax: UNION types INT32 of column id is different from types VARCHAR of column id
Essentially, it's because RW is unable to run the following query
select 1 as id union all select null as id;
The query compiler incorrectly recognizes null as varchar.
Reproduction step:
dbt init
dbt run
Essentially, it's because RW is unable to run the following query
The query compiler incorrectly recognizes null as varchar.