rocco_melillo
03/10/2021, 4:55 PMmeltano elt --job_id=<job_name> tap-mysql target-csv
everything works correctly, the "payload" field on the database (postgreSQL) follows the format:
{
"singer_state": {
"currently_syncing": null,
"bookmarks": {
"database_name-table_name": {
"version": 1615393814139,
"log_file": "mysql-bin.000375",
"log_pos": 17165039
}
}
}
}
Meanwhile when using the command:
meltano elt --job_id=<job_name> tap-mysql target-bigquery
it appears the pipeline works only on the initial import, and fails to catch updates on the database table.
The "payload" field on the database (postgreSQL) follows the format:
{
"singer_state": {
"currently_syncing": null,
"bookmarks": {
"database_name-table_name": {
"last_pk_fetched": {
"entity_id": 40314
},
"log_file": "mysql-bin.000375,
"log_pos": 17556051,
"max_pk_values": {
"entity_id": 40314
},
"version": 1615394206653
}
}
}
}
Apparently if we manually remove the additional keys "last_pk_fetched" and "max_pk_values", the target-bigquery works as expected.
Any idea why these values show up in the database? Thank you in advance 🙂aaronsteers
03/10/2021, 7:05 PMlask_pk_fetched and max_pk_values being logged as basically an extra bookmark indicating status of an in-progress batch, but in most cases, the tap would send a final STATE message without those values, essentially attempting to clear them. When replication_method is LOG_BASED, those pk values should be information only and should not have a role in replication. However, if replication key happens to also be set to the pk within the metadata, that might be something we’d want to look at - if the replication_key is perhaps conflicting with replication_method.rocco_melillo
03/11/2021, 12:09 PM# clear max pk value and last pk fetched upon successful sync
singer.clear_bookmark(state, catalog_entry.tap_stream_id, 'max_pk_values')
singer.clear_bookmark(state, catalog_entry.tap_stream_id, 'last_pk_fetched')
those values are not cleared.
attached the log file of the first run.aaronsteers
03/11/2021, 8:31 PMrocco_melillo
03/11/2021, 10:15 PM