Skip to content

Apache DataFusion SQL Query Engine

[Minor] refactor: make ArraySort public for broader access (#14006)

Dharan Adityacad39e07e8d2
diff --git a/datafusion/functions-nested/src/sort.rs b/datafusion/functions-nested/src/sort.rs
index 0c5309e545..3f2ad57cbe 100644
--- a/datafusion/functions-nested/src/sort.rs
+++ b/datafusion/functions-nested/src/sort.rs
@@ -40,6 +40,13 @@ make_udf_expr_and_func!(
array_sort_udf
);
+/// Implementation of `array_sort` function
+///
+/// `array_sort` sorts the elements of an array
+///
+/// # Example
+///
+/// `array_sort([3, 1, 2])` returns `[1, 2, 3]`
#[user_doc(
doc_section(label = "Array Functions"),
description = "Sort array.",
@@ -66,11 +73,17 @@ make_udf_expr_and_func!(
)
)]
#[derive(Debug)]
-pub(super) struct ArraySort {
+pub struct ArraySort {
signature: Signature,
aliases: Vec<String>,
}
+impl Default for ArraySort {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl ArraySort {
pub fn new() -> Self {
Self {