Skip to content

Commit

Permalink
refactor: make all udf function impls public (#9903) (#10107)
Browse files Browse the repository at this point in the history
* refactor: make all udf function impls public

* clippy

Co-authored-by: universalmind303 <[email protected]>
  • Loading branch information
alamb and universalmind303 authored Apr 17, 2024
1 parent 9b0f4e2 commit 1f71d79
Show file tree
Hide file tree
Showing 58 changed files with 1,191 additions and 105 deletions.
24 changes: 21 additions & 3 deletions datafusion/functions-array/src/array_has.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,17 @@ make_udf_function!(ArrayHasAny,
);

#[derive(Debug)]
pub(super) struct ArrayHas {
pub struct ArrayHas {
signature: Signature,
aliases: Vec<String>,
}

impl Default for ArrayHas {
fn default() -> Self {
Self::new()
}
}

impl ArrayHas {
pub fn new() -> Self {
Self {
Expand Down Expand Up @@ -121,11 +127,17 @@ impl ScalarUDFImpl for ArrayHas {
}

#[derive(Debug)]
pub(super) struct ArrayHasAll {
pub struct ArrayHasAll {
signature: Signature,
aliases: Vec<String>,
}

impl Default for ArrayHasAll {
fn default() -> Self {
Self::new()
}
}

impl ArrayHasAll {
pub fn new() -> Self {
Self {
Expand Down Expand Up @@ -178,11 +190,17 @@ impl ScalarUDFImpl for ArrayHasAll {
}

#[derive(Debug)]
pub(super) struct ArrayHasAny {
pub struct ArrayHasAny {
signature: Signature,
aliases: Vec<String>,
}

impl Default for ArrayHasAny {
fn default() -> Self {
Self::new()
}
}

impl ArrayHasAny {
pub fn new() -> Self {
Self {
Expand Down
24 changes: 21 additions & 3 deletions datafusion/functions-array/src/concat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,17 @@ make_udf_function!(
);

#[derive(Debug)]
pub(super) struct ArrayAppend {
pub struct ArrayAppend {
signature: Signature,
aliases: Vec<String>,
}

impl Default for ArrayAppend {
fn default() -> Self {
Self::new()
}
}

impl ArrayAppend {
pub fn new() -> Self {
Self {
Expand Down Expand Up @@ -99,11 +105,17 @@ make_udf_function!(
);

#[derive(Debug)]
pub(super) struct ArrayPrepend {
pub struct ArrayPrepend {
signature: Signature,
aliases: Vec<String>,
}

impl Default for ArrayPrepend {
fn default() -> Self {
Self::new()
}
}

impl ArrayPrepend {
pub fn new() -> Self {
Self {
Expand Down Expand Up @@ -152,11 +164,17 @@ make_udf_function!(
);

#[derive(Debug)]
pub(super) struct ArrayConcat {
pub struct ArrayConcat {
signature: Signature,
aliases: Vec<String>,
}

impl Default for ArrayConcat {
fn default() -> Self {
Self::new()
}
}

impl ArrayConcat {
pub fn new() -> Self {
Self {
Expand Down
44 changes: 22 additions & 22 deletions datafusion/functions-array/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,28 @@
#[macro_use]
pub mod macros;

mod array_has;
mod cardinality;
mod concat;
mod dimension;
mod empty;
mod except;
mod extract;
mod flatten;
mod length;
mod make_array;
mod position;
mod range;
mod remove;
mod repeat;
mod replace;
mod resize;
mod reverse;
mod rewrite;
mod set_ops;
mod sort;
mod string;
mod utils;
pub mod array_has;
pub mod cardinality;
pub mod concat;
pub mod dimension;
pub mod empty;
pub mod except;
pub mod extract;
pub mod flatten;
pub mod length;
pub mod make_array;
pub mod position;
pub mod range;
pub mod remove;
pub mod repeat;
pub mod replace;
pub mod resize;
pub mod reverse;
pub mod rewrite;
pub mod set_ops;
pub mod sort;
pub mod string;
pub mod utils;

use datafusion_common::Result;
use datafusion_execution::FunctionRegistry;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions-array/src/make_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ pub struct MakeArray {
aliases: Vec<String>,
}

impl Default for MakeArray {
fn default() -> Self {
Self::new()
}
}

impl MakeArray {
pub fn new() -> Self {
Self {
Expand Down
Loading

0 comments on commit 1f71d79

Please sign in to comment.