[bulk_executor] fix: add --persegment support to scancount (#92) - #49
Closed
relentlesscol wants to merge 2 commits into
Closed
[bulk_executor] fix: add --persegment support to scancount (#92)#49relentlesscol wants to merge 2 commits into
relentlesscol wants to merge 2 commits into
Conversation
Unit tests assert: - DictAccumulator (AccumulatorParam subclass) exists for per-segment count propagation via Spark Accumulators (not plain dicts) - _count_data adds segment count to per_segment_accumulator - run() creates DictAccumulator when --persegment is set - run() prints per-segment counts when --persegment is set - Backward compat: no per-segment output without the flag E2e test (tests/e2e/commands/test_scancount_persegment_smoke.py): - Runs real Glue scancount --persegment against a transient table - Verifies per-segment output lines appear and sum to total
…labs#92) Implements per-segment item count reporting for scancount using a Spark Accumulator (DictAccumulator) to correctly propagate counts from executors to the driver. Plain dicts don't work in Spark's distributed model — only Accumulators do. Changes: - Add DictAccumulator(AccumulatorParam) that merges segment count dicts - Add per_segment_accumulator parameter to _count_data - Create per-segment accumulator in run() when persegment=True - Print per-segment breakdown after total count
Owner
Author
|
Closing as stale — fork-internal PR against the fork's own main. Branch is retained; reopen if this work resumes. |
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.
Summary
DictAccumulator(AccumulatorParam)to correctly propagate per-segment counts from Spark executors to the driver (plain dicts don't work in Spark's distributed model)per_segment_accumulatorparameter to_count_datawhich records{segment_id: count}after each segment completes--persegmentflag is set,run()creates the accumulator and prints a per-segment breakdown after the totalIssues addressed
scancountable to output item counts per segment to measure possible task execution skew awslabs/amazon-dynamodb-tools#92 — scancount --persegment: report per-segment item counts to detect data skewTest plan
test_scancount_persegment.pypass (DictAccumulator merging, _count_data integration, run() output)--persegment, output is unchanged