-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: Output record count metric from batch files insert #267
Merged
edgarrmondragon
merged 3 commits into
MeltanoLabs:main
from
Matatika:feature/batch-record-count-metrics
Oct 4, 2024
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this add records to the count twice? Once when the record is processed in https://github.com/meltano/sdk/blob/409a40b48c442e1382611d3a69b2f95df2e073d3/singer_sdk/target_base.py#L362 and again when they're batched in
target-snowflake/target_snowflake/sinks.py
Lines 151 to 154 in 8919a66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I guess so. The intention of this change was to work with
BATCH
messages, but you're referring to when a user suppliesbatch_config
on the target side specifically to batch togetherRECORD
data into files for insert via internal stage?Just to check my understanding, if
batch_config
is supplied on the tap side, it emits aBATCH
message and then doesn't hit this issue?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the full context of the function I linked is useful:
target-snowflake/target_snowflake/sinks.py
Lines 109 to 156 in 7c9a1fb
RECORD
messages are processed by this logic, even with the defaultbatch_config
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see - I wasn't aware there was a default
batch_config
here. So processing ofRECORD
andBATCH
messages both end up callinginsert_batch_files_via_internal_stage
where I've made this change, exceptRECORD
messages are already counted by the SDK before they are batched so would now get counted twice.In spite of this issue, in principle how do you feel about this idea of emitting a record count when this target receives a
BATCH
message? Is it OK or does it conflate two concepts?