Cast arrays and hstore columns using Python instead of Postgres db #72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of change
Currently, the tap-postgres is using a live database connection to cast array and hstore columns to their Python equivalent when using logical replication as the synchronization strategy.
This live database connection is expensive and can create backlogs of large volumes of non-consumed data from the replication slot. This in turn can cause out-of-disk space errors which
then have to be prevented by dropping the replication slot and resetting the integration in Stitchdata and doing another full sync.
This PR changes that behaviour and uses Python to do conversion of a Postgres stringified array into a Python list.
I've also added unit tests to demonstrate that this approach works. The fixture data was generated by
QA steps
Risks
Rollback steps
@dmosorast @cmerrick @dylan-stitch