Skip to content
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f7fe935
[python] Implement Decimal data structure for pypaimon.
Jul 18, 2026
3dc6dee
[python] Implement Decimal data structure for pypaimon.
Jul 18, 2026
7a6992e
[python] Introduce 'product' aggregator function.
Jul 18, 2026
1e47de5
[python] Introduce 'product' aggregator function.
Jul 18, 2026
dcf5951
[python] Fix Python 3.6 compatibility for Decimal.
Jul 18, 2026
b7e5dfc
[python] adjust test_aggregation_e2e::test_out_of_scope_default_aggre…
Jul 18, 2026
864b443
[python] adjust decimal type calc logic.
Jul 18, 2026
668c64b
Merge remote-tracking branch 'origin/master' into feature/pypaimon-pr…
Jul 20, 2026
62c4fd8
[python] Align Decimal implementation with Java semantics.
Jul 20, 2026
03c66e4
[python] Fix DECIMAL division and FLOAT/DOUBLE zero-division in produ…
Jul 20, 2026
3998983
Merge remote-tracking branch 'origin/master' into feature/pypaimon-pr…
Jul 21, 2026
efe17a6
Merge remote-tracking branch 'origin/master' into feature/pypaimon-pr…
Jul 21, 2026
524af9f
[python] Fix Decimal.from_big_decimal precision handling
Jul 21, 2026
f35c47e
[python] Fix FieldProductAgg decimal calculation precision
Jul 21, 2026
4ab9f45
Merge remote-tracking branch 'origin/master' into feature/pypaimon-pr…
Jul 24, 2026
2a5424e
Merge remote-tracking branch 'origin/master' into feature/pypaimon-pr…
Jul 25, 2026
ae40692
[python] Fix Decimal precision and binary serialization.
Jul 25, 2026
c895ef9
[python] Fix high-precision Decimal serialization and Decimal binary …
Jul 25, 2026
50dd589
Merge remote-tracking branch 'origin/master' into feature/pypaimon-pr…
Jul 27, 2026
1d8d4e6
[python] Introduce 'product' aggregator function.
Jul 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions paimon-python/pypaimon/tests/test_field_aggregators.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,17 @@ def test_null_inputs(self):
self.assertIsNone(agg.retract(None, 5))
self.assertIsNone(agg.retract(None, None))

def test_long_boundary_product(self):
agg = _make("product", "BIGINT")

self.assertEqual(
agg.agg(3037000499, 3037000499),
9223372030926249001,
)

with self.assertRaises(ArithmeticError):
agg.agg(3037000500, 3037000500)

def test_non_numeric_type_rejected_at_construction(self):
with self.assertRaises(ValueError) as ctx:
_make("product", "VARCHAR")
Expand All @@ -492,6 +503,42 @@ def test_decimal_high_precision_product(self):
BigDecimal("1234567890123456790234567890123456789"),
)

result = agg.agg(
BigDecimal("9999999999999999999"),
BigDecimal("9999999999999999999"),
)

self.assertEqual(
result,
BigDecimal("99999999999999999980000000000000000001"),
)

# with scale
agg = _make("product", "DECIMAL(38,18)")

result = agg.agg(
BigDecimal("1.234567890123456789"),
BigDecimal("2.000000000000000001"),
)
self.assertEqual(
result,
BigDecimal("2.469135780246913579"),
)

def test_decimal_product_precision_overflow(self):
agg = _make("product", "DECIMAL(38,0)")

# digits > precision, so return None
self.assertIsNone(agg.agg(
BigDecimal("99999999999999999999999999999999999999"),
BigDecimal("10"),
))

self.assertIsNone(agg.agg(
BigDecimal("9999999999999999999"),
BigDecimal("99999999999999999991"),
))

def test_decimal_divide_requires_exact_result(self):
agg = _make("product", "DECIMAL(38,0)")

Expand All @@ -501,6 +548,27 @@ def test_decimal_divide_requires_exact_result(self):
BigDecimal("3"),
)

agg = _make("product", "DECIMAL(38,18)")

with self.assertRaises(ArithmeticError):
agg.retract(
BigDecimal("1.000000000000000000"),
BigDecimal("3.000000000000000000"),
)

def test_decimal_divide_high_precision_exact(self):
agg = _make("product", "DECIMAL(38,0)")

result = agg.retract(
BigDecimal("99999999999999999999999999999999999998"),
BigDecimal("2"),
)

self.assertEqual(
result,
BigDecimal("49999999999999999999999999999999999999"),
)

def test_float_divide_by_zero(self):
agg = _make("product", "FLOAT")

Expand Down
Loading