Open alberttwong opened 6 months ago
update `test17102808078784722010_test_basic`.`ts_snapshot`, (select dbt_scd_id, dbt_change_type, dbt_valid_to from `test17102808078784722010_test_basic`.`ts_snapshot__dbt_tmp`) as DBT_INTERNAL_SOURCE
set `test17102808078784722010_test_basic`.`ts_snapshot`.dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to
where DBT_INTERNAL_SOURCE.dbt_scd_id = `test17102808078784722010_test_basic`.`ts_snapshot`.dbt_scd_id
and DBT_INTERNAL_SOURCE.dbt_change_type = 'update'
and `test17102808078784722010_test_basic`.`ts_snapshot`.dbt_valid_to is null
22:00:13 starrocks adapter: StarRocks error: 1064 (HY000): Getting syntax error at line 3, column 68. Detail message: Unexpected input ',', the most similar input is {'SET'}.
I don't know how to rewrite this macro
{% macro starrocks__snapshot_merge_sql_update(target, source, insert_cols) -%}
update {{ target }}, (select dbt_scd_id, dbt_change_type, dbt_valid_to from {{ source }}) as DBT_INTERNAL_SOURCE
set {{ target }}.dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to
where DBT_INTERNAL_SOURCE.dbt_scd_id = {{ target }}.dbt_scd_id
and DBT_INTERNAL_SOURCE.dbt_change_type = 'update'
and {{ target }}.dbt_valid_to is null
{% endmacro %}