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: Incorrect SQL generation for materialized views with StarRocks 3.3.x #57

Open
beneo opened this issue Dec 5, 2024 · 0 comments
Open

Comments

@beneo
Copy link

beneo commented Dec 5, 2024

Description

When using dbt-starrocks 1.7.0 with StarRocks 3.3.x, the adapter generates incorrect SQL for materialized views, mixing DROP TABLE and CREATE MATERIALIZED VIEW syntax.

Environment

  • dbt-starrocks: 1.7.0
  • StarRocks: 3.3.x
  • Working fine with StarRocks 3.2.11-1.79-1.6.5

Steps to Reproduce
Create a dbt model with materialized view config:

{{
    config(
        materialized='materialized_view',
        comment='Example materialized view'        
    )
}}
SELECT * from {{ ref('source_table') }}

Run dbt

Current Behavior
The adapter generates incorrect SQL:

drop table if exists `schema`.`model_name` cascade;
create materialized view `schema`.`model_name` refresh manual
as
SELECT * from `schema`.`source_table`;
  1. SHOULD NOT DROP TABLE
  2. 'cascade' keyword not support in starrocks

Additional Context

This issue only occurs with StarRocks 3.3.x
Works correctly with StarRocks 3.2.11
The generated SQL mixes table and materialized view operations, which is incorrect syntax

Let me know if you need any additional information or clarification.

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

1 participant