Skip to content

[APP-970] stored proc chunking - #993

Open
ericbuckley wants to merge 18 commits into
rel-7.13from
eb/app-970/stored-proc-chunking
Open

[APP-970] stored proc chunking#993
ericbuckley wants to merge 18 commits into
rel-7.13from
eb/app-970/stored-proc-chunking

Conversation

@ericbuckley

@ericbuckley ericbuckley commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

This pull request introduces batch chunking for large ID lists and dynamic datamart inputs during reporting pipeline post-processing and datamart processing. By breaking down high-volume ID sets into manageable batches.

Related Issues

Additional Notes

Implemented batch chunking across post-processing and datamart services to ensure robust handling of high-volume data without exceeding parameter limits.

  • Added UidChunker utility to split large ID collections into configurable batch sizes.
  • Introduced configurable properties in PostProcessingProperties and application.yaml.
  • Generalized listToParameterString to support batched parameter string generation.
  • Added comprehensive unit and integration tests covering chunking logic, retry mechanisms, and multi-ID processing.

Checklist

  • I have ensured that the pull request is of a manageable size, allowing it to be reviewed within a single session.
  • I have reviewed my changes to ensure they are clear, concise, and well-documented.
  • I have updated the documentation, if applicable.
  • I have added or updated test cases to cover my changes, if applicable.

Introduce PostProcessingProperties to configure max batch size for
post-processing operations with validation ensuring non-negative values.
Add UidChunker utility to support deduplication and chunking of
collection UIDs for post-processing operations.
Update PostProcessingService topic processing methods to chunk IDs and
condition codes according to the configured maximum batch size using the
UidChunker utility.
Generalize `listToParameterString` in `PostProcessingService` to accept
`Collection<?>` instead of `Collection<Long>`, enabling reuse for
processing topic condition code chunks (`Collection<String>`).
Update ProcessDatamartData.processMetricEventDatamart to chunk event
metric IDs according to the configured maximum batch size, matching
the chunking behavior used across other post-processing operations.
Add unit test verifying that PostProcessingService retries the whole
entity after a later chunk fails, ensuring correct retry cache handling
and metric updates.
Update ProcessDatamartData.executeDmProc to chunk single-list datamart
procedure input UIDs according to the configured maximum batch size
using the UidChunker utility, and add unit tests.
Update ProcessDatamartData to chunk multi-id datamarts, covid
vaccination parameters, and dynamic datamart outputs according to the
configured maximum batch size, and add unit tests for multi-chunking
behavior.
Replace verbose and large parameter string logs with structured chunk
progress and metadata including chunk numbers, total chunks, distinct
value counts, and max batch sizes. Standardize chunk iteration loops
and remove redundant log constants across post-processing and datamart
services.
@ericbuckley ericbuckley self-assigned this Aug 11, 2026
@ericbuckley ericbuckley changed the title Eb/app 970/stored proc chunking [APP-970] stored proc chunking Aug 11, 2026
Move the map chunking helper from ProcessDatamartData into UidChunker as
an overloaded chunkDistinct method. This centralizes all UID and map
chunking logic in UidChunker and adds comprehensive unit test coverage.
@ericbuckley
ericbuckley marked this pull request as ready for review August 12, 2026 02:33
@ericbuckley
ericbuckley requested a review from a team as a code owner August 12, 2026 02:33
ericnagel and others added 3 commits August 12, 2026 09:57
Adding short-circuits so we skip chunking when the set size is smaller than the max

Co-authored-by: Eric Nagel <eric@ericnagel.com>
Fix UidChunker to correctly evaluate total distinct value count
across all entity lists instead of map key count when determining
if values fit within max batch size. Also clean up code formatting.
Comment on lines 153 to +155
service:
post-processing:
max-batch-size: ${POST_PROCESSING_MAX_BATCH_SIZE:1000}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thoughts on adding this to the application-test.yaml with a very low size, maybe even 1 so we force a lot of chunking when the functional tests run?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I ran a couple of tests, one with a batch size of 1 and another with a batch size of 100. Both appear to have worked.

ericnagel
ericnagel previously approved these changes Aug 13, 2026
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.

3 participants