From cad39e07e8d215837c9a025bead108a2cb901cc6 Mon Sep 17 00:00:00 2001 From: Dharan Aditya Date: Mon, 6 Jan 2025 17:37:34 +0530 Subject: [PATCH] [Minor] refactor: make ArraySort public for broader access (#14006) * refactor: make ArraySort public for broader access Changes the visibility of the ArraySort struct fromsuper to public. allows broader access to the struct, enabling its use in other modules and promoting better code reuse. * clippy and docs --------- Co-authored-by: Andrew Lamb --- datafusion/functions-nested/src/sort.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/datafusion/functions-nested/src/sort.rs b/datafusion/functions-nested/src/sort.rs index 0c5309e545f7..3f2ad57cbe86 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, } +impl Default for ArraySort { + fn default() -> Self { + Self::new() + } +} + impl ArraySort { pub fn new() -> Self { Self {