jayzhan211 commented on code in PR #10700:
URL: https://github.com/apache/datafusion/pull/10700#discussion_r1623300318
##########
datafusion/functions/src/string/mod.rs:
##########
@@ -70,117 +70,98 @@ make_udf_function!(uuid::UuidFunc, UUID, uuid);
pub mod expr_fn {
use datafusion_expr::Expr;
- #[doc = "Returns the numeric code of the first character of the argument."]
- pub fn ascii(arg1: Expr) -> Expr {
- super::ascii().call(vec![arg1])
- }
-
- #[doc = "Returns the number of bits in the `string`"]
- pub fn bit_length(arg: Expr) -> Expr {
- super::bit_length().call(vec![arg])
- }
+ export_functions!((
+ ascii,
+ "Returns the numeric code of the first character of the argument.",
+ arg1
+ ),(
+ bit_length,
+ "Returns the number of bits in the `string`",
+ arg1
+ ),(
+ btrim,
+ "Removes all characters, spaces by default, from both sides of a
string",
+ args,
+ ),(
+ chr,
+ "Converts the Unicode code point to a UTF8 character",
+ arg1
+ ),(
+ concat,
+ "Concatenates the text representations of all the arguments. NULL
arguments are ignored",
+ args,
+ ),(
+ ends_with,
+ "Returns true if the `string` ends with the `suffix`, false
otherwise.",
+ string suffix
+ ),(
+ initcap,
+ "Converts the first letter of each word in `string` in uppercase and
the remaining characters in lowercase",
+ string
+ ),(
+ levenshtein,
+ "Returns the Levenshtein distance between the two given strings",
+ arg1 arg2
+ ),(
+ lower,
+ "Converts a string to lowercase.",
+ arg1
+ ),(
+ ltrim,
+ "Removes all characters, spaces by default, from the beginning of a
string",
+ args,
+ ),(
+ octet_length,
+ "returns the number of bytes of a string",
+ args
+ ),(
+ overlay,
+ "replace the substring of string that starts at the start'th character
and extends for count characters with new substring",
+ args,
+ ),(
+ repeat,
+ "Repeats the `string` to `n` times",
+ string n
+ ),(
+ replace,
+ "Replaces all occurrences of `from` with `to` in the `string`",
+ string from to
+ ),(
+ rtrim,
+ "Removes all characters, spaces by default, from the end of a string",
+ args,
+ ),(
+ split_part,
+ "Splits a string based on a delimiter and picks out the desired field
based on the index.",
+ string delimiter index
+ ),(
+ starts_with,
+ "Returns true if string starts with prefix.",
+ arg1 arg2
+ ),(
+ to_hex,
+ "Converts an integer to a hexadecimal string.",
+ arg1
+ ),(
+ upper,
+ "Converts a string to uppercase.",
+ arg1
+ ),(
+ uuid,
+ "returns uuid v4 as a string value",
+ ));
#[doc = "Removes all characters, spaces by default, from both sides of a
string"]
- pub fn btrim(args: Vec<Expr>) -> Expr {
+ pub fn trim(args: Vec<Expr>) -> Expr {
Review Comment:
Is this rename intended?
--
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]