Skip to content

[python] Align FieldSumAgg with Java implementation#8719

Open
PyRSA wants to merge 11 commits into
apache:masterfrom
PyRSA:feature/pypaimon-sum-agg-impl
Open

[python] Align FieldSumAgg with Java implementation#8719
PyRSA wants to merge 11 commits into
apache:masterfrom
PyRSA:feature/pypaimon-sum-agg-impl

Conversation

@PyRSA

@PyRSA PyRSA commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Purpose

This PR aligns the Python FieldSumAgg implementation with the Java implementation.

The changes include:

  • Support aggregation and retraction for all numeric types.
  • Add overflow checks for integral types (TINYINT, SMALLINT, INT, BIGINT).
  • Support DECIMAL aggregation with precision and scale handling.
  • Add comprehensive unit tests covering normal and overflow cases.

Dependency

This PR depends on #8718, which introduces the Python Decimal implementation and the numeric boundary constants used for overflow checking.

Tests

  • python -m pytest pypaimon/tests/test_field_aggregators.py::FieldSumAggTest -q
  • python -m pytest pypaimon/tests/test_aggregation_e2e.py -q
  • python -m pytest pypaimon/tests/test_aggregation_merge_function.py -q
  • git diff --check

@JingsongLi

Copy link
Copy Markdown
Contributor

This is also affected by the shared Decimal implementation; a valid DECIMAL(38,0) sum operation will fail due to precision=28, and encoding/decoding of unscaled bytes with scale>18 will also fail.

@PyRSA

PyRSA commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

This is also affected by the shared Decimal implementation; a valid DECIMAL(38,0) sum operation will fail due to precision=28, and encoding/decoding of unscaled bytes with scale>18 will also fail.

Fixed. This is resolved by the updates in the shared Decimal implementation (depends on #8718).

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.

2 participants