roman_gusev
04/23/2021, 1:45 PMselect tap-postgres --exclude and can’t understand if I’m doing it wrong or if I have the wrong expectations.
I have the following setup:
...
extractors:
- name: tap-postgres
variant: transferwise
pip_url: pipelinewise-tap-postgres
config:
default_replication_method: FULL_TABLE
filter_schemas: public
select:
- '!*.first_name'
- public-admins.*
- '!*.last_name'
loaders:
- name: target-csv
variant: singer-io
pip_url: target-csv
config:
destination_path: output/csv
...
with this I want to exclude first and last name from the destination. But unfortunately they are included in the final csv files.
With meltano select
meltano select tap-postgres --list
I get selected attributes w/o name columns
...
Legend:
selected
excluded
automatic
Enabled patterns:
!*.first_name
public-admins.*
!*.last_name
Selected attributes:
[selected ] public-admins.created_at
[selected ] public-admins.deleted_at
[automatic] public-admins.id
[selected ] public-admins.permissions
[selected ] public-admins.updated_at
[selected ] public-admins.uuid
I just reproduced this with a completely fresh setup (meltano --version
meltano, version 1.67.0)
Can you please help understand how to exclude columns from the export?visch
04/23/2021, 1:54 PMmeltano invoke tap-postgress --dump catalog > catalog.json does that contain your firstname / lastname as expected / not expectedvisch
04/23/2021, 1:54 PMvisch
04/23/2021, 1:54 PMroman_gusev
04/23/2021, 2:00 PMmeltano invoke --dump=catalog tap-postgres > catalog.json in catalog I see:
"metadata": [
... {
"breadcrumb": [
"properties",
"first_name"
],
"metadata": {
"sql-datatype": "character varying",
"inclusion": "available",
"selected-by-default": true,
"selected": false
}
},
{
"breadcrumb": [
"properties",
"last_name"
],
"metadata": {
"sql-datatype": "character varying",
"inclusion": "available",
"selected-by-default": true,
"selected": false
}
},
...
and then in “schema”
"schema": {
"type": "object",
"properties": {
"id": {
"type": [
"integer"
],
"minimum": -9223372036854775808,
"maximum": 9223372036854775807
},
"first_name": {
"type": [
"null",
"string"
]
},
"last_name": {
"type": [
"null",
"string"
]
so they have
"selected-by-default": true,
"selected": falseroman_gusev
04/23/2021, 2:02 PMroman_gusev
04/23/2021, 2:04 PMSorry I clobered your question with mine, we both posted at the same time😅 no worries. Meltano is a hot topic 🙂
visch
04/23/2021, 2:07 PMvisch
04/23/2021, 2:08 PMvisch
04/23/2021, 2:08 PMroman_gusev
04/23/2021, 2:19 PMtransferwise variant uses different syntax or really doesn’t support filtering of columns.
I’ll try to play with catalog file manually and will check docs for this tap deepervisch
04/23/2021, 2:20 PMjuan_sebastian_suarez_valencia
04/23/2021, 2:21 PMselect command in Meltano. It ignores what I asked
I wrote an issue about it
Furthermore, I just had a problem with the catalog too. I re-installed a tap and meltano kept using the old catalog with the new tap so I just had to manually override itvisch
04/23/2021, 2:22 PMdouwe_maan
04/23/2021, 3:21 PMselected metadata: https://github.com/transferwise/pipelinewise-tap-postgres/blob/8c4732ee398f6124a616f929c6f85c5499366149/tap_postgres/sync_strategies/common.py#L[…]2, which is used here: https://github.com/transferwise/pipelinewise-tap-postgres/blob/8c4732ee398f6124a616f929c6f85c5499366149/tap_postgres/__init__.py#L110 and here: https://github.com/transferwise/pipelinewise-tap-postgres/blob/8c4732ee398f6124a616f929c6f85c5499366149/tap_postgres/__init__.py#L160.
My next step would be to add some debug logging statements there (e.g. LOGGER.warning(desired_columns) ) to see if the columns in question are correctly excluded there.douwe_maan
04/23/2021, 3:23 PMI’ve already had problems with thecommand in Meltano. It ignores what I askedselect
I wrote an issue about it@juan_sebastian_suarez_valencia Sorry to hear that! Which issue was that again?
Furthermore, I just had a problem with theWe have an issue for that one: https://gitlab.com/meltano/meltano/-/issues/2627. We haven't gotten to it yet, but it's on our radar. Contributions are welcome 🙂too. I re-installed a tap and meltano kept using the old catalog with the new tap so I just had to manually override itcatalog
juan_sebastian_suarez_valencia
04/24/2021, 6:46 AMselect. I didn’t write an issue and I haven’t tried it since then. If I stumble upon the problem again (let’s hope not🤞) I’ll write the issue this timeroman_gusev
04/27/2021, 8:45 PM