[
https://issues.apache.org/jira/browse/FLINK-26948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17761316#comment-17761316
]
Jörn Kottmann commented on FLINK-26948:
---------------------------------------
Sorry for the delay, I will try to get the PR ready next week.
> Add SORT_ARRAY supported in SQL & Table API
> -------------------------------------------
>
> Key: FLINK-26948
> URL: https://issues.apache.org/jira/browse/FLINK-26948
> Project: Flink
> Issue Type: Sub-task
> Components: Table SQL / API
> Reporter: dalongliu
> Assignee: Jörn Kottmann
> Priority: Major
> Labels: pull-request-available, stale-assigned
>
> Returns the array in {{expr}} in sorted order.
> Syntax:
> {code:java}
> sort_array(expr [, ascendingOrder] ) {code}
> Arguments:
> * {{{}expr{}}}: An ARRAY expression of sortable elements.
> * {{{}ascendingOrder{}}}: An optional BOOLEAN expression defaulting to
> {{{}true{}}}.
> Returns:
> The result type matches {{{}expr{}}}.
> Sorts the input array in ascending or descending order according to the
> natural ordering of the array elements. {{NULL}} elements are placed at the
> beginning of the returned array in ascending order or at the end of the
> returned array in descending order.
> Examples:
> {code:java}
> > SELECT sort_array(array('b', 'd', NULL, 'c', 'a'), true);
> [NULL,a,b,c,d] {code}
> See more:
> *
> [Spark|https://spark.apache.org/docs/latest/sql-ref-functions-builtin.html#date-and-timestamp-functions]
> * [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)