jayzhan211 commented on code in PR #9551:
URL: https://github.com/apache/arrow-datafusion/pull/9551#discussion_r1519324182


##########
datafusion/sqllogictest/test_files/aggregate.slt:
##########
@@ -182,7 +182,7 @@ CREATE TABLE array_agg_distinct_list_table AS VALUES
   ('b', [0,1])
 ;
 
-# Apply array_sort to have determinisitic result, higher dimension nested 
array also works but not for array sort,
+# Apply array_sort to have deterministic result, higher dimension nested array 
also works but not for array sort,

Review Comment:
   👍 



##########
datafusion/functions-array/src/udf.rs:
##########
@@ -286,6 +286,70 @@ impl ScalarUDFImpl for ArrayDims {
     }
 }
 
+make_udf_function!(
+    ArraySort,
+    array_sort,
+    array desc null_first,
+    "returns sorted array.",
+    array_sort_udf
+);
+
+#[derive(Debug)]
+pub(super) struct ArraySort {
+    signature: Signature,
+    aliases: Vec<String>,
+}
+
+impl crate::udf::ArraySort {
+    pub fn new() -> Self {
+        Self {
+            signature: Signature::variadic_any(Volatility::Immutable),
+            aliases: vec!["array_sort".to_string(), "list_sort".to_string()],
+        }
+    }
+}
+
+impl ScalarUDFImpl for crate::udf::ArraySort {

Review Comment:
   +1



-- 
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