Skip to content

[Enhancement] add trino function map_agg (backport #66673)#67398

Closed
mergify[bot] wants to merge 1 commit intobranch-3.3from
mergify/bp/branch-3.3/pr-66673
Closed

[Enhancement] add trino function map_agg (backport #66673)#67398
mergify[bot] wants to merge 1 commit intobranch-3.3from
mergify/bp/branch-3.3/pr-66673

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Dec 31, 2025

Why I'm doing:

When using the Trino dialect, the map_agg function is not supported.

https://trino.io/docs/385/functions/aggregate.html?highlight=map_agg#map_agg

What I'm doing:

map_agg(key, value) -> map_from_arrays(array_agg(key), array_agg(value))

support the map_agg function.

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • [x ] I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.0
    • 3.5
    • 3.4
    • 3.3

Note

Adds Trino map_agg(key, value) support by rewriting to map_from_arrays(array_agg(key), array_agg(value)) and includes a unit test.

  • Trino function transformation:
    • In fe/fe-core/src/main/java/com/starrocks/connector/parser/trino/ComplexFunctionCallTransformer.java:
      • Add support for map_agg(key, value) -> map_from_arrays(array_agg(key), array_agg(value)) with arg count validation.
  • Tests:
    • In fe/fe-core/src/test/java/com/starrocks/connector/parser/trino/TrinoFunctionTransformTest.java:
      • Add testMapFunction asserting transformation to array_agg('key'), array_agg('value') and map_from_arrays(...).

Written by Cursor Bugbot for commit db8dedd. This will update automatically on new commits. Configure here.


This is an automatic backport of pull request #66673 done by [Mergify](https://mergify.com).

@mergify mergify bot mentioned this pull request Dec 31, 2025
22 tasks
@wanpengfei-git wanpengfei-git enabled auto-merge (squash) December 31, 2025 14:06
@mergify
Copy link
Contributor Author

mergify bot commented Dec 31, 2025

🧪 CI Insights

Here's what we observed from your CI run for 37a81cf.

❌ Job Failures

Pipeline Job Health on branch-3.3 Retries 🔍 CI Insights 📄 Logs
CI PIPELINE - BRANCH RUN CHECKER Unknown 0 View View

auto-merge was automatically disabled December 31, 2025 15:00

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants