tim_manger
05/30/2024, 10:10 PMMELTANO_EXTRACTOR_TAP_SNOWFLAKE_CONFIG=$(cat <<EOF
{
"account": "$TAP_SNOWFLAKE_ACCOUNT",
"user": "$TAP_SNOWFLAKE_USER",
"password": "$TAP_SNOWFLAKE_PASSWORD",
"database": "$TAP_SNOWFLAKE_DATABASE",
"warehouse": "$TAP_SNOWFLAKE_WAREHOUSE",
"schema": "$TAP_SNOWFLAKE_SCHEMA",
"tables": "$TAP_SNOWFLAKE_TABLE_NAME"
}
EOF
)
echo $MELTANO_EXTRACTOR_TAP_SNOWFLAKE_CONFIG
export MELTANO_EXTRACTOR_TAP_SNOWFLAKE_CONFIG
meltano run tap-snowflake target-bigquery
I have also tried
MELTANO_EXTRACTOR_TAP_SNOWFLAKE_CONFIG=$(cat <<EOF
{
"account": "$TAP_SNOWFLAKE_ACCOUNT",
"user": "$TAP_SNOWFLAKE_USER",
"password": "$TAP_SNOWFLAKE_PASSWORD",
"database": "$TAP_SNOWFLAKE_DATABASE",
"warehouse": "$TAP_SNOWFLAKE_WAREHOUSE",
"schema": "$TAP_SNOWFLAKE_SCHEMA",
"tables":
"-" "$TAP_SNOWFLAKE_TABLE_NAME"
}
EOF
)
echo $MELTANO_EXTRACTOR_TAP_SNOWFLAKE_CONFIG
export MELTANO_EXTRACTOR_TAP_SNOWFLAKE_CONFIG
meltano run tap-snowflake target-bigquery
and
MELTANO_EXTRACTOR_TAP_SNOWFLAKE_CONFIG=$(cat <<EOF
{
"account": "$TAP_SNOWFLAKE_ACCOUNT",
"user": "$TAP_SNOWFLAKE_USER",
"password": "$TAP_SNOWFLAKE_PASSWORD",
"database": "$TAP_SNOWFLAKE_DATABASE",
"warehouse": "$TAP_SNOWFLAKE_WAREHOUSE",
"schema": "$TAP_SNOWFLAKE_SCHEMA",
"tables": ["$TAP_SNOWFLAKE_TABLE_NAME"]
}
EOF
)
echo $MELTANO_EXTRACTOR_TAP_SNOWFLAKE_CONFIG
export MELTANO_EXTRACTOR_TAP_SNOWFLAKE_CONFIG
meltano run tap-snowflake target-bigquery
Thank you for any help
TimEdgar RamÃrez (Arch.dev)
05/30/2024, 10:30 PMtim_manger
05/30/2024, 10:47 PMEdgar RamÃrez (Arch.dev)
05/30/2024, 10:50 PMmeltano config tap-snowflake list
.tim_manger
05/31/2024, 12:22 AMmeltano config tap-snowflake set tables '[{"schema": "Schema_One", "table_name": "Table_One"}]'
meltano config tap-snowflake
meltano run tap-snowflake target-bigquery
However, it doesn't seem to update the meltano.ymal flie
It states that the config has been updated, but the meltano config tap-snowflake doesn't show the update and it then runs for all tables.
Any idea what it is I am doing wrong?Edgar RamÃrez (Arch.dev)
05/31/2024, 12:47 AM$ meltano config tap-snowflake set tables '[{"schema": "Schema_One", "table_name": "Table_One"}]'
2024-05-31T00:44:29.565981Z [info ] The default environment 'dev' will be ignored for `meltano config`. To configure a specific environment, please use the option `--environment=<environment name>`.
Extractor 'tap-snowflake' setting 'tables' was set in `meltano.yml`: [{'schema': 'Schema_One', 'table_name': 'Table_One'}]
$ meltano@py311 config tap-snowflake
2024-05-31T00:44:35.362239Z [info ] The default environment 'dev' will be ignored for `meltano config`. To configure a specific environment, please use the option `--environment=<environment name>`.
{
"tables": [
{
"schema": "Schema_One",
"table_name": "Table_One"
}
]
}
1. What version of meltano are you running?
2. What does your meltano.yml
file look like?
3. Try running meltano lock --update --all
tim_manger
05/31/2024, 3:23 AMplugins:
extractors:
- name: tap-snowflake
variant: meltanolabs
pip_url: meltanolabs-tap-snowflake
config:
account: {$TAP_SNOWFLAKE_ACCOUNT: null}
database: {$TAP_SNOWFLAKE_DATABASE: null}
role: {$TAP_SNOWFLAKE_ROLE: null}
schema: {$TAP_SNOWFLAKE_SCHEMA: null}
user: {$TAP_SNOWFLAKE_USER: null}
warehouse: {$TAP_SNOWFLAKE_WAREHOUSE: null}
Add the lock statement
and the meltano config tap-snowflake returns the below showing the correct table added
but the stream log is running a different table the first table in the schema based alphabetically and doesn't run Table_One . I have also tried altering the meltano.yml passing in the table name via a variable, but it fails saying it can't run a discover over the catalog . I suppose it I can pass it directly to the meltano.yml file that would solve having to run a meltano config prior to running
plugins:
extractors:
- name: tap-snowflake
variant: meltanolabs
pip_url: meltanolabs-tap-snowflake
config:
account: {$TAP_SNOWFLAKE_ACCOUNT: null}
database: {$TAP_SNOWFLAKE_DATABASE: null}
role: {$TAP_SNOWFLAKE_ROLE: null}
schema: {$TAP_SNOWFLAKE_SCHEMA: null}
user: {$TAP_SNOWFLAKE_USER: null}
warehouse: {$TAP_SNOWFLAKE_WAREHOUSE: null}
tables:
- {$TAP_SNOWFLAKE_Table_Name: null}
visch
05/31/2024, 10:28 AMvisch
05/31/2024, 10:32 AMtim_manger
06/04/2024, 1:38 AMvisch
06/04/2024, 12:21 PMtim_manger
06/04/2024, 9:43 PMmeltano config tap-snowflake set tables '["SCH.TABLE1"]'
meltano run tap-snowflake target-jsonl
Meltano.yml
version: 1
default_environment: dev
project_id: 2c9b2c68-011b-463b-a3ec-8708821583c4
environments:
- name: dev
- name: staging
- name: prod
plugins:
extractors:
- name: tap-snowflake
variant: meltanolabs
pip_url: meltanolabs-tap-snowflake
config:
account: {$TAP_SNOWFLAKE_ACCOUNT: null}
database: {$TAP_SNOWFLAKE_DATABASE: null}
role: {$TAP_SNOWFLAKE_ROLE: null}
schema: {$TAP_SNOWFLAKE_SCHEMA: null}
user: {$TAP_SNOWFLAKE_USER: null}
warehouse: {$TAP_SNOWFLAKE_WAREHOUSE: null}
tables:
- ["SCH.TABLE1"]
loaders:
- name: target-jsonl
variant: andyh1203
pip_url: target-jsonl
- name: target-bigquery
variant: z3z1ma
pip_url: git+<https://github.com/z3z1ma/target-bigquery.git>
config:
credentials_path: ./.secrets/GCP_Cred.json
project: {$TARGET_BIGQUERY_PROJECT: null}
dataset: {$TARGET_BIGQUERY_DATASET: null}
location: {$TARGET_BIGQUERY_LOCATION: null}
overwrite: true
method: gcs_stage
bucket: {$LANDING_BUCKET: null}}
batch_size: 100000
This works now, but I am unable to pass the table name via a variable name.
the below fails
bash.sh
export $TAP_SNOWFLAKE_TABLENAME='["SCH.TABLE1"]'
meltano run tap-snowflake target-jsonl
meltano.yml
version: 1
default_environment: dev
project_id: 2c9b2c68-011b-463b-a3ec-8708821583c4
environments:
- name: dev
- name: staging
- name: prod
plugins:
extractors:
- name: tap-snowflake
variant: meltanolabs
pip_url: meltanolabs-tap-snowflake
config:
account: {$TAP_SNOWFLAKE_ACCOUNT: null}
database: {$TAP_SNOWFLAKE_DATABASE: null}
role: {$TAP_SNOWFLAKE_ROLE: null}
schema: {$TAP_SNOWFLAKE_SCHEMA: null}
user: {$TAP_SNOWFLAKE_USER: null}
warehouse: {$TAP_SNOWFLAKE_WAREHOUSE: null}
tables:
- {$TAP_SNOWFLAKE_TABLENAME: null}
loaders:
- name: target-jsonl
variant: andyh1203
pip_url: target-jsonl
- name: target-bigquery
variant: z3z1ma
pip_url: git+<https://github.com/z3z1ma/target-bigquery.git>
config:
credentials_path: ./.secrets/GCP_Cred.json
project: {$TARGET_BIGQUERY_PROJECT: null}
dataset: {$TARGET_BIGQUERY_DATASET: null}
location: {$TARGET_BIGQUERY_LOCATION: null}
overwrite: true
method: gcs_stage
bucket: {$LANDING_BUCKET: null}}
batch_size: 100000
Thanks for any helptim_manger
06/04/2024, 10:58 PMexport TAP_SNOWFLAKE_TABLE=SCH.TABLE1
echo $TAP_SNOWFLAKE_TABLE
meltano run tap-snowflake target-bigquery
meltano.yml
plugins:
extractors:
- name: tap-snowflake
variant: meltanolabs
pip_url: meltanolabs-tap-snowflake
config:
account: {$TAP_SNOWFLAKE_ACCOUNT: null}
database: {$TAP_SNOWFLAKE_DATABASE: null}
role: {$TAP_SNOWFLAKE_ROLE: null}
schema: {$TAP_SNOWFLAKE_SCHEMA: null}
user: {$TAP_SNOWFLAKE_USER: null}
warehouse: {$TAP_SNOWFLAKE_WAREHOUSE: null}
tables:
- $TAP_SNOWFLAKE_TABLE
quite a few syntax errors
thank you both for the help
Tim