Hi, Any ideas on what is the best method to update...
# plugins-general
n
Hi, Any ideas on what is the best method to update state.json of a tap for incremental load after the pipeline has completed ?
d
@nitin_kharya Have you considered using Meltano’s automatic state management? https://meltano.com/docs/integration.html#incremental-replication-state
Meltano stores this pipeline state in its system database, identified by the
meltano elt
run’s Job ID.
When
meltano elt
is run a subsequent time, it will look for the most recent completed (successful or failed) pipeline run with the same job ID that generated some state. If found, this state is then passed along to the extractor.
n
Hi @douwe_maan, As per the documentation it looks like it should manage the state on its own and I do not require to set anything explicitly. But every time I run my pipeline it brings the data with complete import. meltano | No state was found, complete import. However when the load completes, I do get meltano | Incremental state has been updated at 2021-08-18 174048.930257.
d
@nitin_kharya Are you passing a
--job_id
into
meltano elt
?
n
no .... how do I get that ?
n
So it could be any String basically ?
d
Correct!
n
Thanks @douwe_maan