Skip to content

Commit

Permalink
refactor: make all udf function impls public
Browse files Browse the repository at this point in the history
  • Loading branch information
universalmind303 committed Apr 1, 2024
1 parent 3b61004 commit af92744
Show file tree
Hide file tree
Showing 36 changed files with 76 additions and 76 deletions.
6 changes: 3 additions & 3 deletions datafusion/functions-array/src/array_has.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ make_udf_function!(ArrayHasAny,
);

#[derive(Debug)]
pub(super) struct ArrayHas {
pub struct ArrayHas {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -121,7 +121,7 @@ impl ScalarUDFImpl for ArrayHas {
}

#[derive(Debug)]
pub(super) struct ArrayHasAll {
pub struct ArrayHasAll {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -178,7 +178,7 @@ impl ScalarUDFImpl for ArrayHasAll {
}

#[derive(Debug)]
pub(super) struct ArrayHasAny {
pub struct ArrayHasAny {
signature: Signature,
aliases: Vec<String>,
}
Expand Down
6 changes: 3 additions & 3 deletions datafusion/functions-array/src/concat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ make_udf_function!(
);

#[derive(Debug)]
pub(super) struct ArrayAppend {
pub struct ArrayAppend {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -99,7 +99,7 @@ make_udf_function!(
);

#[derive(Debug)]
pub(super) struct ArrayPrepend {
pub struct ArrayPrepend {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -152,7 +152,7 @@ make_udf_function!(
);

#[derive(Debug)]
pub(super) struct ArrayConcat {
pub struct ArrayConcat {
signature: Signature,
aliases: Vec<String>,
}
Expand Down
8 changes: 4 additions & 4 deletions datafusion/functions-array/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
#[macro_use]
pub mod macros;

mod array_has;
mod concat;
pub mod array_has;
pub mod concat;
mod kernels;
mod make_array;
pub mod make_array;
mod rewrite;
mod udf;
pub mod udf;
mod utils;

use datafusion_common::Result;
Expand Down
26 changes: 13 additions & 13 deletions datafusion/functions-array/src/udf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ make_udf_function!(ArrayToString,
array_to_string_udf // internal function name
);
#[derive(Debug)]
pub(super) struct ArrayToString {
pub struct ArrayToString {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -98,7 +98,7 @@ make_udf_function!(StringToArray,
string_to_array_udf // internal function name
);
#[derive(Debug)]
pub(super) struct StringToArray {
pub struct StringToArray {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -174,7 +174,7 @@ make_udf_function!(
range_udf
);
#[derive(Debug)]
pub(super) struct Range {
pub struct Range {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -244,7 +244,7 @@ make_udf_function!(
gen_series_udf
);
#[derive(Debug)]
pub(super) struct GenSeries {
pub struct GenSeries {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -315,7 +315,7 @@ make_udf_function!(
);

#[derive(Debug)]
pub(super) struct ArrayDims {
pub struct ArrayDims {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -372,7 +372,7 @@ make_udf_function!(
);

#[derive(Debug)]
pub(super) struct ArraySort {
pub struct ArraySort {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -445,7 +445,7 @@ impl Cardinality {
}

#[derive(Debug)]
pub(super) struct Cardinality {
pub struct Cardinality {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -490,7 +490,7 @@ make_udf_function!(
);

#[derive(Debug)]
pub(super) struct ArrayNdims {
pub struct ArrayNdims {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -544,7 +544,7 @@ make_udf_function!(
);

#[derive(Debug)]
pub(super) struct ArrayEmpty {
pub struct ArrayEmpty {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -597,7 +597,7 @@ make_udf_function!(
array_repeat_udf // internal function name
);
#[derive(Debug)]
pub(super) struct ArrayRepeat {
pub struct ArrayRepeat {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -650,7 +650,7 @@ make_udf_function!(
);

#[derive(Debug)]
pub(super) struct ArrayLength {
pub struct ArrayLength {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -704,7 +704,7 @@ make_udf_function!(
);

#[derive(Debug)]
pub(super) struct Flatten {
pub struct Flatten {
signature: Signature,
aliases: Vec<String>,
}
Expand Down Expand Up @@ -772,7 +772,7 @@ make_udf_function!(
);

#[derive(Debug)]
pub(super) struct ArrayDistinct {
pub struct ArrayDistinct {
signature: Signature,
aliases: Vec<String>,
}
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/core/arrowtypeof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use datafusion_expr::{ScalarUDFImpl, Signature, Volatility};
use std::any::Any;

#[derive(Debug)]
pub(super) struct ArrowTypeOfFunc {
pub struct ArrowTypeOfFunc {
signature: Signature,
}

Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/core/getfield.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use datafusion_expr::{ScalarUDFImpl, Signature, Volatility};
use std::any::Any;

#[derive(Debug)]
pub(super) struct GetFieldFunc {
pub struct GetFieldFunc {
signature: Signature,
}

Expand Down
12 changes: 6 additions & 6 deletions datafusion/functions/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

//! "core" DataFusion functions
mod arrowtypeof;
mod getfield;
mod nullif;
mod nvl;
mod nvl2;
mod r#struct;
pub mod arrowtypeof;
pub mod getfield;
pub mod nullif;
pub mod nvl;
pub mod nvl2;
pub mod r#struct;

// create UDFs
make_udf_function!(nullif::NullIfFunc, NULLIF, nullif);
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/core/nullif.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use datafusion_expr::{ScalarUDFImpl, Signature, Volatility};
use std::any::Any;

#[derive(Debug)]
pub(super) struct NullIfFunc {
pub struct NullIfFunc {
signature: Signature,
}

Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/core/nvl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use datafusion_common::{internal_err, Result};
use datafusion_expr::{ColumnarValue, ScalarUDFImpl, Signature, Volatility};

#[derive(Debug)]
pub(super) struct NVLFunc {
pub struct NVLFunc {
signature: Signature,
aliases: Vec<String>,
}
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/core/nvl2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use datafusion_common::{internal_err, plan_datafusion_err, Result};
use datafusion_expr::{utils, ColumnarValue, ScalarUDFImpl, Signature, Volatility};

#[derive(Debug)]
pub(super) struct NVL2Func {
pub struct NVL2Func {
signature: Signature,
}

Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/core/struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn struct_expr(args: &[ColumnarValue]) -> Result<ColumnarValue> {
Ok(ColumnarValue::Array(array_struct(arrays.as_slice())?))
}
#[derive(Debug)]
pub(super) struct StructFunc {
pub struct StructFunc {
signature: Signature,
}

Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/crypto/digest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use datafusion_expr::{
use std::any::Any;

#[derive(Debug)]
pub(super) struct DigestFunc {
pub struct DigestFunc {
signature: Signature,
}
impl DigestFunc {
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/crypto/md5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use datafusion_expr::{ColumnarValue, ScalarUDFImpl, Signature, Volatility};
use std::any::Any;

#[derive(Debug)]
pub(super) struct Md5Func {
pub struct Md5Func {
signature: Signature,
}
impl Md5Func {
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/crypto/sha224.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use datafusion_expr::{ColumnarValue, ScalarUDFImpl, Signature, Volatility};
use std::any::Any;

#[derive(Debug)]
pub(super) struct SHA224Func {
pub struct SHA224Func {
signature: Signature,
}
impl SHA224Func {
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/crypto/sha256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use datafusion_expr::{ColumnarValue, ScalarUDFImpl, Signature, Volatility};
use std::any::Any;

#[derive(Debug)]
pub(super) struct SHA256Func {
pub struct SHA256Func {
signature: Signature,
}
impl SHA256Func {
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/crypto/sha384.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use datafusion_expr::{ColumnarValue, ScalarUDFImpl, Signature, Volatility};
use std::any::Any;

#[derive(Debug)]
pub(super) struct SHA384Func {
pub struct SHA384Func {
signature: Signature,
}
impl SHA384Func {
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/crypto/sha512.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use datafusion_expr::{ColumnarValue, ScalarUDFImpl, Signature, Volatility};
use std::any::Any;

#[derive(Debug)]
pub(super) struct SHA512Func {
pub struct SHA512Func {
signature: Signature,
}
impl SHA512Func {
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/datetime/current_date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use datafusion_expr::simplify::{ExprSimplifyResult, SimplifyInfo};
use datafusion_expr::{ColumnarValue, Expr, ScalarUDFImpl, Signature, Volatility};

#[derive(Debug)]
pub(super) struct CurrentDateFunc {
pub struct CurrentDateFunc {
signature: Signature,
aliases: Vec<String>,
}
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/datetime/current_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use datafusion_expr::simplify::{ExprSimplifyResult, SimplifyInfo};
use datafusion_expr::{ColumnarValue, Expr, ScalarUDFImpl, Signature, Volatility};

#[derive(Debug)]
pub(super) struct CurrentTimeFunc {
pub struct CurrentTimeFunc {
signature: Signature,
}

Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/datetime/date_bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use datafusion_expr::{
};

#[derive(Debug)]
pub(super) struct DateBinFunc {
pub struct DateBinFunc {
signature: Signature,
}

Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/datetime/date_part.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use datafusion_expr::{
};

#[derive(Debug)]
pub(super) struct DatePartFunc {
pub struct DatePartFunc {
signature: Signature,
aliases: Vec<String>,
}
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/datetime/date_trunc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use datafusion_expr::{
};

#[derive(Debug)]
pub(super) struct DateTruncFunc {
pub struct DateTruncFunc {
signature: Signature,
aliases: Vec<String>,
}
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/datetime/from_unixtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use datafusion_common::{exec_err, Result};
use datafusion_expr::{ColumnarValue, ScalarUDFImpl, Signature, Volatility};

#[derive(Debug)]
pub(super) struct FromUnixtimeFunc {
pub struct FromUnixtimeFunc {
signature: Signature,
}

Expand Down
22 changes: 11 additions & 11 deletions datafusion/functions/src/datetime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ use std::sync::Arc;

use datafusion_expr::ScalarUDF;

mod common;
mod current_date;
mod current_time;
mod date_bin;
mod date_part;
mod date_trunc;
mod from_unixtime;
mod now;
mod to_date;
mod to_timestamp;
mod to_unixtime;
pub mod common;
pub mod current_date;
pub mod current_time;
pub mod date_bin;
pub mod date_part;
pub mod date_trunc;
pub mod from_unixtime;
pub mod now;
pub mod to_date;
pub mod to_timestamp;
pub mod to_unixtime;

// create UDFs
make_udf_function!(current_date::CurrentDateFunc, CURRENT_DATE, current_date);
Expand Down
Loading

0 comments on commit af92744

Please sign in to comment.