I want to give alias to source tables in Dataform
I declare datasources as follow in .js file:
declaration({ database: "DATABASE_a", schema: "SCHEMA_a", name: "user", })
I want to give every data source an alias like finance_user so when I reference it in a query in Dataform as
SELECT * FROM ${ref("finance_user")}
instead of
SELECT * FROM ${ref("user")}
This for differentiating sources with similar names
I tried
declaration({ database: "DATABASE_a", schema: "SCHEMA_a", name: "user", alias: "finance_user })
-
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.Community– Community Bot2025年01月16日 10:53:17 +00:00Commented Jan 16, 2025 at 10:53
-
to clarify, In Dataform, source tables (Tables which is being used in models in dataform) need to be referenced in a way that allows dataform understand dependencies. I use the declaration method mentioned before where I created a js file for all data sources and used rhe previous code to declare each table What I'm asking about is if there is a way to give an alias to these source tables instead of calling them by their names like the feature that DBT currently offers or notHossam Mohamed Dergham– Hossam Mohamed Dergham2025年01月17日 20:53:20 +00:00Commented Jan 17, 2025 at 20:53