Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database Error in snapshot ts_snapshot #29

Open
alberttwong opened this issue Mar 12, 2024 · 2 comments
Open

Database Error in snapshot ts_snapshot #29

alberttwong opened this issue Mar 12, 2024 · 2 comments
Assignees

Comments

@alberttwong
Copy link
Contributor

Invoking dbt with ['snapshot', '--vars', 'seed_name: added']
21:41:14  Running with dbt=1.6.2
21:41:14  Registered adapter: starrocks=1.4.2
21:41:14  Unable to do partial parsing because config vars, config profile, or config target have changed
21:41:14  Found 1 snapshot, 3 seeds, 0 sources, 0 exposures, 0 metrics, 335 macros, 0 groups, 0 semantic models
21:41:14  
21:41:14  Concurrency: 1 threads (target='default')
21:41:14  
21:41:14  1 of 1 START snapshot test17102796730728107077_test_basic.ts_snapshot .......... [RUN]
21:41:15  1 of 1 ERROR snapshotting test17102796730728107077_test_basic.ts_snapshot ...... [ERROR in 0.31s]
21:41:15  
21:41:15  Finished running 1 snapshot in 0 hours 0 minutes and 0.37 seconds (0.37s).
21:41:15  
21:41:15  Completed with 1 error and 0 warnings:
21:41:15  
21:41:15    Database Error in snapshot ts_snapshot (snapshots/ts_snapshot.sql)
  1064 (HY000): Getting syntax error at line 3, column 68. Detail message: Unexpected input ',', the most similar input is {'SET'}.
  compiled Code at target/run/snapshot_strategy_timestamp/snapshots/ts_snapshot.sql
21:41:15  
21:41:15  Done. PASS=0 WARN=0 ERROR=1 SKIP=0 TOTAL=1
@alberttwong
Copy link
Contributor Author

          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'}.

@alberttwong
Copy link
Contributor Author

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 %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants