alex
10/17/2023, 7:45 PM...
plugins:
extractors:
- name: tap-postgres
variant: meltanolabs
pip_url: git+<https://github.com/MeltanoLabs/tap-postgres.git>
config:
filter_schemas:
- public
select:
- public-users.*
metadata:
'*':
replication-method: FULL_TABLE
loaders:
- name: target-postgres
variant: transferwise
pip_url: pipelinewise-target-postgres
config:
hard_delete: true
add_metadata_columns: true
The issue I'm encountering is that the _sdc_deleted_at
column is not being updated on the users table in the target database.
Both of my databases are running using the following docker compose entries:
source-db:
image: postgres:14.9-alpine3.18
container_name: source_postgres
environment:
POSTGRES_DB: db
POSTGRES_USER: dbuser
POSTGRES_PASSWORD: dbpassword
ports:
- "15432:5432"
target-db:
image: postgres:14.9-alpine3.18
command: ["postgres", "-c", "log_statement=all"]
container_name: target_db
environment:
POSTGRES_DB: meltano_db
POSTGRES_USER: meltano_user
POSTGRES_PASSWORD: password
ports:
- "25432:5432"
For reference, here's my .env file:
# SOURCE DB
TAP_POSTGRES_DATABASE='db'
TAP_POSTGRES_HOST='localhost'
TAP_POSTGRES_USER='dbuser'
TAP_POSTGRES_PASSWORD='dbpassword'
TAP_POSTGRES_PORT=15432
# TARGET DB
TARGET_POSTGRES_DBNAME='meltano_db'
TARGET_POSTGRES_HOST='localhost'
TARGET_POSTGRES_USER='meltano_user'
TARGET_POSTGRES_PASSWORD='password'
TARGET_POSTGRES_DEFAULT_TARGET_SCHEMA='loaded'
TARGET_POSTGRES_PORT=25432
Andy Carter
10/17/2023, 8:04 PMhard_delete: true
then aren't rows deleted from your source table being deleted from your target table, rather than updated? You wouldn't see the _sdc_deleted_at
updating as those rows should be deleted completely from your target.alex
10/17/2023, 8:05 PMalex
10/17/2023, 8:07 PM_sdc_deleted_at
to make it clear that the deleted rows (from source) are being ignored in the target dbAndy Carter
10/17/2023, 8:10 PMAndy Carter
10/17/2023, 8:11 PMalex
10/17/2023, 8:13 PMPlease also note that Only <https://transferwise.github.io/pipelinewise/concept/replication_methods.html#log-based|Log Based> replication method detects delete row events.
visch
10/17/2023, 8:14 PMvisch
10/17/2023, 8:15 PMalex
10/17/2023, 8:17 PMvisch
10/17/2023, 8:19 PMalex
10/17/2023, 8:21 PMvisch
10/17/2023, 8:22 PMmeltano run dbt:drop_source_schema tap-postgres target-postgres dbt:run
visch
10/17/2023, 8:23 PMalex
10/17/2023, 8:27 PMvisch
10/17/2023, 8:28 PMalex
10/17/2023, 8:28 PMalex
10/17/2023, 8:28 PMuser
10/17/2023, 9:02 PMThere's easy ways to get there though,@visch I'd add that as of SDK 0.32.0 theres a new feature that allows you to configuremeltano run dbt:drop_source_schema tap-postgres target-postgres dbt:run
load_method
on the target to overwrite
which will do this drop table for you before starting the loadAndy Carter
10/18/2023, 7:33 AMandy_carter
10/23/2023, 10:16 PMandy_carter
10/23/2023, 10:23 PM