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

Support persisting documentation #31

Open
james-johnston-thumbtack opened this issue Jan 21, 2024 · 4 comments
Open

Support persisting documentation #31

james-johnston-thumbtack opened this issue Jan 21, 2024 · 4 comments

Comments

@james-johnston-thumbtack

RisingWave supports COMMENT ON syntax, as documented here: https://docs.risingwave.com/docs/current/sql-comment-on/

However, if I set the persist_docs config like this, as documented at https://docs.getdbt.com/reference/resource-configs/persist_docs:

    +persist_docs:
      relation: true
      columns: true

Then dbt will fail with an error like this:

10:11:19  SQL status: CREATE_MATERIALIZED_VIEW in 8.0 seconds
10:11:19  Using risingwave connection "model.tt_rw_staging.stg_my_view.v1"
10:11:19  On model.tt_rw_staging.stg_my_view.v1: /* {"app": "dbt", "dbt_version": "1.6.9", "profile_name": "thumbtack_rw", "target_name": "local", "node_id": "model.tt_rw_staging.stg_my_view.v1"} */



  comment on materialized_view "thumbtack"."dbt_jamesjohnston_stg_business"."stg_my_view_v1" is $dbt_comment_literal_block$This is the description of my table
$dbt_comment_literal_block$;


10:11:19  Postgres adapter: Postgres error: Failed to run the query

Caused by:
  sql parser error: Expected comment object_type, found: materialized_view at line:5, column:31
Near "
  comment on materialized_view"

Obviously this is invalid SQL.... I'm guessing the feature is not supported yet.

Definitely a low-priority nice-to-have for me, since I'll also be looking at using the dbt documentation generator. But in the future it would be nice if anyone directly browsing the database can have these descriptions close at hand.

@morsapaes
Copy link

This is a bug in the dbt-postgres adapter (which this adapter shims). We fixed it a while back in our own adapter (dbt-materialize), but I just opened a PR to also fix it upstream: dbt-labs/dbt-postgres#98.

@neverchanje
Copy link
Contributor

@james-johnston-thumbtack
which dbt driver are you using for RW? dbt-risingwave or dbt-postgres?

@james-johnston-thumbtack
Copy link
Author

@neverchanje I was testing with the dbt-risingwave adapter.

@morsapaes
Copy link

The dbt-risingwave adapter inherits from dbt-postgres. What I meant is that once this is fixed in dbt-postgres, it'll just work for this adapter too.

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

3 participants