Hey there, I am new to meltano, and I have a ques...
# getting-started
m
Hey there, I am new to meltano, and I have a question, how do I create a bookmark when I run a tap? When I execute the isolated tap it makes records of type STATE, but when I do it with the command
meltano elt tap-my-tap target-jsonl
it doesn't send me any record of that type, according to the documentation it should create an independent file with these states, but it doesn't do it.
t
I believe you're looking for the --job_id argument. That's how meltano knows what state to save/use.
Said another way it doesn't remember state purely based on the tap/target combination... you have to tell it what state to use.
m
But how do I make it create the file with the states? I created the tap with meltano's singer_sdk.
t
🤔 I'm not an expert here so I may be misunderstanding your question. The taps I've worked with all allow you to provide a state file if you run them directly. My understanding is that Meltano provides that file when you specify the --job_id argument but does not provide the file if you don't. So no --job_id argument, no state.
p
@thomas_briggs is right - technically behind the scenes Meltano is storing your state in the system db then it makes it accessible to the tap/target. Check out https://docs.meltano.com/guide/integration#incremental-replication-state for more details but as long as you provide the
--job_id=x
then youre state will be managed. If youre asking how to view state you can use the
--dump=state
option with
elt
to get the contents like
meltano elt --dump=state tap-x target-y --job_id=123
m
Thank you very much, I appreciate the information. It is very useful to me
When I want to start from the last state should I run the same tap, target with the same job_id?
like
meltano elt tap-x target-y --job_id=123
again
t
That is correct!