From e9584bc46ffc574cd65044d4199966402def1d15 Mon Sep 17 00:00:00 2001 From: Jonathan Chen <86070045+jonathanc-n@users.noreply.github.com> Date: Sun, 20 Oct 2024 16:20:01 -0400 Subject: [PATCH] Added expresion to "with_standard_argument" (#12926) * Added default value to 'with_standard_argument' * small fix * change function * small changes * with_argument change * ran build * small fix --- datafusion/expr/src/udf_docs.rs | 22 ++++++---- .../src/approx_distinct.rs | 2 +- .../functions-aggregate/src/approx_median.rs | 2 +- .../src/approx_percentile_cont.rs | 2 +- .../src/approx_percentile_cont_with_weight.rs | 2 +- .../functions-aggregate/src/array_agg.rs | 2 +- datafusion/functions-aggregate/src/average.rs | 2 +- .../functions-aggregate/src/bit_and_or_xor.rs | 6 +-- .../functions-aggregate/src/bool_and_or.rs | 4 +- .../functions-aggregate/src/correlation.rs | 4 +- datafusion/functions-aggregate/src/count.rs | 2 +- .../functions-aggregate/src/covariance.rs | 8 ++-- .../functions-aggregate/src/first_last.rs | 4 +- datafusion/functions-aggregate/src/median.rs | 2 +- datafusion/functions-aggregate/src/min_max.rs | 4 +- .../functions-aggregate/src/nth_value.rs | 2 +- datafusion/functions-aggregate/src/stddev.rs | 4 +- datafusion/functions-aggregate/src/sum.rs | 2 +- .../functions-aggregate/src/variance.rs | 4 +- datafusion/functions/src/crypto/digest.rs | 2 +- datafusion/functions/src/crypto/md5.rs | 2 +- datafusion/functions/src/crypto/sha224.rs | 2 +- datafusion/functions/src/crypto/sha256.rs | 2 +- datafusion/functions/src/crypto/sha384.rs | 2 +- datafusion/functions/src/datetime/to_date.rs | 2 +- datafusion/functions/src/math/abs.rs | 2 +- datafusion/functions/src/math/factorial.rs | 2 +- datafusion/functions/src/math/gcd.rs | 4 +- datafusion/functions/src/math/iszero.rs | 2 +- datafusion/functions/src/math/lcm.rs | 4 +- datafusion/functions/src/math/log.rs | 4 +- datafusion/functions/src/math/monotonicity.rs | 44 +++++++++---------- datafusion/functions/src/math/nans.rs | 2 +- datafusion/functions/src/math/power.rs | 4 +- datafusion/functions/src/math/round.rs | 2 +- datafusion/functions/src/math/signum.rs | 2 +- datafusion/functions/src/math/trunc.rs | 2 +- datafusion/functions/src/regex/regexpcount.rs | 4 +- datafusion/functions/src/regex/regexplike.rs | 4 +- datafusion/functions/src/regex/regexpmatch.rs | 2 +- .../functions/src/regex/regexpreplace.rs | 4 +- datafusion/functions/src/string/ascii.rs | 2 +- datafusion/functions/src/string/bit_length.rs | 2 +- datafusion/functions/src/string/btrim.rs | 2 +- datafusion/functions/src/string/chr.rs | 2 +- datafusion/functions/src/string/concat.rs | 2 +- datafusion/functions/src/string/concat_ws.rs | 7 +-- datafusion/functions/src/string/contains.rs | 2 +- datafusion/functions/src/string/ends_with.rs | 2 +- datafusion/functions/src/string/initcap.rs | 2 +- datafusion/functions/src/string/lower.rs | 2 +- datafusion/functions/src/string/ltrim.rs | 2 +- .../functions/src/string/octet_length.rs | 2 +- datafusion/functions/src/string/overlay.rs | 2 +- datafusion/functions/src/string/repeat.rs | 2 +- datafusion/functions/src/string/replace.rs | 6 +-- datafusion/functions/src/string/rtrim.rs | 2 +- datafusion/functions/src/string/split_part.rs | 2 +- .../functions/src/string/starts_with.rs | 2 +- datafusion/functions/src/string/to_hex.rs | 2 +- datafusion/functions/src/string/upper.rs | 2 +- .../functions/src/unicode/character_length.rs | 2 +- datafusion/functions/src/unicode/left.rs | 2 +- datafusion/functions/src/unicode/lpad.rs | 2 +- datafusion/functions/src/unicode/reverse.rs | 2 +- datafusion/functions/src/unicode/right.rs | 2 +- datafusion/functions/src/unicode/rpad.rs | 2 +- datafusion/functions/src/unicode/strpos.rs | 2 +- datafusion/functions/src/unicode/substr.rs | 2 +- .../functions/src/unicode/substrindex.rs | 2 +- datafusion/functions/src/unicode/translate.rs | 2 +- .../user-guide/sql/aggregate_functions_new.md | 2 +- .../user-guide/sql/scalar_functions_new.md | 4 +- 73 files changed, 129 insertions(+), 126 deletions(-) diff --git a/datafusion/expr/src/udf_docs.rs b/datafusion/expr/src/udf_docs.rs index 8e255566606c..63d1a964345d 100644 --- a/datafusion/expr/src/udf_docs.rs +++ b/datafusion/expr/src/udf_docs.rs @@ -147,23 +147,29 @@ impl DocumentationBuilder { /// Add a standard "expression" argument to the documentation /// - /// This is similar to [`Self::with_argument`] except that a standard - /// description is appended to the end: `"Can be a constant, column, or - /// function, and any combination of arithmetic operators."` - /// - /// The argument is rendered like + /// The argument is rendered like below if Some() is passed through: /// /// ```text /// : /// expression to operate on. Can be a constant, column, or function, and any combination of operators. /// ``` + /// + /// The argument is rendered like below if None is passed through: + /// + /// ```text + /// : + /// The expression to operate on. Can be a constant, column, or function, and any combination of operators. + /// ``` pub fn with_standard_argument( self, arg_name: impl Into, - expression_type: impl AsRef, + expression_type: Option<&str>, ) -> Self { - let expression_type = expression_type.as_ref(); - self.with_argument(arg_name, format!("{expression_type} expression to operate on. Can be a constant, column, or function, and any combination of operators.")) + let description = format!( + "{} expression to operate on. Can be a constant, column, or function, and any combination of operators.", + expression_type.unwrap_or("The") + ); + self.with_argument(arg_name, description) } pub fn with_related_udf(mut self, related_udf: impl Into) -> Self { diff --git a/datafusion/functions-aggregate/src/approx_distinct.rs b/datafusion/functions-aggregate/src/approx_distinct.rs index d6cc711147b5..1df106feb4d3 100644 --- a/datafusion/functions-aggregate/src/approx_distinct.rs +++ b/datafusion/functions-aggregate/src/approx_distinct.rs @@ -332,7 +332,7 @@ fn get_approx_distinct_doc() -> &'static Documentation { +-----------------------------------+ ```"#, ) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .build() .unwrap() }) diff --git a/datafusion/functions-aggregate/src/approx_median.rs b/datafusion/functions-aggregate/src/approx_median.rs index 84442fa5a2e6..96609622a51e 100644 --- a/datafusion/functions-aggregate/src/approx_median.rs +++ b/datafusion/functions-aggregate/src/approx_median.rs @@ -145,7 +145,7 @@ fn get_approx_median_doc() -> &'static Documentation { +-----------------------------------+ ```"#, ) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .build() .unwrap() }) diff --git a/datafusion/functions-aggregate/src/approx_percentile_cont.rs b/datafusion/functions-aggregate/src/approx_percentile_cont.rs index 9b8a99e977d2..83b9f714fa89 100644 --- a/datafusion/functions-aggregate/src/approx_percentile_cont.rs +++ b/datafusion/functions-aggregate/src/approx_percentile_cont.rs @@ -293,7 +293,7 @@ fn get_approx_percentile_cont_doc() -> &'static Documentation { | 65.0 | +-------------------------------------------------+ ```"#) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .with_argument("percentile", "Percentile to compute. Must be a float value between 0 and 1 (inclusive).") .with_argument("centroids", "Number of centroids to use in the t-digest algorithm. _Default is 100_. A higher number results in more accurate approximation but requires more memory.") .build() diff --git a/datafusion/functions-aggregate/src/approx_percentile_cont_with_weight.rs b/datafusion/functions-aggregate/src/approx_percentile_cont_with_weight.rs index a5362713a6fb..b86fec1e037e 100644 --- a/datafusion/functions-aggregate/src/approx_percentile_cont_with_weight.rs +++ b/datafusion/functions-aggregate/src/approx_percentile_cont_with_weight.rs @@ -179,7 +179,7 @@ fn get_approx_percentile_cont_with_weight_doc() -> &'static Documentation { +----------------------------------------------------------------------+ ```"#, ) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .with_argument("weight", "Expression to use as weight. Can be a constant, column, or function, and any combination of arithmetic operators.") .with_argument("percentile", "Percentile to compute. Must be a float value between 0 and 1 (inclusive).") .build() diff --git a/datafusion/functions-aggregate/src/array_agg.rs b/datafusion/functions-aggregate/src/array_agg.rs index 28ff6fb346e5..6f523756832e 100644 --- a/datafusion/functions-aggregate/src/array_agg.rs +++ b/datafusion/functions-aggregate/src/array_agg.rs @@ -168,7 +168,7 @@ fn get_array_agg_doc() -> &'static Documentation { +-----------------------------------------------+ ```"#, ) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .build() .unwrap() }) diff --git a/datafusion/functions-aggregate/src/average.rs b/datafusion/functions-aggregate/src/average.rs index 8782f8cfcc7c..67b824c2ea79 100644 --- a/datafusion/functions-aggregate/src/average.rs +++ b/datafusion/functions-aggregate/src/average.rs @@ -263,7 +263,7 @@ fn get_avg_doc() -> &'static Documentation { +---------------------------+ ```"#, ) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .build() .unwrap() }) diff --git a/datafusion/functions-aggregate/src/bit_and_or_xor.rs b/datafusion/functions-aggregate/src/bit_and_or_xor.rs index c5382c168f17..0a281ad81467 100644 --- a/datafusion/functions-aggregate/src/bit_and_or_xor.rs +++ b/datafusion/functions-aggregate/src/bit_and_or_xor.rs @@ -142,7 +142,7 @@ fn get_bit_and_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_GENERAL) .with_description("Computes the bitwise AND of all non-null input values.") .with_syntax_example("bit_and(expression)") - .with_standard_argument("expression", "Integer") + .with_standard_argument("expression", Some("Integer")) .build() .unwrap() }) @@ -156,7 +156,7 @@ fn get_bit_or_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_GENERAL) .with_description("Computes the bitwise OR of all non-null input values.") .with_syntax_example("bit_or(expression)") - .with_standard_argument("expression", "Integer") + .with_standard_argument("expression", Some("Integer")) .build() .unwrap() }) @@ -172,7 +172,7 @@ fn get_bit_xor_doc() -> &'static Documentation { "Computes the bitwise exclusive OR of all non-null input values.", ) .with_syntax_example("bit_xor(expression)") - .with_standard_argument("expression", "Integer") + .with_standard_argument("expression", Some("Integer")) .build() .unwrap() }) diff --git a/datafusion/functions-aggregate/src/bool_and_or.rs b/datafusion/functions-aggregate/src/bool_and_or.rs index 63ad1ea573d5..b410bfa139e9 100644 --- a/datafusion/functions-aggregate/src/bool_and_or.rs +++ b/datafusion/functions-aggregate/src/bool_and_or.rs @@ -201,7 +201,7 @@ fn get_bool_and_doc() -> &'static Documentation { +----------------------------+ ```"#, ) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .build() .unwrap() }) @@ -350,7 +350,7 @@ fn get_bool_or_doc() -> &'static Documentation { +----------------------------+ ```"#, ) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .build() .unwrap() }) diff --git a/datafusion/functions-aggregate/src/correlation.rs b/datafusion/functions-aggregate/src/correlation.rs index d5dc482d68d2..40429289d768 100644 --- a/datafusion/functions-aggregate/src/correlation.rs +++ b/datafusion/functions-aggregate/src/correlation.rs @@ -134,8 +134,8 @@ fn get_corr_doc() -> &'static Documentation { +--------------------------------+ ```"#, ) - .with_standard_argument("expression1", "First") - .with_standard_argument("expression2", "Second") + .with_standard_argument("expression1", Some("First")) + .with_standard_argument("expression2", Some("Second")) .build() .unwrap() }) diff --git a/datafusion/functions-aggregate/src/count.rs b/datafusion/functions-aggregate/src/count.rs index 2511c70c4608..61dbfd674993 100644 --- a/datafusion/functions-aggregate/src/count.rs +++ b/datafusion/functions-aggregate/src/count.rs @@ -357,7 +357,7 @@ fn get_count_doc() -> &'static Documentation { | 120 | +------------------+ ```"#) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .build() .unwrap() }) diff --git a/datafusion/functions-aggregate/src/covariance.rs b/datafusion/functions-aggregate/src/covariance.rs index f3b323d74d30..4b2b21059d16 100644 --- a/datafusion/functions-aggregate/src/covariance.rs +++ b/datafusion/functions-aggregate/src/covariance.rs @@ -150,8 +150,8 @@ fn get_covar_samp_doc() -> &'static Documentation { +-----------------------------------+ ```"#, ) - .with_standard_argument("expression1", "First") - .with_standard_argument("expression2", "Second") + .with_standard_argument("expression1", Some("First")) + .with_standard_argument("expression2", Some("Second")) .build() .unwrap() }) @@ -248,8 +248,8 @@ fn get_covar_pop_doc() -> &'static Documentation { +-----------------------------------+ ```"#, ) - .with_standard_argument("expression1", "First") - .with_standard_argument("expression2", "Second") + .with_standard_argument("expression1", Some("First")) + .with_standard_argument("expression2", Some("Second")) .build() .unwrap() }) diff --git a/datafusion/functions-aggregate/src/first_last.rs b/datafusion/functions-aggregate/src/first_last.rs index 2a3fc623657a..c708d23ae6c5 100644 --- a/datafusion/functions-aggregate/src/first_last.rs +++ b/datafusion/functions-aggregate/src/first_last.rs @@ -191,7 +191,7 @@ fn get_first_value_doc() -> &'static Documentation { +-----------------------------------------------+ ```"#, ) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .build() .unwrap() }) @@ -519,7 +519,7 @@ fn get_last_value_doc() -> &'static Documentation { +-----------------------------------------------+ ```"#, ) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .build() .unwrap() }) diff --git a/datafusion/functions-aggregate/src/median.rs b/datafusion/functions-aggregate/src/median.rs index 5a0cac2c829e..e0011e2e0f69 100644 --- a/datafusion/functions-aggregate/src/median.rs +++ b/datafusion/functions-aggregate/src/median.rs @@ -177,7 +177,7 @@ fn get_median_doc() -> &'static Documentation { +----------------------+ ```"#, ) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .build() .unwrap() }) diff --git a/datafusion/functions-aggregate/src/min_max.rs b/datafusion/functions-aggregate/src/min_max.rs index d576b1fdad78..8102d0e4794b 100644 --- a/datafusion/functions-aggregate/src/min_max.rs +++ b/datafusion/functions-aggregate/src/min_max.rs @@ -357,7 +357,7 @@ fn get_max_doc() -> &'static Documentation { +----------------------+ ```"#, ) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .build() .unwrap() }) @@ -1187,7 +1187,7 @@ fn get_min_doc() -> &'static Documentation { +----------------------+ ```"#, ) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .build() .unwrap() }) diff --git a/datafusion/functions-aggregate/src/nth_value.rs b/datafusion/functions-aggregate/src/nth_value.rs index 6d8cea8f0531..3e7f51af5265 100644 --- a/datafusion/functions-aggregate/src/nth_value.rs +++ b/datafusion/functions-aggregate/src/nth_value.rs @@ -191,7 +191,7 @@ fn get_nth_value_doc() -> &'static Documentation { | 2 | 45000 | 45000 | +---------+--------+-------------------------+ ```"#) - .with_standard_argument("expression", "The column or expression to retrieve the nth value from.") + .with_argument("expression", "The column or expression to retrieve the nth value from.") .with_argument("n", "The position (nth) of the value to retrieve, based on the ordering.") .build() .unwrap() diff --git a/datafusion/functions-aggregate/src/stddev.rs b/datafusion/functions-aggregate/src/stddev.rs index 332a8efcc0f9..0d1821687524 100644 --- a/datafusion/functions-aggregate/src/stddev.rs +++ b/datafusion/functions-aggregate/src/stddev.rs @@ -158,7 +158,7 @@ fn get_stddev_doc() -> &'static Documentation { +----------------------+ ```"#, ) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .build() .unwrap() }) @@ -282,7 +282,7 @@ fn get_stddev_pop_doc() -> &'static Documentation { +--------------------------+ ```"#, ) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .build() .unwrap() }) diff --git a/datafusion/functions-aggregate/src/sum.rs b/datafusion/functions-aggregate/src/sum.rs index 3b561f3028de..943f66a92c00 100644 --- a/datafusion/functions-aggregate/src/sum.rs +++ b/datafusion/functions-aggregate/src/sum.rs @@ -260,7 +260,7 @@ fn get_sum_doc() -> &'static Documentation { +-----------------------+ ```"#, ) - .with_standard_argument("expression", "The") + .with_standard_argument("expression", None) .build() .unwrap() }) diff --git a/datafusion/functions-aggregate/src/variance.rs b/datafusion/functions-aggregate/src/variance.rs index 49a30344c212..8453c9d3010b 100644 --- a/datafusion/functions-aggregate/src/variance.rs +++ b/datafusion/functions-aggregate/src/variance.rs @@ -153,7 +153,7 @@ fn get_variance_sample_doc() -> &'static Documentation { "Returns the statistical sample variance of a set of numbers.", ) .with_syntax_example("var(expression)") - .with_standard_argument("expression", "Numeric") + .with_standard_argument("expression", Some("Numeric")) .build() .unwrap() }) @@ -259,7 +259,7 @@ fn get_variance_population_doc() -> &'static Documentation { "Returns the statistical population variance of a set of numbers.", ) .with_syntax_example("var_pop(expression)") - .with_standard_argument("expression", "Numeric") + .with_standard_argument("expression", Some("Numeric")) .build() .unwrap() }) diff --git a/datafusion/functions/src/crypto/digest.rs b/datafusion/functions/src/crypto/digest.rs index 9ec07b1cab53..0e43fb7785df 100644 --- a/datafusion/functions/src/crypto/digest.rs +++ b/datafusion/functions/src/crypto/digest.rs @@ -98,7 +98,7 @@ fn get_digest_doc() -> &'static Documentation { ```"#, ) .with_standard_argument( - "expression", "String") + "expression", Some("String")) .with_argument( "algorithm", "String expression specifying algorithm to use. Must be one of: diff --git a/datafusion/functions/src/crypto/md5.rs b/datafusion/functions/src/crypto/md5.rs index f273c9d28c23..062d63bcc018 100644 --- a/datafusion/functions/src/crypto/md5.rs +++ b/datafusion/functions/src/crypto/md5.rs @@ -112,7 +112,7 @@ fn get_md5_doc() -> &'static Documentation { +-------------------------------------+ ```"#, ) - .with_standard_argument("expression", "String") + .with_standard_argument("expression", Some("String")) .build() .unwrap() }) diff --git a/datafusion/functions/src/crypto/sha224.rs b/datafusion/functions/src/crypto/sha224.rs index 868c8cdc3558..39202d5bf691 100644 --- a/datafusion/functions/src/crypto/sha224.rs +++ b/datafusion/functions/src/crypto/sha224.rs @@ -68,7 +68,7 @@ fn get_sha224_doc() -> &'static Documentation { +------------------------------------------+ ```"#, ) - .with_standard_argument("expression", "String") + .with_standard_argument("expression", Some("String")) .build() .unwrap() }) diff --git a/datafusion/functions/src/crypto/sha256.rs b/datafusion/functions/src/crypto/sha256.rs index 99a470efbc1f..74deb3fc6caa 100644 --- a/datafusion/functions/src/crypto/sha256.rs +++ b/datafusion/functions/src/crypto/sha256.rs @@ -92,7 +92,7 @@ fn get_sha256_doc() -> &'static Documentation { +--------------------------------------+ ```"#, ) - .with_standard_argument("expression", "String") + .with_standard_argument("expression", Some("String")) .build() .unwrap() }) diff --git a/datafusion/functions/src/crypto/sha384.rs b/datafusion/functions/src/crypto/sha384.rs index afe2db7478f7..9b1e1ba9ec3c 100644 --- a/datafusion/functions/src/crypto/sha384.rs +++ b/datafusion/functions/src/crypto/sha384.rs @@ -92,7 +92,7 @@ fn get_sha384_doc() -> &'static Documentation { +-----------------------------------------+ ```"#, ) - .with_standard_argument("expression", "String") + .with_standard_argument("expression", Some("String")) .build() .unwrap() }) diff --git a/datafusion/functions/src/datetime/to_date.rs b/datafusion/functions/src/datetime/to_date.rs index b21fe995cea6..82e189698c5e 100644 --- a/datafusion/functions/src/datetime/to_date.rs +++ b/datafusion/functions/src/datetime/to_date.rs @@ -111,7 +111,7 @@ Note: `to_date` returns Date32, which represents its values as the number of day Additional examples can be found [here](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/to_date.rs) "#) - .with_standard_argument("expression", "String") + .with_standard_argument("expression", Some("String")) .with_argument( "format_n", "Optional [Chrono format](https://docs.rs/chrono/latest/chrono/format/strftime/index.html) strings to use to parse the expression. Formats will be tried in the order diff --git a/datafusion/functions/src/math/abs.rs b/datafusion/functions/src/math/abs.rs index 5dcbb99eae65..5511a57d8566 100644 --- a/datafusion/functions/src/math/abs.rs +++ b/datafusion/functions/src/math/abs.rs @@ -201,7 +201,7 @@ fn get_abs_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the absolute value of a number.") .with_syntax_example("abs(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) diff --git a/datafusion/functions/src/math/factorial.rs b/datafusion/functions/src/math/factorial.rs index ac04c03190ae..4b87284744d3 100644 --- a/datafusion/functions/src/math/factorial.rs +++ b/datafusion/functions/src/math/factorial.rs @@ -85,7 +85,7 @@ fn get_factorial_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Factorial. Returns 1 if value is less than 2.") .with_syntax_example("factorial(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) diff --git a/datafusion/functions/src/math/gcd.rs b/datafusion/functions/src/math/gcd.rs index 5e56dacb9380..f4edef3acca3 100644 --- a/datafusion/functions/src/math/gcd.rs +++ b/datafusion/functions/src/math/gcd.rs @@ -87,8 +87,8 @@ fn get_gcd_doc() -> &'static Documentation { "Returns the greatest common divisor of `expression_x` and `expression_y`. Returns 0 if both inputs are zero.", ) .with_syntax_example("gcd(expression_x, expression_y)") - .with_standard_argument("expression_x", "First numeric") - .with_standard_argument("expression_y", "Second numeric") + .with_standard_argument("expression_x", Some("First numeric")) + .with_standard_argument("expression_y", Some("Second numeric")) .build() .unwrap() }) diff --git a/datafusion/functions/src/math/iszero.rs b/datafusion/functions/src/math/iszero.rs index b8deee2c6125..7e5d4fe77ffa 100644 --- a/datafusion/functions/src/math/iszero.rs +++ b/datafusion/functions/src/math/iszero.rs @@ -90,7 +90,7 @@ fn get_iszero_doc() -> &'static Documentation { "Returns true if a given number is +0.0 or -0.0 otherwise returns false.", ) .with_syntax_example("iszero(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) diff --git a/datafusion/functions/src/math/lcm.rs b/datafusion/functions/src/math/lcm.rs index 844dbfd39d38..64b07ce606f2 100644 --- a/datafusion/functions/src/math/lcm.rs +++ b/datafusion/functions/src/math/lcm.rs @@ -88,8 +88,8 @@ fn get_lcm_doc() -> &'static Documentation { "Returns the least common multiple of `expression_x` and `expression_y`. Returns 0 if either input is zero.", ) .with_syntax_example("lcm(expression_x, expression_y)") - .with_standard_argument("expression_x", "First numeric") - .with_standard_argument("expression_y", "Second numeric") + .with_standard_argument("expression_x", Some("First numeric")) + .with_standard_argument("expression_y", Some("Second numeric")) .build() .unwrap() }) diff --git a/datafusion/functions/src/math/log.rs b/datafusion/functions/src/math/log.rs index 07ff8e2166ff..89ba14e32ba0 100644 --- a/datafusion/functions/src/math/log.rs +++ b/datafusion/functions/src/math/log.rs @@ -57,8 +57,8 @@ fn get_log_doc() -> &'static Documentation { .with_description("Returns the base-x logarithm of a number. Can either provide a specified base, or if omitted then takes the base-10 of a number.") .with_syntax_example(r#"log(base, numeric_expression) log(numeric_expression)"#) - .with_standard_argument("base", "Base numeric") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("base", Some("Base numeric")) + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) diff --git a/datafusion/functions/src/math/monotonicity.rs b/datafusion/functions/src/math/monotonicity.rs index 959434d74f82..19c85f4b6e3c 100644 --- a/datafusion/functions/src/math/monotonicity.rs +++ b/datafusion/functions/src/math/monotonicity.rs @@ -46,7 +46,7 @@ pub fn get_acos_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the arc cosine or inverse cosine of a number.") .with_syntax_example("acos(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -79,7 +79,7 @@ pub fn get_acosh_doc() -> &'static Documentation { "Returns the area hyperbolic cosine or inverse hyperbolic cosine of a number.", ) .with_syntax_example("acosh(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -108,7 +108,7 @@ pub fn get_asin_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the arc sine or inverse sine of a number.") .with_syntax_example("asin(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -129,7 +129,7 @@ pub fn get_asinh_doc() -> &'static Documentation { "Returns the area hyperbolic sine or inverse hyperbolic sine of a number.", ) .with_syntax_example("asinh(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -148,7 +148,7 @@ pub fn get_atan_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the arc tangent or inverse tangent of a number.") .with_syntax_example("atan(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -179,7 +179,7 @@ pub fn get_atanh_doc() -> &'static Documentation { "Returns the area hyperbolic tangent or inverse hyperbolic tangent of a number.", ) .with_syntax_example("atanh(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -223,7 +223,7 @@ pub fn get_cbrt_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the cube root of a number.") .with_syntax_example("cbrt(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -244,7 +244,7 @@ pub fn get_ceil_doc() -> &'static Documentation { "Returns the nearest integer greater than or equal to a number.", ) .with_syntax_example("ceil(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -265,7 +265,7 @@ pub fn get_cos_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the cosine of a number.") .with_syntax_example("cos(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -295,7 +295,7 @@ pub fn get_cosh_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the hyperbolic cosine of a number.") .with_syntax_example("cosh(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -314,7 +314,7 @@ pub fn get_degrees_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Converts radians to degrees.") .with_syntax_example("degrees(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -333,7 +333,7 @@ pub fn get_exp_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the base-e exponential of a number.") .with_syntax_example("exp(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -354,7 +354,7 @@ pub fn get_floor_doc() -> &'static Documentation { "Returns the nearest integer less than or equal to a number.", ) .with_syntax_example("floor(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -382,7 +382,7 @@ pub fn get_ln_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the natural logarithm of a number.") .with_syntax_example("ln(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -410,7 +410,7 @@ pub fn get_log2_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the base-2 logarithm of a number.") .with_syntax_example("log2(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -438,7 +438,7 @@ pub fn get_log10_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the base-10 logarithm of a number.") .with_syntax_example("log10(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -457,7 +457,7 @@ pub fn get_radians_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Converts degrees to radians.") .with_syntax_example("radians(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -478,7 +478,7 @@ pub fn get_sin_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the sine of a number.") .with_syntax_example("sin(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -497,7 +497,7 @@ pub fn get_sinh_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the hyperbolic sine of a number.") .with_syntax_example("sinh(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -525,7 +525,7 @@ pub fn get_sqrt_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the square root of a number.") .with_syntax_example("sqrt(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -546,7 +546,7 @@ pub fn get_tan_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the tangent of a number.") .with_syntax_example("tan(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) @@ -565,7 +565,7 @@ pub fn get_tanh_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Returns the hyperbolic tangent of a number.") .with_syntax_example("tanh(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) diff --git a/datafusion/functions/src/math/nans.rs b/datafusion/functions/src/math/nans.rs index 79e4587958dc..c1dd1aacc35a 100644 --- a/datafusion/functions/src/math/nans.rs +++ b/datafusion/functions/src/math/nans.rs @@ -107,7 +107,7 @@ fn get_isnan_doc() -> &'static Documentation { "Returns true if a given number is +NaN or -NaN otherwise returns false.", ) .with_syntax_example("isnan(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) diff --git a/datafusion/functions/src/math/power.rs b/datafusion/functions/src/math/power.rs index a99afaec97f7..9125f9b0fecd 100644 --- a/datafusion/functions/src/math/power.rs +++ b/datafusion/functions/src/math/power.rs @@ -181,8 +181,8 @@ fn get_power_doc() -> &'static Documentation { "Returns a base expression raised to the power of an exponent.", ) .with_syntax_example("power(base, exponent)") - .with_standard_argument("base", "Numeric") - .with_standard_argument("exponent", "Exponent numeric") + .with_standard_argument("base", Some("Numeric")) + .with_standard_argument("exponent", Some("Exponent numeric")) .build() .unwrap() }) diff --git a/datafusion/functions/src/math/round.rs b/datafusion/functions/src/math/round.rs index ae8eee0dbba2..fec1f1ce1aee 100644 --- a/datafusion/functions/src/math/round.rs +++ b/datafusion/functions/src/math/round.rs @@ -114,7 +114,7 @@ fn get_round_doc() -> &'static Documentation { .with_doc_section(DOC_SECTION_MATH) .with_description("Rounds a number to the nearest integer.") .with_syntax_example("round(numeric_expression[, decimal_places])") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .with_argument( "decimal_places", "Optional. The number of decimal places to round to. Defaults to 0.", diff --git a/datafusion/functions/src/math/signum.rs b/datafusion/functions/src/math/signum.rs index 6c020b0ce52a..ac881eb42f26 100644 --- a/datafusion/functions/src/math/signum.rs +++ b/datafusion/functions/src/math/signum.rs @@ -101,7 +101,7 @@ Negative numbers return `-1`. Zero and positive numbers return `1`."#, ) .with_syntax_example("signum(numeric_expression)") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .build() .unwrap() }) diff --git a/datafusion/functions/src/math/trunc.rs b/datafusion/functions/src/math/trunc.rs index 17a84420318e..9a05684d238e 100644 --- a/datafusion/functions/src/math/trunc.rs +++ b/datafusion/functions/src/math/trunc.rs @@ -119,7 +119,7 @@ fn get_trunc_doc() -> &'static Documentation { "Truncates a number to a whole number or truncated to the specified decimal places.", ) .with_syntax_example("trunc(numeric_expression[, decimal_places])") - .with_standard_argument("numeric_expression", "Numeric") + .with_standard_argument("numeric_expression", Some("Numeric")) .with_argument("decimal_places", r#"Optional. The number of decimal places to truncate to. Defaults to 0 (truncate to a whole number). If `decimal_places` is a positive integer, truncates digits to the diff --git a/datafusion/functions/src/regex/regexpcount.rs b/datafusion/functions/src/regex/regexpcount.rs index 880c91094555..7f7896ecd923 100644 --- a/datafusion/functions/src/regex/regexpcount.rs +++ b/datafusion/functions/src/regex/regexpcount.rs @@ -127,8 +127,8 @@ fn get_regexp_count_doc() -> &'static Documentation { | 1 | +---------------------------------------------------------------+ ```"#) - .with_standard_argument("str", "String") - .with_standard_argument("regexp","Regular") + .with_standard_argument("str", Some("String")) + .with_standard_argument("regexp",Some("Regular")) .with_argument("start", "- **start**: Optional start position (the first position is 1) to search for the regular expression. Can be a constant, column, or function.") .with_argument("flags", r#"Optional regular expression flags that control the behavior of the regular expression. The following flags are supported: diff --git a/datafusion/functions/src/regex/regexplike.rs b/datafusion/functions/src/regex/regexplike.rs index aad67e4ecab6..13de7888aa5f 100644 --- a/datafusion/functions/src/regex/regexplike.rs +++ b/datafusion/functions/src/regex/regexplike.rs @@ -67,8 +67,8 @@ SELECT regexp_like('aBc', '(b|d)', 'i'); ``` Additional examples can be found [here](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/regexp.rs) "#) - .with_standard_argument("str", "String") - .with_standard_argument("regexp","Regular") + .with_standard_argument("str", Some("String")) + .with_standard_argument("regexp", Some("Regular")) .with_argument("flags", r#"Optional regular expression flags that control the behavior of the regular expression. The following flags are supported: - **i**: case-insensitive: letters match both upper and lower case diff --git a/datafusion/functions/src/regex/regexpmatch.rs b/datafusion/functions/src/regex/regexpmatch.rs index a458b205f4e3..019666bd7b2d 100644 --- a/datafusion/functions/src/regex/regexpmatch.rs +++ b/datafusion/functions/src/regex/regexpmatch.rs @@ -137,7 +137,7 @@ fn get_regexp_match_doc() -> &'static Documentation { ``` Additional examples can be found [here](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/regexp.rs) "#) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("regexp","Regular expression to match against. Can be a constant, column, or function.") .with_argument("flags", diff --git a/datafusion/functions/src/regex/regexpreplace.rs b/datafusion/functions/src/regex/regexpreplace.rs index 279e5c6ba9dd..4d8e5e5fe3e3 100644 --- a/datafusion/functions/src/regex/regexpreplace.rs +++ b/datafusion/functions/src/regex/regexpreplace.rs @@ -154,10 +154,10 @@ SELECT regexp_replace('aBc', '(b|d)', 'Ab\\1a', 'i'); ``` Additional examples can be found [here](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/regexp.rs) "#) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("regexp","Regular expression to match against. Can be a constant, column, or function.") - .with_standard_argument("replacement", "Replacement string") + .with_standard_argument("replacement", Some("Replacement string")) .with_argument("flags", r#"Optional regular expression flags that control the behavior of the regular expression. The following flags are supported: - **g**: (global) Search globally and don't return after the first match diff --git a/datafusion/functions/src/string/ascii.rs b/datafusion/functions/src/string/ascii.rs index 8d61661f97b8..b76d70d7e9d2 100644 --- a/datafusion/functions/src/string/ascii.rs +++ b/datafusion/functions/src/string/ascii.rs @@ -99,7 +99,7 @@ fn get_ascii_doc() -> &'static Documentation { +-------------------+ ```"#, ) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_related_udf("chr") .build() .unwrap() diff --git a/datafusion/functions/src/string/bit_length.rs b/datafusion/functions/src/string/bit_length.rs index 7d162e7d411b..25b56341fcaa 100644 --- a/datafusion/functions/src/string/bit_length.rs +++ b/datafusion/functions/src/string/bit_length.rs @@ -107,7 +107,7 @@ fn get_bit_length_doc() -> &'static Documentation { +--------------------------------+ ```"#, ) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_related_udf("length") .with_related_udf("octet_length") .build() diff --git a/datafusion/functions/src/string/btrim.rs b/datafusion/functions/src/string/btrim.rs index 82b7599f0735..f689f27d9d24 100644 --- a/datafusion/functions/src/string/btrim.rs +++ b/datafusion/functions/src/string/btrim.rs @@ -122,7 +122,7 @@ fn get_btrim_doc() -> &'static Documentation { | datafusion | +-------------------------------------------+ ```"#) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("trim_str", "String expression to operate on. Can be a constant, column, or function, and any combination of operators. _Default is whitespace characters._") .with_related_udf("ltrim") .with_related_udf("rtrim") diff --git a/datafusion/functions/src/string/chr.rs b/datafusion/functions/src/string/chr.rs index ae0900af37d3..0d94cab08d91 100644 --- a/datafusion/functions/src/string/chr.rs +++ b/datafusion/functions/src/string/chr.rs @@ -125,7 +125,7 @@ fn get_chr_doc() -> &'static Documentation { +--------------------+ ```"#, ) - .with_standard_argument("expression", "String") + .with_standard_argument("expression", Some("String")) .with_related_udf("ascii") .build() .unwrap() diff --git a/datafusion/functions/src/string/concat.rs b/datafusion/functions/src/string/concat.rs index 33a926863a4a..a4218c39e7b2 100644 --- a/datafusion/functions/src/string/concat.rs +++ b/datafusion/functions/src/string/concat.rs @@ -270,7 +270,7 @@ fn get_concat_doc() -> &'static Documentation { +-------------------------------------------------------+ ```"#, ) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("str_n", "Subsequent string expressions to concatenate.") .with_related_udf("concat_ws") .build() diff --git a/datafusion/functions/src/string/concat_ws.rs b/datafusion/functions/src/string/concat_ws.rs index 17361b073315..8d966f495663 100644 --- a/datafusion/functions/src/string/concat_ws.rs +++ b/datafusion/functions/src/string/concat_ws.rs @@ -295,11 +295,8 @@ fn get_concat_ws_doc() -> &'static Documentation { "separator", "Separator to insert between concatenated strings.", ) - .with_standard_argument("str", "String") - .with_standard_argument( - "str_n", - "Subsequent string expressions to concatenate.", - ) + .with_standard_argument("str", Some("String")) + .with_argument("str_n", "Subsequent string expressions to concatenate.") .with_related_udf("concat") .build() .unwrap() diff --git a/datafusion/functions/src/string/contains.rs b/datafusion/functions/src/string/contains.rs index 86f1eda03342..d0e63bb0f353 100644 --- a/datafusion/functions/src/string/contains.rs +++ b/datafusion/functions/src/string/contains.rs @@ -95,7 +95,7 @@ fn get_contains_doc() -> &'static Documentation { +---------------------------------------------------+ ```"#, ) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("search_str", "The string to search for in str.") .build() .unwrap() diff --git a/datafusion/functions/src/string/ends_with.rs b/datafusion/functions/src/string/ends_with.rs index 8c90cbc3b146..88978a35c0b7 100644 --- a/datafusion/functions/src/string/ends_with.rs +++ b/datafusion/functions/src/string/ends_with.rs @@ -103,7 +103,7 @@ fn get_ends_with_doc() -> &'static Documentation { +--------------------------------------------+ ```"#, ) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("substr", "Substring to test for.") .build() .unwrap() diff --git a/datafusion/functions/src/string/initcap.rs b/datafusion/functions/src/string/initcap.rs index 78c95b9a5e35..5fd1e7929881 100644 --- a/datafusion/functions/src/string/initcap.rs +++ b/datafusion/functions/src/string/initcap.rs @@ -96,7 +96,7 @@ fn get_initcap_doc() -> &'static Documentation { | Apache Datafusion | +------------------------------------+ ```"#) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_related_udf("lower") .with_related_udf("upper") .build() diff --git a/datafusion/functions/src/string/lower.rs b/datafusion/functions/src/string/lower.rs index f82b11ca9051..b07189a832dc 100644 --- a/datafusion/functions/src/string/lower.rs +++ b/datafusion/functions/src/string/lower.rs @@ -89,7 +89,7 @@ fn get_lower_doc() -> &'static Documentation { +-------------------------+ ```"#, ) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_related_udf("initcap") .with_related_udf("upper") .build() diff --git a/datafusion/functions/src/string/ltrim.rs b/datafusion/functions/src/string/ltrim.rs index b64dcda7218e..91809d691647 100644 --- a/datafusion/functions/src/string/ltrim.rs +++ b/datafusion/functions/src/string/ltrim.rs @@ -122,7 +122,7 @@ fn get_ltrim_doc() -> &'static Documentation { | datafusion___ | +-------------------------------------------+ ```"#) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("trim_str", "String expression to trim from the beginning of the input string. Can be a constant, column, or function, and any combination of arithmetic operators. _Default is whitespace characters._") .with_related_udf("btrim") .with_related_udf("rtrim") diff --git a/datafusion/functions/src/string/octet_length.rs b/datafusion/functions/src/string/octet_length.rs index 04094396fadc..2ac2bf70da23 100644 --- a/datafusion/functions/src/string/octet_length.rs +++ b/datafusion/functions/src/string/octet_length.rs @@ -110,7 +110,7 @@ fn get_octet_length_doc() -> &'static Documentation { +--------------------------------+ ```"#, ) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_related_udf("bit_length") .with_related_udf("length") .build() diff --git a/datafusion/functions/src/string/overlay.rs b/datafusion/functions/src/string/overlay.rs index 3b31bc360851..796776304f4a 100644 --- a/datafusion/functions/src/string/overlay.rs +++ b/datafusion/functions/src/string/overlay.rs @@ -108,7 +108,7 @@ fn get_overlay_doc() -> &'static Documentation { | Thomas | +--------------------------------------------------------+ ```"#) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("substr", "Substring to replace in str.") .with_argument("pos", "The start position to start the replace in str.") .with_argument("count", "The count of characters to be replaced from start position of str. If not specified, will use substr length instead.") diff --git a/datafusion/functions/src/string/repeat.rs b/datafusion/functions/src/string/repeat.rs index 7364c7d36f10..aa69f9c6609a 100644 --- a/datafusion/functions/src/string/repeat.rs +++ b/datafusion/functions/src/string/repeat.rs @@ -107,7 +107,7 @@ fn get_repeat_doc() -> &'static Documentation { +-------------------------------+ ```"#, ) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("n", "Number of times to repeat the input string.") .build() .unwrap() diff --git a/datafusion/functions/src/string/replace.rs b/datafusion/functions/src/string/replace.rs index 612cd7276bab..91abc39da058 100644 --- a/datafusion/functions/src/string/replace.rs +++ b/datafusion/functions/src/string/replace.rs @@ -96,9 +96,9 @@ fn get_replace_doc() -> &'static Documentation { | ABcdbaBA | +-------------------------------------------------+ ```"#) - .with_standard_argument("str", "String") - .with_standard_argument("substr", "Substring expression to replace in the input string. Substring expression") - .with_standard_argument("replacement", "Replacement substring") + .with_standard_argument("str", Some("String")) + .with_standard_argument("substr", Some("Substring expression to replace in the input string. Substring")) + .with_standard_argument("replacement", Some("Replacement substring")) .build() .unwrap() }) diff --git a/datafusion/functions/src/string/rtrim.rs b/datafusion/functions/src/string/rtrim.rs index 1a27502a2082..06c8a85c38dd 100644 --- a/datafusion/functions/src/string/rtrim.rs +++ b/datafusion/functions/src/string/rtrim.rs @@ -122,7 +122,7 @@ fn get_rtrim_doc() -> &'static Documentation { | ___datafusion | +-------------------------------------------+ ```"#) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("trim_str", "String expression to trim from the end of the input string. Can be a constant, column, or function, and any combination of arithmetic operators. _Default is whitespace characters._") .with_related_udf("btrim") .with_related_udf("ltrim") diff --git a/datafusion/functions/src/string/split_part.rs b/datafusion/functions/src/string/split_part.rs index cea3b0890f9b..ea01cb1f56f9 100644 --- a/datafusion/functions/src/string/split_part.rs +++ b/datafusion/functions/src/string/split_part.rs @@ -198,7 +198,7 @@ fn get_split_part_doc() -> &'static Documentation { | 3 | +--------------------------------------------------+ ```"#) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("delimiter", "String or character to split on.") .with_argument("pos", "Position of the part to return.") .build() diff --git a/datafusion/functions/src/string/starts_with.rs b/datafusion/functions/src/string/starts_with.rs index 713b642d5e91..dce161a2e14b 100644 --- a/datafusion/functions/src/string/starts_with.rs +++ b/datafusion/functions/src/string/starts_with.rs @@ -102,7 +102,7 @@ fn get_starts_with_doc() -> &'static Documentation { +----------------------------------------------+ ```"#, ) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("substr", "Substring to test for.") .build() .unwrap() diff --git a/datafusion/functions/src/string/to_hex.rs b/datafusion/functions/src/string/to_hex.rs index 72cd4fbffa33..e0033d2d1cb0 100644 --- a/datafusion/functions/src/string/to_hex.rs +++ b/datafusion/functions/src/string/to_hex.rs @@ -134,7 +134,7 @@ fn get_to_hex_doc() -> &'static Documentation { +-------------------------+ ```"#, ) - .with_standard_argument("int", "Integer") + .with_standard_argument("int", Some("Integer")) .build() .unwrap() }) diff --git a/datafusion/functions/src/string/upper.rs b/datafusion/functions/src/string/upper.rs index bfcb2a86994d..042c26b2e3da 100644 --- a/datafusion/functions/src/string/upper.rs +++ b/datafusion/functions/src/string/upper.rs @@ -88,7 +88,7 @@ fn get_upper_doc() -> &'static Documentation { +---------------------------+ ```"#, ) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_related_udf("initcap") .with_related_udf("lower") .build() diff --git a/datafusion/functions/src/unicode/character_length.rs b/datafusion/functions/src/unicode/character_length.rs index 6e74135b6028..7858a59664d3 100644 --- a/datafusion/functions/src/unicode/character_length.rs +++ b/datafusion/functions/src/unicode/character_length.rs @@ -103,7 +103,7 @@ fn get_character_length_doc() -> &'static Documentation { +------------------------------------+ ```"#, ) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_related_udf("bit_length") .with_related_udf("octet_length") .build() diff --git a/datafusion/functions/src/unicode/left.rs b/datafusion/functions/src/unicode/left.rs index 6610cfb25e79..a6c2b9768f0b 100644 --- a/datafusion/functions/src/unicode/left.rs +++ b/datafusion/functions/src/unicode/left.rs @@ -115,7 +115,7 @@ fn get_left_doc() -> &'static Documentation { | data | +-----------------------------------+ ```"#) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("n", "Number of characters to return.") .with_related_udf("right") .build() diff --git a/datafusion/functions/src/unicode/lpad.rs b/datafusion/functions/src/unicode/lpad.rs index 948afd050cdb..767eda203c8f 100644 --- a/datafusion/functions/src/unicode/lpad.rs +++ b/datafusion/functions/src/unicode/lpad.rs @@ -119,7 +119,7 @@ fn get_lpad_doc() -> &'static Documentation { | helloDolly | +---------------------------------------------+ ```"#) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("n", "String length to pad to.") .with_argument("padding_str", "Optional string expression to pad with. Can be a constant, column, or function, and any combination of string operators. _Default is a space._") .with_related_udf("rpad") diff --git a/datafusion/functions/src/unicode/reverse.rs b/datafusion/functions/src/unicode/reverse.rs index 32872c28a613..baf3b56636e2 100644 --- a/datafusion/functions/src/unicode/reverse.rs +++ b/datafusion/functions/src/unicode/reverse.rs @@ -105,7 +105,7 @@ fn get_reverse_doc() -> &'static Documentation { +-----------------------------+ ```"#, ) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .build() .unwrap() }) diff --git a/datafusion/functions/src/unicode/right.rs b/datafusion/functions/src/unicode/right.rs index 585611fe60e4..ab3b7ba1a27e 100644 --- a/datafusion/functions/src/unicode/right.rs +++ b/datafusion/functions/src/unicode/right.rs @@ -115,7 +115,7 @@ fn get_right_doc() -> &'static Documentation { | fusion | +------------------------------------+ ```"#) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("n", "Number of characters to return") .with_related_udf("left") .build() diff --git a/datafusion/functions/src/unicode/rpad.rs b/datafusion/functions/src/unicode/rpad.rs index fd4c1ee6fe38..bd9d625105e9 100644 --- a/datafusion/functions/src/unicode/rpad.rs +++ b/datafusion/functions/src/unicode/rpad.rs @@ -140,7 +140,7 @@ fn get_rpad_doc() -> &'static Documentation { ```"#) .with_standard_argument( "str", - "String", + Some("String"), ) .with_argument("n", "String length to pad to.") .with_argument("padding_str", diff --git a/datafusion/functions/src/unicode/strpos.rs b/datafusion/functions/src/unicode/strpos.rs index e4696e4e5c3f..152623b0e5dc 100644 --- a/datafusion/functions/src/unicode/strpos.rs +++ b/datafusion/functions/src/unicode/strpos.rs @@ -95,7 +95,7 @@ fn get_strpos_doc() -> &'static Documentation { | 5 | +----------------------------------------+ ```"#) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("substr", "Substring expression to search for.") .build() .unwrap() diff --git a/datafusion/functions/src/unicode/substr.rs b/datafusion/functions/src/unicode/substr.rs index 4e0c293577b9..5a8c2500900b 100644 --- a/datafusion/functions/src/unicode/substr.rs +++ b/datafusion/functions/src/unicode/substr.rs @@ -170,7 +170,7 @@ fn get_substr_doc() -> &'static Documentation { | fus | +----------------------------------------------+ ```"#) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("start_pos", "Character position to start the substring at. The first character in the string has a position of 1.") .with_argument("length", "Number of characters to extract. If not specified, returns the rest of the string after the start position.") .build() diff --git a/datafusion/functions/src/unicode/substrindex.rs b/datafusion/functions/src/unicode/substrindex.rs index 436d554a49f7..c04839783f58 100644 --- a/datafusion/functions/src/unicode/substrindex.rs +++ b/datafusion/functions/src/unicode/substrindex.rs @@ -115,7 +115,7 @@ If count is negative, everything to the right of the final delimiter (counting f | org | +----------------------------------------------------------+ ```"#) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("delim", "The string to find in str to split str.") .with_argument("count", "The number of times to search for the delimiter. Can be either a positive or negative number.") .build() diff --git a/datafusion/functions/src/unicode/translate.rs b/datafusion/functions/src/unicode/translate.rs index cbee9a6fe1f2..fa626b396b3b 100644 --- a/datafusion/functions/src/unicode/translate.rs +++ b/datafusion/functions/src/unicode/translate.rs @@ -101,7 +101,7 @@ fn get_translate_doc() -> &'static Documentation { | there | +--------------------------------------------------+ ```"#) - .with_standard_argument("str", "String") + .with_standard_argument("str", Some("String")) .with_argument("chars", "Characters to translate.") .with_argument("translation", "Translation characters. Translation characters replace only characters at the same position in the **chars** string.") .build() diff --git a/docs/source/user-guide/sql/aggregate_functions_new.md b/docs/source/user-guide/sql/aggregate_functions_new.md index 6c9d9b043fa6..24ef313f3d49 100644 --- a/docs/source/user-guide/sql/aggregate_functions_new.md +++ b/docs/source/user-guide/sql/aggregate_functions_new.md @@ -562,7 +562,7 @@ nth_value(expression, n ORDER BY expression) #### Arguments -- **expression**: The column or expression to retrieve the nth value from. expression to operate on. Can be a constant, column, or function, and any combination of operators. +- **expression**: The column or expression to retrieve the nth value from. - **n**: The position (nth) of the value to retrieve, based on the ordering. #### Example diff --git a/docs/source/user-guide/sql/scalar_functions_new.md b/docs/source/user-guide/sql/scalar_functions_new.md index ac6e56a44c10..1f4ec1c27858 100644 --- a/docs/source/user-guide/sql/scalar_functions_new.md +++ b/docs/source/user-guide/sql/scalar_functions_new.md @@ -908,7 +908,7 @@ concat_ws(separator, str[, ..., str_n]) - **separator**: Separator to insert between concatenated strings. - **str**: String expression to operate on. Can be a constant, column, or function, and any combination of operators. -- **str_n**: Subsequent string expressions to concatenate. expression to operate on. Can be a constant, column, or function, and any combination of operators. +- **str_n**: Subsequent string expressions to concatenate. #### Example @@ -1250,7 +1250,7 @@ replace(str, substr, replacement) #### Arguments - **str**: String expression to operate on. Can be a constant, column, or function, and any combination of operators. -- **substr**: Substring expression to replace in the input string. Substring expression expression to operate on. Can be a constant, column, or function, and any combination of operators. +- **substr**: Substring expression to replace in the input string. Substring expression to operate on. Can be a constant, column, or function, and any combination of operators. - **replacement**: Replacement substring expression to operate on. Can be a constant, column, or function, and any combination of operators. #### Example