Jefffrey commented on code in PR #24134:
URL: https://github.com/apache/datafusion/pull/24134#discussion_r3726322201
##########
datafusion/functions-nested/src/length.rs:
##########
@@ -62,7 +62,7 @@ make_udf_expr_and_func!(
name = "array",
description = "Array expression. Can be a constant, column, or
function, and any combination of array operators."
),
- argument(name = "dimension", description = "Array dimension.")
+ argument(name = "dimension", description = "Array dimension. Default is 1")
Review Comment:
i was thinking of modifying the doc macro to be able to specific optional
args, and then possibly create the `syntax_example` automatically, but not sure
how to get the name of the function from the macro
##########
datafusion/functions-nested/src/dimension.rs:
##########
@@ -122,7 +122,7 @@ make_udf_expr_and_func!(
#[user_doc(
doc_section(label = "Array Functions"),
description = "Returns the number of dimensions of the array.",
- syntax_example = "array_ndims(array, element)",
Review Comment:
is there some way to automate checking the arguments match? not likely 🤔
##########
datafusion/doc/src/udf.rs:
##########
@@ -84,6 +84,14 @@ pub mod scalar_doc_sections {
r#"Apache DataFusion uses a
[PCRE-like](https://en.wikibooks.org/wiki/Regular_Expressions/Perl-Compatible_Regular_Expressions)
regular expression [syntax](https://docs.rs/regex/latest/regex/#syntax)
(minus support for several features including look-around and backreferences).
+
+The following flags are optionally supported in functions:
Review Comment:
instead of having this defined per regex function, better to have it in one
place they can then refer to
##########
datafusion/functions-nested/src/array_has.rs:
##########
@@ -994,22 +994,22 @@ fn array_has_any_with_scalar_general(
#[user_doc(
doc_section(label = "Array Functions"),
- description = "Returns true if all elements of sub-array exist in array.",
- syntax_example = "array_has_all(array, sub-array)",
+ description = "Returns true if all elements of sub_array exist in array.",
+ syntax_example = "array_has_all(array, sub_array)",
sql_example = r#"```sql
> select array_has_all([1, 2, 3, 4], [2, 3]);
-+--------------------------------------------+
++---------------------------------------------+
| array_has_all(List([1,2,3,4]), List([2,3])) |
-+--------------------------------------------+
-| true |
-+--------------------------------------------+
++---------------------------------------------+
+| true |
++---------------------------------------------+
```"#,
argument(
name = "array",
description = "Array expression. Can be a constant, column, or
function, and any combination of array operators."
),
argument(
- name = "sub-array",
+ name = "sub_array",
Review Comment:
maybe we need a way to standardize the names? `sub-array` doesnt render as
well on the site, so prefer sticking to underscores
##########
datafusion/functions-nested/src/array_has.rs:
##########
@@ -994,22 +994,22 @@ fn array_has_any_with_scalar_general(
#[user_doc(
doc_section(label = "Array Functions"),
- description = "Returns true if all elements of sub-array exist in array.",
- syntax_example = "array_has_all(array, sub-array)",
+ description = "Returns true if all elements of sub_array exist in array.",
+ syntax_example = "array_has_all(array, sub_array)",
sql_example = r#"```sql
> select array_has_all([1, 2, 3, 4], [2, 3]);
-+--------------------------------------------+
++---------------------------------------------+
| array_has_all(List([1,2,3,4]), List([2,3])) |
-+--------------------------------------------+
-| true |
-+--------------------------------------------+
++---------------------------------------------+
+| true |
Review Comment:
i do wonder if we can find a way to format these tables? theres more out
there that were unaligned
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]