hanyuzheng7 commented on code in PR #22951:
URL: https://github.com/apache/flink/pull/22951#discussion_r1489798277


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/BuiltInFunctionDefinitions.java:
##########
@@ -231,6 +232,21 @@ ANY, and(logical(LogicalTypeRoot.BOOLEAN), LITERAL)
                             
"org.apache.flink.table.runtime.functions.scalar.ArrayContainsFunction")
                     .build();
 
+    public static final BuiltInFunctionDefinition ARRAY_SORT =
+            BuiltInFunctionDefinition.newBuilder()
+                    .name("ARRAY_SORT")
+                    .kind(SCALAR)
+                    .inputTypeStrategy(
+                            or(
+                                    sequence(new 
ArrayComparableElementArgumentTypeStrategy()),
+                                    sequence(
+                                            new 
ArrayComparableElementArgumentTypeStrategy(),
+                                            logical(LogicalTypeRoot.BOOLEAN))))

Review Comment:
   The updated function signature is now `ARRAY_SORT(<array>,[, 
<sort_ascending>[, <nulls_first>]])`, where both sort_ascending and nulls_first 
parameters are optional, allowing for more flexibility in array sorting 
behavior.
   
   The description like this
   
   `The function sorts an array with ascending_order and null_first as optional 
inputs. By default, with only the input array, both are true, resulting in 
ascending order sorting with NULLs at the beginning. Specifying ascending_order 
without null_first results in sorting where true for ascending_order places 
NULLs first, and false places NULLs last. With all three inputs, null_first 
true places NULLs at the start, and false at the end, regardless of 
ascending_order's value. If any input is null, the function returns null.`
   
   
   @MartijnVisser @dawidwys 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to