Skip to content

[python] Introduce 'listagg' aggregator#8561

Merged
JingsongLi merged 2 commits into
apache:masterfrom
PyRSA:feature/pypaimon-listagg-impl
Jul 15, 2026
Merged

[python] Introduce 'listagg' aggregator#8561
JingsongLi merged 2 commits into
apache:masterfrom
PyRSA:feature/pypaimon-listagg-impl

Conversation

@PyRSA

@PyRSA PyRSA commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Purpose

Introduce the listagg field aggregator for pypaimon.

This change adds support for the listagg aggregation function in the Python reader, aligning its behavior with the Java implementation. It supports configurable delimiters through fields.<field-name>.list-agg-delimiter and optional deduplication via ields.<field-name>.distinct.

Tests

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

@JingsongLi

Copy link
Copy Markdown
Contributor

`When configuring an empty delimiter in listagg distinguish, it will directly throw 'ValueError: empty separator'. An empty string is a valid configuration, and all 14 tests have passed, but it does not cover this boundary; The minimum use case has been stably reproduced.

@PyRSA

PyRSA commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

`When configuring an empty delimiter in listagg distinguish, it will directly throw 'ValueError: empty separator'. An empty string is a valid configuration, and all 14 tests have passed, but it does not cover this boundary; The minimum use case has been stably reproduced.

Thanks for catching this. Python's str.split("") raises ValueError, while an empty delimiter is a valid configuration. I've updated the implementation to handle this case consistently with the Java behavior and added a test to cover this boundary.

@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi JingsongLi merged commit 67779ac into apache:master Jul 15, 2026
6 checks passed
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