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
argument(name = "n", description = "String length to pad to."),
54
+
argument(
55
+
name = "padding_str",
56
+
description = "Optional string expression to pad with. Can be a constant, column, or function, and any combination of string operators. _Default is a space._"
57
+
),
58
+
related_udf(name = "rpad")
59
+
)]
40
60
#[derive(Debug)]
41
61
pubstructLPadFunc{
42
62
signature:Signature,
@@ -103,34 +123,10 @@ impl ScalarUDFImpl for LPadFunc {
"Pads the left side of a string with another string to a specified string length.",
117
-
"lpad(str, n[, padding_str])")
118
-
.with_sql_example(r#"```sql
119
-
> select lpad('Dolly', 10, 'hello');
120
-
+---------------------------------------------+
121
-
| lpad(Utf8("Dolly"),Int64(10),Utf8("hello")) |
122
-
+---------------------------------------------+
123
-
| helloDolly |
124
-
+---------------------------------------------+
125
-
```"#)
126
-
.with_standard_argument("str",Some("String"))
127
-
.with_argument("n","String length to pad to.")
128
-
.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._")
129
-
.with_related_udf("rpad")
130
-
.build()
131
-
})
132
-
}
133
-
134
130
/// Extends the string to length 'length' by prepending the characters fill (a space by default).
135
131
/// If the string is already longer than length then it is truncated (on the right).
description = "Returns the starting position of a specified substring in a string. Positions begin at 1. If the substring does not exist in the string, the function returns 0.",
34
+
syntax_example = "strpos(str, substr)",
35
+
alternative_syntax = "position(substr in origstr)",
"Returns the starting position of a specified substring in a string. Positions begin at 1. If the substring does not exist in the string, the function returns 0.",
93
-
"strpos(str, substr)")
94
-
.with_sql_example(r#"```sql
95
-
> select strpos('datafusion', 'fus');
96
-
+----------------------------------------+
97
-
| strpos(Utf8("datafusion"),Utf8("fus")) |
98
-
+----------------------------------------+
99
-
| 5 |
100
-
+----------------------------------------+
101
-
```"#)
102
-
.with_standard_argument("str",Some("String"))
103
-
.with_argument("substr","Substring expression to search for.")
104
-
.with_alternative_syntax("position(substr in origstr)")
0 commit comments