Skip to content

Commit

Permalink
Make modules public, add Default impl's. (apache#10239)
Browse files Browse the repository at this point in the history
  • Loading branch information
Omega359 authored Apr 26, 2024
1 parent cdbd964 commit 4ec3d51
Show file tree
Hide file tree
Showing 30 changed files with 204 additions and 33 deletions.
7 changes: 7 additions & 0 deletions datafusion/functions/src/string/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ pub fn ascii<T: OffsetSizeTrait>(args: &[ArrayRef]) -> Result<ArrayRef> {
pub struct AsciiFunc {
signature: Signature,
}

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

impl AsciiFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/string/bit_length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ pub struct BitLengthFunc {
signature: Signature,
}

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

impl BitLengthFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/string/btrim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ pub struct BTrimFunc {
aliases: Vec<String>,
}

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

impl BTrimFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/string/chr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ pub struct ChrFunc {
signature: Signature,
}

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

impl ChrFunc {
pub fn new() -> Self {
Self {
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/string/levenshtein.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ pub struct LevenshteinFunc {
signature: Signature,
}

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

impl LevenshteinFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/string/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ pub struct LowerFunc {
signature: Signature,
}

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

impl LowerFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/string/ltrim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ pub struct LtrimFunc {
signature: Signature,
}

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

impl LtrimFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
44 changes: 22 additions & 22 deletions datafusion/functions/src/string/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,28 @@ use std::sync::Arc;

use datafusion_expr::ScalarUDF;

mod ascii;
mod bit_length;
mod btrim;
mod chr;
mod common;
mod concat;
mod concat_ws;
mod ends_with;
mod initcap;
mod levenshtein;
mod lower;
mod ltrim;
mod octet_length;
mod overlay;
mod repeat;
mod replace;
mod rtrim;
mod split_part;
mod starts_with;
mod to_hex;
mod upper;
mod uuid;
pub mod ascii;
pub mod bit_length;
pub mod btrim;
pub mod chr;
pub mod common;
pub mod concat;
pub mod concat_ws;
pub mod ends_with;
pub mod initcap;
pub mod levenshtein;
pub mod lower;
pub mod ltrim;
pub mod octet_length;
pub mod overlay;
pub mod repeat;
pub mod replace;
pub mod rtrim;
pub mod split_part;
pub mod starts_with;
pub mod to_hex;
pub mod upper;
pub mod uuid;

// create UDFs
make_udf_function!(ascii::AsciiFunc, ASCII, ascii);
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/string/octet_length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ pub struct OctetLengthFunc {
signature: Signature,
}

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

impl OctetLengthFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/string/overlay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ pub struct OverlayFunc {
signature: Signature,
}

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

impl OverlayFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/string/repeat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ pub struct RepeatFunc {
signature: Signature,
}

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

impl RepeatFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/string/replace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ pub struct ReplaceFunc {
signature: Signature,
}

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

impl ReplaceFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/string/rtrim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ pub struct RtrimFunc {
signature: Signature,
}

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

impl RtrimFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/string/split_part.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ pub struct SplitPartFunc {
signature: Signature,
}

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

impl SplitPartFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
7 changes: 7 additions & 0 deletions datafusion/functions/src/string/starts_with.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ pub fn starts_with<T: OffsetSizeTrait>(args: &[ArrayRef]) -> Result<ArrayRef> {
pub struct StartsWithFunc {
signature: Signature,
}

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

impl StartsWithFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
7 changes: 7 additions & 0 deletions datafusion/functions/src/string/to_hex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ where
pub struct ToHexFunc {
signature: Signature,
}

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

impl ToHexFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/string/upper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ pub struct UpperFunc {
signature: Signature,
}

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

impl UpperFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/string/uuid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ pub struct UuidFunc {
signature: Signature,
}

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

impl UuidFunc {
pub fn new() -> Self {
Self {
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/unicode/character_length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ pub struct CharacterLengthFunc {
aliases: Vec<String>,
}

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

impl CharacterLengthFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/unicode/find_in_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ pub struct FindInSetFunc {
signature: Signature,
}

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

impl FindInSetFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/unicode/left.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ pub struct LeftFunc {
signature: Signature,
}

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

impl LeftFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/unicode/lpad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ pub struct LPadFunc {
signature: Signature,
}

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

impl LPadFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
22 changes: 11 additions & 11 deletions datafusion/functions/src/unicode/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 character_length;
mod find_in_set;
mod left;
mod lpad;
mod reverse;
mod right;
mod rpad;
mod strpos;
mod substr;
mod substrindex;
mod translate;
pub mod character_length;
pub mod find_in_set;
pub mod left;
pub mod lpad;
pub mod reverse;
pub mod right;
pub mod rpad;
pub mod strpos;
pub mod substr;
pub mod substrindex;
pub mod translate;

// create UDFs
make_udf_function!(
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/unicode/reverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ pub struct ReverseFunc {
signature: Signature,
}

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

impl ReverseFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/unicode/right.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ pub struct RightFunc {
signature: Signature,
}

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

impl RightFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
6 changes: 6 additions & 0 deletions datafusion/functions/src/unicode/rpad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ pub struct RPadFunc {
signature: Signature,
}

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

impl RPadFunc {
pub fn new() -> Self {
use DataType::*;
Expand Down
Loading

0 comments on commit 4ec3d51

Please sign in to comment.