edward_smith
05/06/2021, 10:01 PM- name tap-postgres-experiment
inherit_from: tap-postgres
variant: transferwise
pip_url: git+<https://github.com/ers81239/pipelinewise-tap-postgres.git@time_based_sync>
config: ....
I've tried this and then meltano install extractor tap-postgres-experiment
but I get Extractor 'tap-postgres-cb_stats' is not known to Meltano
.douwe_maan
05/06/2021, 10:02 PMvariant: transferwise
?douwe_maan
05/06/2021, 10:03 PMtap-postgres
definition being inherited fromedward_smith
05/07/2021, 11:49 AM-name tap-postgres
in meltano.yml at this point, although all of the other extractors are working with that same inherit line in their config. I'll get to trying some things on this in a couple hours.edward_smith
05/07/2021, 11:53 AMedward_smith
05/07/2021, 2:35 PMdouwe_maan
05/07/2021, 2:40 PMis it supported to have 2 variants of the same tap installed at the same time?Yes, that's fine. Can you share some more of your
meltano.yml
? The error you shared mentions tap-postgres-cb_stats
but I haven't seen the definition for that oneedward_smith
05/07/2021, 2:53 PMextractors:
- name: tap-postgres-cb_tipping
inherit_from: tap-postgres
variant: transferwise
config:
host: 10.128.32.63
user: data
dbname: cb_tipping
each with a different name/host/credentialsedward_smith
05/07/2021, 2:54 PM- name: cb_tipping-0
inherit_from: tap-postgres-cb_tipping
metadata:
public-tipping_bonustokensclaimed:
replication-method: INCREMENTAL
replication-key: id
select:
- public-tipping_bonustokensclaimed.*
cb_tipping-0 through cb_tipping-4 each have around 10 tables defined.edward_smith
05/07/2021, 2:56 PM- name: tap-postgres-cb_stats
variant: transferwise
pip_url: git+<https://github.com/ers81239/pipelinewise-tap-postgres.git@time_based_sync>
config:
host: 10.128.41.10
user: data
dbname: cb_stats
log_level: DEBUG
douwe_maan
05/07/2021, 2:59 PMinherit_from: tap-postgres
to that tap-postgres-cb_stats
definition?edward_smith
05/07/2021, 3:00 PMedward_smith
05/07/2021, 3:00 PMmeltano install tap-postgres-cb_stats
?douwe_maan
05/07/2021, 3:00 PMdouwe_maan
05/07/2021, 3:01 PMmeltano install extractor tap-postgres-cb_stats
, that isedward_smith
05/07/2021, 3:03 PMedward_smith
05/07/2021, 3:04 PMdouwe_maan
05/07/2021, 3:06 PMedward_smith
05/07/2021, 3:08 PMplugin
configuration item so that you could have:
-name production-db-tap
plugin: tap-postgres
variant: pipelinewise
pip_url: http+git.......
douwe_maan
05/07/2021, 3:09 PMedward_smith
05/07/2021, 3:14 PMinherit_from
basically works like plugin
as I was describing. That makes sense.... something I kept coming back to which is a little confusing is this sentence in the docs:
To add a new plugin to your project that inherits from an existing plugin, so that it can reuse the same package but override (parts of) its configuration, you can use the option onÂ--inherit-from
meltano add
edward_smith
05/07/2021, 3:14 PMdouwe_maan
05/07/2021, 3:16 PMpip_url
, "same package" isn't strictly true anymore, even though from Meltano's perspective you're using the same "base package definition" for tap-postgres
/`variant: transferwise` , but you're just overriding the specific URL to get the package fromedward_smith
05/07/2021, 3:28 PM- name: tap-postgres-cb_stats
inherit_from: tap-postgres
variant: transferwise
pip_url: git+<https://github.com/ers81239/pipelinewise-tap-postgres.git@time_based_sync>
config:
host: 10.128.41.10
user: data
dbname: cb_stats
- name: cb_stats-0
inherit_from: tap-postgres-cb_stats
metadata:
public-stats_broadcasterstats:
replication-method: TIME-BASED
replication-key: time
replication-time-interval: 10 MINUTES
select:
- public-stats_broadcasterstats.*
But when I run:
meltano --log-level debug elt cb_stats-0 target-snowflake --job_id cb_stats-0
cb_stats-0 | File "/home/ec2-user/meltano-projects/cb-tipping-1/.meltano/extractors/cb_stats-0/venv/lib64/python3.7/site-packages/tap_postgres/__init__.py", line 106, in sync_method_for_streams
cb_stats-0 | raise Exception("Unrecognized replication_method {}".format(replication_method))
However, the correct package is installed in /.meltano/extractors/tap-postgres-cb_stats/venv/lib/python3.7/site-packages/tap_postgres/
not .meltano/extractors/cb_stats-0/venv/lib64/python3.7/site-packages/tap_postgres
I was able to fix this by also running meltano install extractor cb_stats-0
... this is that same case we discussed yesterday where the installed version and the configured version are out of sync.douwe_maan
05/07/2021, 3:34 PMedward_smith
05/07/2021, 3:41 PMcb_stats-0 | time=2021-05-07 15:39:11 name=tap_postgres level=INFO message=next replication key value: 2019-02-22 02:55:00+00:00
cb_stats-0 | time=2021-05-07 15:39:11 name=tap_postgres level=INFO message=select statement: SELECT ...
cb_stats-0 | FROM "public"."stats_broadcasterstats"
cb_stats-0 | WHERE "time" >= '2019-02-22 02:55:00+00:00'::timestamp with time zone
cb_stats-0 | AND "time" < '2019-02-22 02:55:00+00:00'::timestamp with time zone + INTERVAL '10 MINUTES' with itersize 20000
cb_stats-0 | time=2021-05-07 15:39:18 name=tap_postgres level=INFO message=next replication key value: 2019-02-22 03:05:00+00:00
cb_stats-0 | time=2021-05-07 15:39:18 name=tap_postgres level=INFO message=select statement: SELECT .....
cb_stats-0 | FROM "public"."stats_broadcasterstats"
cb_stats-0 | WHERE "time" >= '2019-02-22 03:05:00+00:00'::timestamp with time zone
cb_stats-0 | AND "time" < '2019-02-22 03:05:00+00:00'::timestamp with time zone + INTERVAL '10 MINUTES' with itersize 20000
cb_stats-0 | time=2021-05-07 15:39:21 name=singer level=INFO message=METRIC: {"type": "counter", "metric": "record_count", "value": 113262, "tags": {}}
This was built because the database servers have 5 minute query timeouts and this table is huge and can't be sorted in any way in that time.douwe_maan
05/07/2021, 3:42 PMedward_smith
05/07/2021, 3:45 PMedward_smith
05/07/2021, 3:49 PMdouwe_maan
05/07/2021, 3:49 PMdouwe_maan
05/07/2021, 4:18 PMedward_smith
05/07/2021, 4:19 PM