Skip to content

Build fails for microbatch models with sql is undefined error #1883

@irtizaN

Description

@irtizaN

Description

Using the extension's build button on a microbatch incremental model fails with a
materialization error. Running dbt build --select <model_name> from the terminal
using dbt Cloud CLI works correctly.

Error

dbt1501: Error executing materialization macro
'dbt_databricks.materialization_incremental_databricks' for microbatch
model: Failed to eval the compiled Jinja expression invalid operation:
argument 'sql' to clean_sql() has incompatible type undefined; value is
not a string
(in compiled/models/millom/gold/<model_name>.sql:1:15)
(in dbt_internal_packages/dbt-databricks/macros/materializations/incremental/incremental.sql:22:33)

Environment

  • Extension version: latest
  • dbt binary used by extension: dbt-fusion 2.0.0-preview.164 (/Users//.local/bin/dbt)
  • dbt Cloud CLI (terminal): 0.40.15
  • Adapter: dbt-databricks
  • OS: macOS

Steps to reproduce

  1. Open a model configured with incremental_strategy='microbatch'
  2. Click the build button in the extension
  3. Error is thrown; build fails

Expected behaviour

Extension build button runs microbatch models successfully, consistent with
dbt build --select <model_name> from the terminal.

Workaround

Run dbt build --select <model_name> directly from the terminal using dbt Cloud CLI.

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