You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have different types of files in my repo - .csv and .tpl and I want to run dbt seed command to load the data in snowflake.
When I run the command, it applies all the .csv files and ignores .tpl files.
How can I use dbt seed for other format data files?
Steps To Reproduce
In data folder, add few files with .csv format and some for .tpl
Run dbt seed command, it will apply csv files and igonors the tpl files
Expected behavior
I am looking to load data from different types of files instead of just from .csv
System information
Which database are you using dbt with?
snowflake
The output of dbt --version:
dbt=0.20.0-b1
The text was updated successfully, but these errors were encountered:
@JyotiSingh7 Thanks for opening, you're in good company (#2365).
I'm not familiar with .tpl-formatted data. (From what I see online, it's a way of storing template information, for web development?) Could you provide an example seed file you're looking to upload to the database? Or, better yet, a little more context for the specific use case you're after?
Hi @jtcohen6
Thanks for your response.
To give more context, I have a data folder which contains .csv & .tpl files. Eg:
File1.csv
File2.csv
File3.csv.tpl
File3.csv.tpl file looks like this:
CONFIG_KEY,CONFIG_VALUE,STATUS,DESCRIPTION
HostIP,{{ HOST_NAME }},Y,This is the APP VM Host Name/IP address.
SSHKeyFilePath,{{ SSH_KEY_PATH }},Y,This is the path on APP VM to the SSH key file for Login User
I want to replace the variables in my files during runtime and then seed all these files into my snowflake database. What is the best way to handle this use-case?
@JyotiSingh7 Got it! Seeds are intended for static data only; they can't take advantage of Jinja templating, as other dbt resources can.
I'd recommend you change File3.csv.tpl to be a model instead, and accomplish the runtime templating via dbt-Jinja functions var or env_var:
-- models/File3.sqlselect'HostIP'as CONFIG_KEY,
'{{ env_var('HOST_NAME') }}'as CONFIG_VALUE,
'Y'as STATUS,
'This is the APP VM Host Name/IP address'as DESCRIPTION
union allselect'SSHKeyFilePath'as CONFIG_KEY,
'{{ env_var('SSH_KEY_PATH') }}'as CONFIG_VALUE,
'Y'as STATUS,
'This is the path on APP VM to the SSH key file for Login User'as DESCRIPTION
You could get fancier by including the static data in a seed, the dynamic inputs in a model, and joining on a common key.
In the meantime, I'm going to close this issue, since we don't plan to make seed files dynamic.
Describe the bug
I have different types of files in my repo -
.csv
and.tpl
and I want to rundbt seed
command to load the data in snowflake.When I run the command, it applies all the
.csv
files and ignores.tpl
files.How can I use
dbt seed
for other format data files?Steps To Reproduce
In data folder, add few files with
.csv
format and some for.tpl
Run
dbt seed
command, it will apply csv files and igonors the tpl filesExpected behavior
I am looking to load data from different types of files instead of just from
.csv
System information
Which database are you using dbt with?
The output of
dbt --version
:The text was updated successfully, but these errors were encountered: