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

bug fix #180

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
{% elif existing_relation.can_exchange %}
-- We can do an atomic exchange, so no need for an intermediate
{% call statement('main') -%}
{% do run_query(create_empty_table_from_relation(backup_relation, view_relation)) or '' %}
{{ create_empty_table_from_relation(backup_relation, view_relation) }}
{%- endcall %}
{% do exchange_tables_atomic(backup_relation, existing_relation) %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, we should modify exchange_tables_atomic for distributed tables. In my case(#179), the SYSTEM SYNC REPLICA on the distributed table bugged.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the error message with the actual version.

  ...
�[0m12:10:06.320142 [debug] [Thread-1  ]: dbt_clickhouse adapter: Error running SQL: /* {"app": "dbt", "dbt_version": "1.4.6", "profile_name": "stage", "target_name": "clickhouse_stage", "node_id": "model.dbt_prototype_version.event"} */

    SYSTEM SYNC REPLICA 
  
    
    ON CLUSTER "default" default_db_test_dbt.event
  
�[0m12:10:06.321265 [debug] [Thread-1  ]: Timing info for model.dbt_prototype_version.event (execute): 2023-08-18 12:10:05.375159 => 2023-08-18 12:10:06.321126
�[0m12:10:06.364239 [debug] [Thread-1  ]: Database Error in model event (models/event.sql)
  Code: 36.
  DB::Exception: There was an error on [clickhouse-server..........]: Code: 36. DB::Exception: Table default_db_test_dbt.event (zzzzzzzz.............zzzzzzzz) is not replicated. (BAD_ARGUMENTS) (version 23.3.1.2823 (official build)). Stack trace:
  

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work. IMO this is not only a bug for distributed_table materialization but for every other materialization using exchange_tables_atomic macro with cluster setting.

I will commit the change with more fixes.

{% else %}
Expand Down