Skip to content

[enhance](function) add a lambda functor version for array_sort (#57828)#62830

Open
csun5285 wants to merge 1 commit intoapache:branch-4.1from
csun5285:fix-opensource-324-4.1
Open

[enhance](function) add a lambda functor version for array_sort (#57828)#62830
csun5285 wants to merge 1 commit intoapache:branch-4.1from
csun5285:fix-opensource-324-4.1

Conversation

@csun5285
Copy link
Copy Markdown
Contributor

pick from master #57828

…he#57828)

add a lambda functor version for array_sort

Issue Number: apache#48203

Problem Summary:
```text
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| array_sort((x, y) -> CASE WHEN x IS NULL THEN -1
                                 WHEN y IS NULL THEN 1
                                 WHEN x < y THEN 1
                                 WHEN x = y THEN 0
                                 ELSE -1 END,
                                 [3, 2, null, 5, null, 1, 2]) |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| [null, null, 5, 3, 2, 2, 1]                                                                                                                                                                                                                                                                                               |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| array_sort((x, y) -> IF(length(x) < length(y), -1,  IF(length(x) = length(y), 0, 1)),  ['a', 'abcd', 'abc']) |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ["a", "abc", "abcd"]                                                                                                                                                     |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
@csun5285 csun5285 requested a review from yiguolei as a code owner April 24, 2026 15:33
@Thearas
Copy link
Copy Markdown
Contributor

Thearas commented Apr 24, 2026

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@csun5285
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 0.00% (0/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 54.53% (20063/36791)
Line Coverage 35.53% (181912/512058)
Region Coverage 29.76% (133478/448494)
Branch Coverage 31.31% (59456/189901)

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 15.49% (11/71) 🎉
Increment coverage report
Complete coverage report

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.

4 participants