docs: improve expressions.md#5978
Conversation
alamb
left a comment
There was a problem hiding this comment.
Thank you @izveigor ❤️
I am not sure if you are interested or have time, but I wonder if you are interested in a project like #3092
(basically I think it would require some non trivial rearrangement of the function definitions so the metadata was defined in a struct rather than a bunch of match statements).
| | left(text, number) | Returns a certain number (`number`) of first characters (`text`). Example: `left('like', 2) -> li` | | ||
| | length(text) | Returns number of characters in the string (`text`). The same as `character_length` and `char_length`. Example: `length('lion') -> 4` | | ||
| | lower(text) | Converts all characters in the string (`text`) into lower case. Example: `lower('HELLO') -> hello` | | ||
| | lpad(text, length, [, fill]) | Extends the string to length (`lenght`) by prepending the characters (`fill`) (a space by default). Example: `lpad('bb', 5, 'a') → aaabb` | |
There was a problem hiding this comment.
| | lpad(text, length, [, fill]) | Extends the string to length (`lenght`) by prepending the characters (`fill`) (a space by default). Example: `lpad('bb', 5, 'a') → aaabb` | | |
| | lpad(text, length, [, fill]) | Extends the string to length (`length`) by prepending the characters (`fill`) (a space by default). Example: `lpad('bb', 5, 'a') → aaabb` | |
| | upper | | | ||
| | Function | Notes | | ||
| | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | ascii(character) | Returns a numeric representation of the character (`character`). Example: `ascii('a') -> 97` | |
There was a problem hiding this comment.
At least some of these functions are already covered in https://arrow.apache.org/datafusion/user-guide/sql/scalar_functions.html#string-functions
However, I see this is for the expression syntax. 🤔
| | sha256(text) | Computes the SHA256 hash of the argument (`text`). | | ||
| | sha384(text) | Computes the SHA384 hash of the argument (`text`). | | ||
| | sha512(text) | Computes the SHA512 hash of the argument (`text`). | | ||
| | struct | | |
There was a problem hiding this comment.
❯ select struct('soo');
+---------------------+
| struct(Utf8("soo")) |
+---------------------+
| {c0: soo} |
+---------------------+Wow that is a wild funtion 🤔
|
Thanks @izveigor ! |
Which issue does this PR close?
Closes #5977
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?