Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use digest for dup check instead of raw record #24

Closed
daigotanaka opened this issue Aug 2, 2021 · 1 comment
Closed

Use digest for dup check instead of raw record #24

daigotanaka opened this issue Aug 2, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@daigotanaka
Copy link
Collaborator

tap-rest-api keeps a copy of the last extracted record in the bookmark (aka state) together with the last recorded index or timestamp. The extra information is used to ignore the same record in the next run with the bookmark whose start index/time is inclusive.

However, It is not a good practice to include a raw record in the bookmark items mainly for security reasons.

So we should

  1. Sort the last record (except the extraction time key), by keys
  2. create a md5 digest
  3. include the digest instead of raw record in the bookmark.

To ensure backward compatibility, the dup check is made for both raw record and the digest.

@daigotanaka daigotanaka added the enhancement New feature or request label Aug 2, 2021
@daigotanaka daigotanaka self-assigned this Aug 2, 2021
@daigotanaka daigotanaka added this to the v0.2.7 milestone Aug 2, 2021
@daigotanaka
Copy link
Collaborator Author

daigotanaka commented Aug 2, 2021

This will also resolve some of the target incompatible issues related to JSON serialization:

e.g. target-snowflake:

TypeError: Object of type 'Decimal' is not JSON serializable

daigotanaka added a commit that referenced this issue Mar 11, 2022
* Use digest for dup check instead of raw record #24

* make timestamp in bookmark integer

* handle integerized timestamp from bookmark

* handle None bookmark case for timestamp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant