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

standard_hub.Business_Key_Physical_Name can't rename a column #29

Open
universe-designer opened this issue May 2, 2024 · 3 comments
Open

Comments

@universe-designer
Copy link
Contributor

Currently for standard_hub table: "Source_Column_Physical_Name" and "Business_Key_Physical_Name" must be equal if is_Primary_Source = 1.

It is NOT possible to use "Business_Key_Physical_Name" to define the business key column name in the final hub table. If the names differ Datavault4dbt can't find the column name, as it expect it in the stage model.

It is important to rename columns in the data warehouse e. g. if you want to change the language or have a different notation.

@universe-designer
Copy link
Contributor Author

universe-designer commented May 23, 2024

Today I learned about derived columns in datavault4dbt.

In the future the turbovault4dbt column "standard_hub.Business_Key_Physical_Name"
should create the derived column in stage. The renamed column already appears correctly in sources and in the hub definition.

@universe-designer
Copy link
Contributor Author

Here is an example. Let's say you want to rename the column

In turvovault4dbt table "standard_hub" you would have

Source_Column_Physical_Name | Business_Key_Physical_Name
Customer_NR | CUST_BK

Therefore you must add the following code to the stage yml file as follows:

derived_columns:
    CUST_BK:
        value: Customer_NR
        src_cols_required: Customer_NR

Turvovault4dbt doesn't do this yet.

@universe-designer
Copy link
Contributor Author

I added this feature in my local branch and will publish it in the near future.

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