fix(firestore-bigquery-export): update snapshot script#1289
Merged
Conversation
fac48f5 to
7aa49a3
Compare
Contributor
Author
|
Update
|
The old script uses FIRST_VALUE and OVER, which sorts the entire changelog and finds the first record for each document. It can result in a memory issue when running BigQuery reading from the latest snapshot. (Resources exceeded during query execution: The query could not be executed in the allotted memory. Peak usage: 110% of limit. Top memory consumer(s): sort operations used for analytic OVER() clauses: 96%) The updated script selects the maximum timestamp for each document_id, and joins back with the table by the latest timestamp instead.
…chema view. There's no need to find the latest value again.
d753143 to
fc59a53
Compare
4ffd7e3 to
dfb68ec
Compare
dackers86
approved these changes
Nov 15, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reopened #703 (rebased on next).
added relevant stress tests
added tests for the case
Will this cover if there are null time stamps or the latest entry for a document has two entries with the same timestamp?(mentioned in this comment)added script to generate bq fixtures
fixes #757