-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Column and table comments for postgres/redshift (#2333) #2378
Conversation
2d8f93a
to
d4ba35f
Compare
- add some table comment framework stuff - have redshift/postgres catalogs include table comments - have redshift/postgres add comments to columns/tables/views - push some bigquery-specific formatting into bigquery - add tests for table comments
…se it - also fixed the default incremental to include that it is creating a table
d4ba35f
to
c6603be
Compare
I didn't think about this at all! That's kind of a big problem IMO. We're overdue for a rethink on how materializations work (especially w/r/t these Reviewing this one now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM! The one thing that gives me pause is the change to the Redshift catalog query, but I tested it locally and it appeared to work well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great example to pull from @dbeatty10
resolves #2333
Description
This is very much based off the work being done by @snowflakeseitz in #2321
I intentionally copy+pasted the common
adapter_macro
s to make merging easier.With this PR, redshift and postgres now generate column and table comments during view and table creation. Their get_catalog macros also now include those comments in the output (instead of null) and the end up in the catalog itself.
I added tests as well, of course!
Redshift is a little special:
One annoying/weird quirk we might need to think about: When you do have comments, results lines show up as
COMMENT in XXXs
instead ofCREATE TABLE in XXXs
. That's a little goofy! Maybe comments should work like hooks do.Checklist
CHANGELOG.md
and added information about my change to the "dbt next" section.