Skip to content

Commit 4e877a0

Browse files
authored
refactor: make structs public and implement Default trait (apache#14030)
1 parent b2f8e94 commit 4e877a0

18 files changed

+125
-17
lines changed

datafusion/functions-nested/src/cardinality.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,16 @@ impl Cardinality {
7575
)
7676
)]
7777
#[derive(Debug)]
78-
pub(super) struct Cardinality {
78+
pub struct Cardinality {
7979
signature: Signature,
8080
aliases: Vec<String>,
8181
}
82+
83+
impl Default for Cardinality {
84+
fn default() -> Self {
85+
Self::new()
86+
}
87+
}
8288
impl ScalarUDFImpl for Cardinality {
8389
fn as_any(&self) -> &dyn Any {
8490
self

datafusion/functions-nested/src/dimension.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,17 @@ make_udf_expr_and_func!(
6161
)
6262
)]
6363
#[derive(Debug)]
64-
pub(super) struct ArrayDims {
64+
pub struct ArrayDims {
6565
signature: Signature,
6666
aliases: Vec<String>,
6767
}
6868

69+
impl Default for ArrayDims {
70+
fn default() -> Self {
71+
Self::new()
72+
}
73+
}
74+
6975
impl ArrayDims {
7076
pub fn new() -> Self {
7177
Self {

datafusion/functions-nested/src/distance.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,17 @@ make_udf_expr_and_func!(
6767
)
6868
)]
6969
#[derive(Debug)]
70-
pub(super) struct ArrayDistance {
70+
pub struct ArrayDistance {
7171
signature: Signature,
7272
aliases: Vec<String>,
7373
}
7474

75+
impl Default for ArrayDistance {
76+
fn default() -> Self {
77+
Self::new()
78+
}
79+
}
80+
7581
impl ArrayDistance {
7682
pub fn new() -> Self {
7783
Self {

datafusion/functions-nested/src/empty.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,16 @@ make_udf_expr_and_func!(
5656
)
5757
)]
5858
#[derive(Debug)]
59-
pub(super) struct ArrayEmpty {
59+
pub struct ArrayEmpty {
6060
signature: Signature,
6161
aliases: Vec<String>,
6262
}
63+
64+
impl Default for ArrayEmpty {
65+
fn default() -> Self {
66+
Self::new()
67+
}
68+
}
6369
impl ArrayEmpty {
6470
pub fn new() -> Self {
6571
Self {

datafusion/functions-nested/src/except.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,17 @@ make_udf_expr_and_func!(
6767
)
6868
)]
6969
#[derive(Debug)]
70-
pub(super) struct ArrayExcept {
70+
pub struct ArrayExcept {
7171
signature: Signature,
7272
aliases: Vec<String>,
7373
}
7474

75+
impl Default for ArrayExcept {
76+
fn default() -> Self {
77+
Self::new()
78+
}
79+
}
80+
7581
impl ArrayExcept {
7682
pub fn new() -> Self {
7783
Self {

datafusion/functions-nested/src/extract.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,17 @@ make_udf_expr_and_func!(
102102
)
103103
)]
104104
#[derive(Debug)]
105-
pub(super) struct ArrayElement {
105+
pub struct ArrayElement {
106106
signature: Signature,
107107
aliases: Vec<String>,
108108
}
109109

110+
impl Default for ArrayElement {
111+
fn default() -> Self {
112+
Self::new()
113+
}
114+
}
115+
110116
impl ArrayElement {
111117
pub fn new() -> Self {
112118
Self {

datafusion/functions-nested/src/map_extract.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,17 @@ SELECT map_extract(MAP {'x': 10, 'y': NULL, 'z': 30}, 'y');
7272
)
7373
)]
7474
#[derive(Debug)]
75-
pub(super) struct MapExtract {
75+
pub struct MapExtract {
7676
signature: Signature,
7777
aliases: Vec<String>,
7878
}
7979

80+
impl Default for MapExtract {
81+
fn default() -> Self {
82+
Self::new()
83+
}
84+
}
85+
8086
impl MapExtract {
8187
pub fn new() -> Self {
8288
Self {

datafusion/functions-nested/src/map_keys.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,16 @@ SELECT map_keys(map([100, 5], [42, 43]));
5656
)
5757
)]
5858
#[derive(Debug)]
59-
pub(crate) struct MapKeysFunc {
59+
pub struct MapKeysFunc {
6060
signature: Signature,
6161
}
6262

63+
impl Default for MapKeysFunc {
64+
fn default() -> Self {
65+
Self::new()
66+
}
67+
}
68+
6369
impl MapKeysFunc {
6470
pub fn new() -> Self {
6571
Self {

datafusion/functions-nested/src/map_values.rs

+6
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ pub(crate) struct MapValuesFunc {
6060
signature: Signature,
6161
}
6262

63+
impl Default for MapValuesFunc {
64+
fn default() -> Self {
65+
Self::new()
66+
}
67+
}
68+
6369
impl MapValuesFunc {
6470
pub fn new() -> Self {
6571
Self {

datafusion/functions-nested/src/position.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,16 @@ make_udf_expr_and_func!(
7676
argument(name = "index", description = "Index at which to start searching.")
7777
)]
7878
#[derive(Debug)]
79-
pub(super) struct ArrayPosition {
79+
pub struct ArrayPosition {
8080
signature: Signature,
8181
aliases: Vec<String>,
8282
}
83+
84+
impl Default for ArrayPosition {
85+
fn default() -> Self {
86+
Self::new()
87+
}
88+
}
8389
impl ArrayPosition {
8490
pub fn new() -> Self {
8591
Self {

datafusion/functions-nested/src/range.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,16 @@ make_udf_expr_and_func!(
8989
)
9090
)]
9191
#[derive(Debug)]
92-
pub(super) struct Range {
92+
pub struct Range {
9393
signature: Signature,
9494
aliases: Vec<String>,
9595
}
96+
97+
impl Default for Range {
98+
fn default() -> Self {
99+
Self::new()
100+
}
101+
}
96102
impl Range {
97103
pub fn new() -> Self {
98104
Self {

datafusion/functions-nested/src/remove.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,17 @@ make_udf_expr_and_func!(
6464
)
6565
)]
6666
#[derive(Debug)]
67-
pub(super) struct ArrayRemove {
67+
pub struct ArrayRemove {
6868
signature: Signature,
6969
aliases: Vec<String>,
7070
}
7171

72+
impl Default for ArrayRemove {
73+
fn default() -> Self {
74+
Self::new()
75+
}
76+
}
77+
7278
impl ArrayRemove {
7379
pub fn new() -> Self {
7480
Self {

datafusion/functions-nested/src/repeat.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,17 @@ make_udf_expr_and_func!(
7272
)
7373
)]
7474
#[derive(Debug)]
75-
pub(super) struct ArrayRepeat {
75+
pub struct ArrayRepeat {
7676
signature: Signature,
7777
aliases: Vec<String>,
7878
}
7979

80+
impl Default for ArrayRepeat {
81+
fn default() -> Self {
82+
Self::new()
83+
}
84+
}
85+
8086
impl ArrayRepeat {
8187
pub fn new() -> Self {
8288
Self {

datafusion/functions-nested/src/replace.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,17 @@ make_udf_expr_and_func!(ArrayReplaceAll,
7878
argument(name = "to", description = "Final element.")
7979
)]
8080
#[derive(Debug)]
81-
pub(super) struct ArrayReplace {
81+
pub struct ArrayReplace {
8282
signature: Signature,
8383
aliases: Vec<String>,
8484
}
8585

86+
impl Default for ArrayReplace {
87+
fn default() -> Self {
88+
Self::new()
89+
}
90+
}
91+
8692
impl ArrayReplace {
8793
pub fn new() -> Self {
8894
Self {

datafusion/functions-nested/src/resize.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,17 @@ make_udf_expr_and_func!(
6565
)
6666
)]
6767
#[derive(Debug)]
68-
pub(super) struct ArrayResize {
68+
pub struct ArrayResize {
6969
signature: Signature,
7070
aliases: Vec<String>,
7171
}
7272

73+
impl Default for ArrayResize {
74+
fn default() -> Self {
75+
Self::new()
76+
}
77+
}
78+
7379
impl ArrayResize {
7480
pub fn new() -> Self {
7581
Self {

datafusion/functions-nested/src/reverse.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,17 @@ make_udf_expr_and_func!(
5858
)
5959
)]
6060
#[derive(Debug)]
61-
pub(super) struct ArrayReverse {
61+
pub struct ArrayReverse {
6262
signature: Signature,
6363
aliases: Vec<String>,
6464
}
6565

66+
impl Default for ArrayReverse {
67+
fn default() -> Self {
68+
Self::new()
69+
}
70+
}
71+
6672
impl ArrayReverse {
6773
pub fn new() -> Self {
6874
Self {

datafusion/functions-nested/src/set_ops.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,17 @@ make_udf_expr_and_func!(
9090
)
9191
)]
9292
#[derive(Debug)]
93-
pub(super) struct ArrayUnion {
93+
pub struct ArrayUnion {
9494
signature: Signature,
9595
aliases: Vec<String>,
9696
}
9797

98+
impl Default for ArrayUnion {
99+
fn default() -> Self {
100+
Self::new()
101+
}
102+
}
103+
98104
impl ArrayUnion {
99105
pub fn new() -> Self {
100106
Self {

datafusion/functions-nested/src/string.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,17 @@ make_udf_expr_and_func!(
145145
)
146146
)]
147147
#[derive(Debug)]
148-
pub(super) struct ArrayToString {
148+
pub struct ArrayToString {
149149
signature: Signature,
150150
aliases: Vec<String>,
151151
}
152152

153+
impl Default for ArrayToString {
154+
fn default() -> Self {
155+
Self::new()
156+
}
157+
}
158+
153159
impl ArrayToString {
154160
pub fn new() -> Self {
155161
Self {

0 commit comments

Comments
 (0)