Files
mysql2postgres/tests/test_consolidation_grouping.py
alex d513920788 fix: Buffer incomplete groups at batch boundaries for complete consolidation
The consolidation grouping logic now properly handles rows with the same
consolidation key (UnitName, ToolNameID, EventDate, EventTime) that span
across multiple fetch batches.

Key improvements:
- Added buffering of incomplete groups at batch boundaries
- When a batch is full (has exactly limit rows), the final group is buffered
  to be prepended to the next batch, ensuring complete group consolidation
- When the final batch is reached (fewer than limit rows), all buffered and
  current groups are yielded

This ensures that all nodes with the same consolidation key are grouped
together in a single consolidated row, eliminating node fragmentation.

Added comprehensive unit tests verifying:
- Multi-node consolidation with batch boundaries
- RAWDATACOR consolidation with multiple nodes
- Groups that span batch boundaries are kept complete

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-25 22:36:15 +01:00

9.4 KiB