Skip to content

Bug: Incorrect SQL generation for materialized views with StarRocks 3.3.x #57

@beneo

Description

@beneo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions