Skip to content

dbt_utils package union_relations not working with Trino #35

Closed
@mdesmet

Description

In our project we make extensive use of the dbt_utils library. the dbt_utils.union_relations doesn't work because it generates invalid sql

create table "dataproduct_levenslangleren"."zone_levenslangleren"."levenslang_leren__dbt_tmp"
    
  as (
    

        (
            select

                cast('"dataproduct_levenslangleren"."zone_levenslangleren"."levenslang_leren_ho"' as 
    string
) as _dbt_source_relation,
                
                    cast("laadoperatie" as character varying(256)) as "laadoperatie" ,
                    cast("record max laadoperatie" as character varying(256)) as "record max laadoperatie" ,

Two issues here:

This requires the adapter to provide specific implementation if the default ('string') is not supported:

{% macro trino__type_string() %}
    varchar
{% endmacro %}

Will post PR shortly.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions