The problem I’m having
I have a model that will Preview, Compile and Build. It has the desired impact in my Redshift environment when running the the IDE interface.
When I schedule this same model as a JOB, it gets the error below at the invoke stage.
ERROR creating sql table model dbt_jtonn.base_node_relationships
ERROR creating sql table model dbt_jtonn.stg_nodes
The Redshift userid used is a superuser, so I doubt this is about permissions.
The job does successfully create these below tables for dbt, so it does seem to have the ability to operate within the Redshift schema. That Redshift schema is owned by the superuser used to run the dbt model.
base_exposure_relationships
base_metric_relationships
dbt_project_evaluator_exceptions
stg_exposures
stg_metrics
stg_naming_convention_folders
stg_naming_convention_prefixes
stg_sources
The context of why I’m trying to do this
I am just teaching myself dbt, so …
What I’ve already tried
Some example code or error messages
{{ config(materialized='incremental') }}
select
*
from stl_query
{% if is_incremental() %}
-- this filter will only be applied on an incremental run
-- (uses > to include records whose timestamp occurred since the last run of this model)
where starttime >= current_date - 1
{% endif %}
Put code inside backticks
to preserve indentation
which is especially important
for Python and YAML!