Skip to content

fix(firestore-bigquery-change-tracker): keep partition value on delete using old data #2424

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

Draft
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

CorieW
Copy link
Contributor

@CorieW CorieW commented May 16, 2025

Resolves #2303

  • Tested

@CorieW CorieW force-pushed the @invertase/bqe-time-partition-fix branch from 96b6af6 to 17fb4e9 Compare May 16, 2025 00:32
@cabljac cabljac requested a review from Copilot May 16, 2025 08:23
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the partitioning logic to retain the partition value on delete events by sourcing it from the old data rather than the new event data.

  • Uses the new ChangeType import to differentiate between DELETE and non-DELETE events.
  • Applies a conditional to select the appropriate field value for partitioning.
Comments suppressed due to low confidence (1)

firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/partitioning.ts:202

  • [nitpick] Consider adding an inline comment explaining why event.oldData is used for DELETE events. This will improve clarity and maintainability for future developers.
event.operation === ChangeType.DELETE ? event.oldData[firestoreFieldName] : event.data[firestoreFieldName];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 [firestore-bigquery-export] Time unit partition field not assigned in BQ for delete operations
1 participant