Skip to content

Commit

Permalink
Improve function documentation (apache#11996)
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb authored Aug 14, 2024
1 parent b9961c3 commit e24a5dd
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 4 deletions.
8 changes: 8 additions & 0 deletions datafusion/functions/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ pub mod expr_fn {
}
}

/// Returns all DataFusion functions defined in this package
pub fn functions() -> Vec<Arc<ScalarUDF>> {
vec![
nullif(),
Expand All @@ -94,6 +95,13 @@ pub fn functions() -> Vec<Arc<ScalarUDF>> {
nvl2(),
arrow_typeof(),
named_struct(),
// Note: most users invoke `get_field` indirectly via field access
// syntax like `my_struct_col['field_name']`, which results in a call to
// `get_field(my_struct_col, "field_name")`.
//
// However, it is also exposed directly for use cases such as
// serializing / deserializing plans with the field access desugared to
// calls to `get_field`
get_field(),
coalesce(),
]
Expand Down
1 change: 1 addition & 0 deletions datafusion/functions/src/crypto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pub mod expr_fn {
));
}

/// Returns all DataFusion functions defined in this package
pub fn functions() -> Vec<Arc<ScalarUDF>> {
vec![digest(), md5(), sha224(), sha256(), sha384(), sha512()]
}
2 changes: 1 addition & 1 deletion datafusion/functions/src/datetime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ pub mod expr_fn {
}
}

/// Return a list of all functions in this package
/// Returns all DataFusion functions defined in this package
pub fn functions() -> Vec<Arc<ScalarUDF>> {
vec![
current_date(),
Expand Down
1 change: 1 addition & 0 deletions datafusion/functions/src/encoding/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub mod expr_fn {
));
}

/// Returns all DataFusion functions defined in this package
pub fn functions() -> Vec<Arc<ScalarUDF>> {
vec![encode(), decode()]
}
1 change: 1 addition & 0 deletions datafusion/functions/src/math/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ pub mod expr_fn {
);
}

/// Returns all DataFusion functions defined in this package
pub fn functions() -> Vec<Arc<ScalarUDF>> {
vec![
abs(),
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/regex/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub mod expr_fn {
}
}

#[doc = r" Return a list of all functions in this package"]
/// Returns all DataFusion functions defined in this package
pub fn functions() -> Vec<std::sync::Arc<datafusion_expr::ScalarUDF>> {
vec![regexp_match(), regexp_like(), regexp_replace()]
}
2 changes: 1 addition & 1 deletion datafusion/functions/src/string/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub mod expr_fn {
}
}

/// Return a list of all functions in this package
/// Returns all DataFusion functions defined in this package
pub fn functions() -> Vec<Arc<ScalarUDF>> {
vec![
ascii(),
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/unicode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub mod expr_fn {
}
}

/// Return a list of all functions in this package
/// Returns all DataFusion functions defined in this package
pub fn functions() -> Vec<Arc<ScalarUDF>> {
vec![
character_length(),
Expand Down

0 comments on commit e24a5dd

Please sign in to comment.