-
Notifications
You must be signed in to change notification settings - Fork 1.9k
docs: improve expressions.md #5978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
alamb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| | 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❯ 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?