The problem I’m having
I have the same problem, which is described here:
but, I don’t know how to solve this, the solution description is too brief.
Full-refresh of the model and incremental run with new data works fine, but incremental run without new data returns error:
Syntax error: Expected “)” but got keyword AND at [26:5]
My model properties
{{
config(
materialized='incremental',
unique_key='event_natural_key',
partition_by = {
'field': 'event_ts',
'data_type': 'timestamp',
"granularity": 'day'
},
upsert_date_key='start_tstamp',
sort='start_tstamp',
dist='event_id',
snowplow_optimize=true,
tags=['snowplow_unified_incremental'],
on_schema_change='sync_all_columns'
)
}}
with base as (
select * from {{ ref('snowplow_unified','snowplow_unified_base_events_this_run') }}
{% if is_incremental() %}
and collector_tstamp > (select coalesce(max(event_collector_ts), timestamp('2000-01-01')) from {{ this }})
{% endif %}
),