Skip to content

Error in incremental model using a field name called location #192

@YiftachLevy

Description

@YiftachLevy

We have an incremental model with a filed name that called location.
It seems to be a reserved name in impala so we create the table with the following command:

,cast(s.`location` as string) `location`

This seems to work in impala but it fails in dbt while using incremental model because dbt an insert creates a script which use location without the quotes.

error:

11:58:34    Encountered: LOCATION
11:58:34    Expected: DEFAULT, IDENTIFIER
11:58:34    
11:58:34    CAUSED BY: Exception: Syntax error

Example from the compiled code

insert into table_name (location)
(select location from table_name__dbt_tmp)

Versions:
dbt-core 1.4.9
dbt-impala 1.4.0

Metadata

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