Skip to content

[Bug] dbt-doris extention cannot add comments to the columns #11

@SmiMi

Description

@SmiMi

Hello dbt and dbt-doris Teams,

Environment

  • dbt-core version: 1.5.10 (Latest: 1.7.9 - Update available!)
  • dbt-doris plugin version: 0.3.4 (Not compatible!)
  • Doris version: doris-2.1.5-rc02
  • Python version: 3.9.13

Issue Description

During my modeling process with dbt-doris, I found that I cannot add comments to the columns of a table. Neither the column description in the YAML file nor using a post-hook to execute the ALTER TABLE statement can add comments to the table columns. However, the table description in the YAML file can successfully add a comment to the table.

Below are my YAML and SQL files:

dim_test_after.yml:

 ---
version: 2
models:
- name: "dim_test_after"
  description: "aaaa"
  config:
    contract:
      enforced: false
  columns:
  - name: "customer_code"
    description: "customer code"
    data_type: "varchar"
    constraints: []
  - name: "id"
    description: "customer id"
    data_type: "varchar"
    constraints: []
  - name: "customer_name"
    description: "customer name"
    data_type: "varchar"
    constraints: []

dim_test_after.sql

{{config(
post_hook=[
"ALTER TABLE dim_test_after
MODIFY COLUMN customer_code  COMMENT 'customer code',
MODIFY COLUMN id  COMMENT 'customer id',
MODIFY COLUMN customer_name  COMMENT 'customer name'"],
materialized='table',
)
}}
with middle_steo as (
select 1)
select customer_code, id,customer_name from dim_customer

Below is the log of the successful execution.

{
  "exitCode": 0,
  "output": "10:10:51  Running with dbt=1.5.10
10:10:52  Registered adapter: doris=0.3.4
10:10:52  Found 8 models, 0 tests, 0 snapshots, 0 analyses, 328 macros, 0 operations, 0 seed files, 19 sources, 0 exposures, 0 metrics, 0 groups
10:10:52  
10:10:52  Concurrency: 4 threads (target='fat')
10:10:52  
10:10:52  1 of 1 START sql table model bigdata.dim_test_after ............................ [RUN]
10:10:52  1 of 1 OK created sql table model bigdata.dim_test_after ....................... [351 rows affected in 0.65s]
10:10:53  
10:10:53  Finished running 1 table model in 0 hours 0 minutes and 0.83 seconds (0.83s).
10:10:53  
10:10:53  Completed successfully
10:10:53  
10:10:53  Done. PASS=1 WARN=0 ERROR=0 SKIP=0 TOTAL=1
Command exited with return code 0"
}

But even though the execution was successful, the table columns still do not have comments, while the comment for the table itself was added successfully.

Thank you for your support and assistance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions