You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description = "Trims the specified trim string from the start and end of a string. If no trim string is provided, all whitespace is removed from the start and end of the input string.",
description = r"String expression to operate on. Can be a constant, column, or function, and any combination of operators. _Default is whitespace characters._"
53
+
),
54
+
alternative_syntax = "trim(BOTH trim_str FROM str)",
55
+
alternative_syntax = "trim(trim_str FROM str)",
56
+
related_udf(name = "ltrim"),
57
+
related_udf(name = "rtrim")
58
+
)]
38
59
#[derive(Debug)]
39
60
pubstructBTrimFunc{
40
61
signature:Signature,
@@ -106,36 +127,10 @@ impl ScalarUDFImpl for BTrimFunc {
"Trims the specified trim string from the start and end of a string. If no trim string is provided, all whitespace is removed from the start and end of the input string.",
120
-
"btrim(str[, trim_str])")
121
-
.with_sql_example(r#"```sql
122
-
> select btrim('__datafusion____', '_');
123
-
+-------------------------------------------+
124
-
| btrim(Utf8("__datafusion____"),Utf8("_")) |
125
-
+-------------------------------------------+
126
-
| datafusion |
127
-
+-------------------------------------------+
128
-
```"#)
129
-
.with_standard_argument("str",Some("String"))
130
-
.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._")
131
-
.with_alternative_syntax("trim(BOTH trim_str FROM str)")
132
-
.with_alternative_syntax("trim(trim_str FROM str)")
133
-
.with_related_udf("ltrim")
134
-
.with_related_udf("rtrim")
135
-
.build()
136
-
})
137
-
}
138
-
139
134
#[cfg(test)]
140
135
mod tests {
141
136
use arrow::array::{Array,StringArray,StringViewArray};
0 commit comments