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] dbt-doris extention cannot add comments to the columns #45873

Open
3 tasks done
SmiMi opened this issue Dec 24, 2024 · 0 comments
Open
3 tasks done

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

SmiMi opened this issue Dec 24, 2024 · 0 comments

Comments

@SmiMi
Copy link

SmiMi commented Dec 24, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Version

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

What's Wrong?

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.

What You Expected?

I expect the post-hook or the column description in the YML to take effect, so that the table columns can have comments.

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@SmiMi SmiMi changed the title [Bug] dbt-doris extention does not execute post_hook [Bug] dbt-doris extention cannot add comments to the columns Dec 24, 2024
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