comphead commented on code in PR #13575:
URL: https://github.com/apache/datafusion/pull/13575#discussion_r1859322809
##########
datafusion/functions/src/string/ltrim.rs:
##########
@@ -35,6 +35,33 @@ fn ltrim<T: OffsetSizeTrait>(args: &[ArrayRef]) ->
Result<ArrayRef> {
general_trim::<T>(args, TrimType::Left, use_string_view)
}
+#[user_doc(
+ doc_section(label = "String Functions"),
+ description = "Trims the specified trim string from the beginning of a
string. If no trim string is provided, all whitespace is removed from the start
of the input string.",
+ syntax_example = "ltrim(str[, trim_str])",
+ sql_example = r#"```sql
+> select ltrim(' datafusion ');
++-------------------------------+
+| ltrim(Utf8(" datafusion ")) |
++-------------------------------+
+| datafusion |
++-------------------------------+
+> select ltrim('___datafusion___', '_');
++-------------------------------------------+
+| ltrim(Utf8("___datafusion___"),Utf8("_")) |
++-------------------------------------------+
+| datafusion___ |
++-------------------------------------------+
+```"#,
+ standard_argument(name = "str", prefix = "String"),
+ argument(
+ name = "trim_str",
+ description = r"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._"
+ ),
+ alternative_syntax = "trim(LEADING trim_str FROM str)",
Review Comment:
@Omega359 `alternative_syntax` and `related_udf` support
--
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]