diff --git a/website/docs/reference/commands/build.md b/website/docs/reference/commands/build.md index ae5e5805c31..c7ac29862c2 100644 --- a/website/docs/reference/commands/build.md +++ b/website/docs/reference/commands/build.md @@ -31,6 +31,32 @@ In DAG order, for selected resources or an entire project. The `build` command supports the `--empty` flag for building schema-only dry runs. The `--empty` flag limits the refs and sources to zero rows. dbt will still execute the model SQL against the target data warehouse but will avoid expensive reads of input data. This validates dependencies and ensures your models will build properly. +#### SQL compilation error when running the `--empty` flag on a model + +If you encounter the error: `SQL compilation error: syntax error line 1 at position 21 unexpected '('.` when running a model with the `--empty` flag, explicitly call the `.render()` method on that relation. + + + + +```Jinja + +-- models/staging/stg_sys__customers.sql +{{ config( + pre_hook = [ + "alter external table {{ source('sys', 'customers').render() }} refresh" + ] +) }} + +with cus as ( + select * from {{ source("sys", "customers") }} -- leave this as is! +) + +select * from cus + +``` + + + ## Tests