Skip to content

[Bug] Oracle error: ORA-00904: "COLUMN": invalid ID #195

@kriced-netcologne

Description

@kriced-netcologne

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I added a new column to my staging model ("TEST") and ran my downstream snapshot model with explicit check strategy - not including the new "TEST" column.
During my snapshot run, the adapter tries to call default__create_columns() which fails for Oracle syntax.
This is due to the "column" keyword and the trailing semicolon in the invoked statement.

Proposed fix (also works temporarily by overwriting with dispatch):

{% macro oracle__create_columns(relation, columns) %}
  {% for column in columns %}
    {% call statement() %}
      alter table {{ relation }} add "{{ column.name }}" {{ column.data_type }}
    {% endcall %}
  {% endfor %}
{% endmacro %}

Expected Behavior

  1. Alter table, add new column to snapshot table
  2. Apply snapshot strategy

Steps To Reproduce

No response

Relevant log output using --debug flag enabled

Environment

- OS: Windows
- Python: 3.11.9
- dbt: 1.10.13

What Oracle database version are you using dbt with?

19

Additional Context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions