Pawel Plaszczak
01/10/2025, 8:45 AM{
"type":"STATE",
"value":{
"bookmarks":{
"PLASZPA-PERSONS":{
"last_replication_method":"INCREMENTAL",
"replication_key":"PERSON_ID",
"replication_key_value":3
}
}
}
}
and then I invoked tap-oracle with this state:
meltano invoke tap-oracle -s state.log
But
again, the replication-key-value was ignored - all three records with
PERSON_ID values 1,2, and 3 got replicated. Is this because this
variable is not supported by tap-oracle?Edgar RamĂrez (Arch.dev)
01/10/2025, 8:06 PMI first tried to set up replication-key-value in meltano.ymlwhat does that
meltano.yml
look like?Pawel Plaszczak
01/13/2025, 5:55 PMEdgar RamĂrez (Arch.dev)
01/13/2025, 9:05 PMPawel Plaszczak
01/14/2025, 8:24 AMSteve Clarke
01/14/2025, 8:46 AMSteve Clarke
01/14/2025, 8:49 AMPawel Plaszczak
01/14/2025, 4:35 PM$ meltano invoke tap-oracle -s mystate.json
However, if I want to run "meltano run", there is no -s option, so I cannot pass the state. I was only able to ignore the state altogether, like this, and this works:
$ meltano run tap-oracle target-postgres --no-state-update
So, how could I define the required state for the entire etl?
Also, alternatively, how does meltano/singer store the state and how could I reset it?
I found the file ./.meltano/run/tap-oracle/state.json that looked like the state storage, but deleting this file did not help - obviously the state is stored elsewhere. I also tried various combinations of following two variables in the meltano.yml, like you suggested,: replication_key_value and is_view, but both variables seem to be ignored, no matter what I put there:
metadata:
PLASZPA-PERSONS2:
replication-method: INCREMENTAL
replication-key: KW_UPDATE_DATE
replication_key_value: 2022-12-30T00:00:00.00+00:00
is-view: false
So what would be the correct and recommended way to define the state for the oracle-postgres ETL, so that I can replicate, for instance, only the last five thousand rows from a table of 10 million rows?Pawel Plaszczak
01/15/2025, 1:13 PM$ meltano invoke tap-oracle -s mystate.json|meltano invoke target-postgres
The only caveat is that target-postgres, if invoked like this with invoke, will write to schema melty while, if invoked with "run", it will write to schema tap-oracle. To enforce consistent target schema across both commands, I had to add this variable to meltano.yml:
default_target_schema: tap_oracle
And then finally everything works as expected: I can define the requested start state in mystate.json, and the target table, in the requested schema tap_oracle, gets populated with the data younger than the state. @Steve Clarke and @Edgar RamĂrez (Arch.dev), thank you for your support, I am moving on with the project!Edgar RamĂrez (Arch.dev)
01/16/2025, 7:42 PM-s <state file>
works but meltano run
doesn't makes me think the plugin in meltano.yml
is missing capabilities: [state]
đ¤Steve Clarke
01/16/2025, 7:46 PM