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

Define column names #6140

Open
wants to merge 4 commits into
base: current
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions website/docs/docs/build/snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,16 @@ Snapshot results:

</details>

<VersionBlock firstVersion="1.9">

### Define column names in snapshot table
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the correct language.. something more like "customize the names of the dbt-generated meta fields in your snapshot tables"


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small sugg that's not a blocker: maybe have the header outside the versionblock and tell users on 1.8 and lower that this feature is only avail in 1.9 and higher or versionless so they know?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ we need to do this for all new features!

In [Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can now define the names of the columns created in the [snapshot table](/docs/build/snapshots#snapshot-meta-fields) using custom configurations. The original columns were named `dbt_valid_to`, `dbt_valid_from`, `dbt_scd_id`, and `dbt_updated_at`, however, users can now customize these names as needed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In [Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can now define the names of the columns created in the [snapshot table](/docs/build/snapshots#snapshot-meta-fields) using custom configurations. The original columns were named `dbt_valid_to`, `dbt_valid_from`, `dbt_scd_id`, and `dbt_updated_at`, however, users can now customize these names as needed.
In [Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can now customize the names of the meta columns created by dbt in the [snapshot table](/docs/build/snapshots#snapshot-meta-fields) using the `snapshot_meta_column_names` configuration.


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add an example?

Note, if you rename snapshot columns without updating the existing table, it will cause an error. It's recommended to use this feature for new snapshots or update your existing tables before committing a column name change.

nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
</VersionBlock>


## FAQs
<FAQ path="Runs/run-one-snapshot" />
Expand Down
Loading