risingwavelabs / dbt-risingwave

Apache License 2.0
21 stars 6 forks source link

failed to run the scaffold project generated by `dbt init` #6

Closed neverchanje closed 1 year ago

neverchanje commented 1 year ago

Reproduction step:

  1. dbt init
  2. dbt run
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.

neverchanje commented 1 year ago

https://github.com/risingwavelabs/risingwave/pull/11452/ It looks like this PR has resolved the issue.