-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Remove redundant aggregate/window/scalar function documentation #12745
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,6 @@ | |
- [iszero](#iszero) | ||
- [lcm](#lcm) | ||
- [ln](#ln) | ||
- [log](#log) | ||
- [log10](#log10) | ||
- [log2](#log2) | ||
- [nanvl](#nanvl) | ||
|
@@ -339,23 +338,6 @@ ln(numeric_expression) | |
- **numeric_expression**: Numeric expression to operate on. | ||
Can be a constant, column, or function, and any combination of arithmetic operators. | ||
|
||
### `log` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
Returns the base-x logarithm of a number. | ||
Can either provide a specified base, or if omitted then takes the base-10 of a number. | ||
|
||
``` | ||
log(base, numeric_expression) | ||
log(numeric_expression) | ||
``` | ||
|
||
#### Arguments | ||
|
||
- **base**: Base numeric expression to operate on. | ||
Can be a constant, column, or function, and any combination of arithmetic operators. | ||
- **numeric_expression**: Numeric expression to operate on. | ||
Can be a constant, column, or function, and any combination of arithmetic operators. | ||
|
||
### `log10` | ||
|
||
Returns the base-10 logarithm of a number. | ||
|
@@ -567,29 +549,11 @@ trunc(numeric_expression[, decimal_places]) | |
|
||
## Conditional Functions | ||
|
||
- [coalesce](#coalesce) | ||
- [nullif](#nullif) | ||
- [nvl](#nvl) | ||
- [nvl2](#nvl2) | ||
- [ifnull](#ifnull) | ||
|
||
### `coalesce` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
Returns the first of its arguments that is not _null_. | ||
Returns _null_ if all arguments are _null_. | ||
This function is often used to substitute a default value for _null_ values. | ||
|
||
``` | ||
coalesce(expression1[, ..., expression_n]) | ||
``` | ||
|
||
#### Arguments | ||
|
||
- **expression1, expression_n**: | ||
Expression to use if previous expressions are _null_. | ||
Can be a constant, column, or function, and any combination of arithmetic operators. | ||
Pass as many expression arguments as necessary. | ||
|
||
### `nullif` | ||
|
||
Returns _null_ if _expression1_ equals _expression2_; otherwise it returns _expression1_. | ||
|
@@ -644,7 +608,6 @@ _Alias of [nvl](#nvl)._ | |
|
||
## String Functions | ||
|
||
- [ascii](#ascii) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
- [bit_length](#bit_length) | ||
- [btrim](#btrim) | ||
- [char_length](#char_length) | ||
|
@@ -665,7 +628,6 @@ _Alias of [nvl](#nvl)._ | |
- [replace](#replace) | ||
- [reverse](#reverse) | ||
- [right](#right) | ||
- [rpad](#rpad) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
- [rtrim](#rtrim) | ||
- [split_part](#split_part) | ||
- [starts_with](#starts_with) | ||
|
@@ -683,22 +645,6 @@ _Alias of [nvl](#nvl)._ | |
- [position](#position) | ||
- [contains](#contains) | ||
|
||
### `ascii` | ||
|
||
Returns the ASCII value of the first character in a string. | ||
|
||
``` | ||
ascii(str) | ||
``` | ||
|
||
#### Arguments | ||
|
||
- **str**: String expression to operate on. | ||
Can be a constant, column, or function, and any combination of string operators. | ||
|
||
**Related functions**: | ||
[chr](#chr) | ||
|
||
### `bit_length` | ||
|
||
Returns the bit length of a string. | ||
|
@@ -1021,26 +967,6 @@ right(str, n) | |
**Related functions**: | ||
[left](#left) | ||
|
||
### `rpad` | ||
|
||
Pads the right side of a string with another string to a specified string length. | ||
|
||
``` | ||
rpad(str, n[, padding_str]) | ||
``` | ||
|
||
#### Arguments | ||
|
||
- **str**: String expression to operate on. | ||
Can be a constant, column, or function, and any combination of string operators. | ||
- **n**: String length to pad to. | ||
- **padding_str**: String expression to pad with. | ||
Can be a constant, column, or function, and any combination of string operators. | ||
_Default is a space._ | ||
|
||
**Related functions**: | ||
[lpad](#lpad) | ||
|
||
### `rtrim` | ||
|
||
Trims the specified trim string from the end of a string. | ||
|
@@ -1257,102 +1183,18 @@ find_in_set(str, strlist) | |
- **str**: String expression to find in strlist. | ||
- **strlist**: A string list is a string composed of substrings separated by , characters. | ||
|
||
## Binary String Functions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
- [decode](#decode) | ||
- [encode](#encode) | ||
|
||
### `encode` | ||
|
||
Encode binary data into a textual representation. | ||
|
||
``` | ||
encode(expression, format) | ||
``` | ||
|
||
#### Arguments | ||
|
||
- **expression**: Expression containing string or binary data | ||
|
||
- **format**: Supported formats are: `base64`, `hex` | ||
|
||
**Related functions**: | ||
[decode](#decode) | ||
|
||
### `decode` | ||
|
||
Decode binary data from textual representation in string. | ||
|
||
``` | ||
decode(expression, format) | ||
``` | ||
|
||
#### Arguments | ||
|
||
- **expression**: Expression containing encoded string data | ||
|
||
- **format**: Same arguments as [encode](#encode) | ||
|
||
**Related functions**: | ||
[encode](#encode) | ||
|
||
## Regular Expression Functions | ||
|
||
Apache DataFusion uses a [PCRE-like] regular expression [syntax] | ||
(minus support for several features including look-around and backreferences). | ||
The following regular expression functions are supported: | ||
|
||
- [regexp_like](#regexp_like) | ||
- [regexp_match](#regexp_match) | ||
- [regexp_replace](#regexp_replace) | ||
|
||
[pcre-like]: https://en.wikibooks.org/wiki/Regular_Expressions/Perl-Compatible_Regular_Expressions | ||
[syntax]: https://docs.rs/regex/latest/regex/#syntax | ||
|
||
### `regexp_like` | ||
|
||
Returns true if a [regular expression] has at least one match in a string, | ||
false otherwise. | ||
|
||
[regular expression]: https://docs.rs/regex/latest/regex/#syntax | ||
|
||
``` | ||
regexp_like(str, regexp[, flags]) | ||
``` | ||
|
||
#### Arguments | ||
|
||
- **str**: String expression to operate on. | ||
Can be a constant, column, or function, and any combination of string operators. | ||
- **regexp**: Regular expression to test against the string expression. | ||
Can be a constant, column, or function. | ||
- **flags**: Optional regular expression flags that control the behavior of the | ||
regular expression. The following flags are supported: | ||
- **i**: case-insensitive: letters match both upper and lower case | ||
- **m**: multi-line mode: ^ and $ match begin/end of line | ||
- **s**: allow . to match \n | ||
- **R**: enables CRLF mode: when multi-line mode is enabled, \r\n is used | ||
- **U**: swap the meaning of x* and x*? | ||
|
||
#### Example | ||
|
||
```sql | ||
select regexp_like('Köln', '[a-zA-Z]ö[a-zA-Z]{2}'); | ||
+--------------------------------------------------------+ | ||
| regexp_like(Utf8("Köln"),Utf8("[a-zA-Z]ö[a-zA-Z]{2}")) | | ||
+--------------------------------------------------------+ | ||
| true | | ||
+--------------------------------------------------------+ | ||
SELECT regexp_like('aBc', '(b|d)', 'i'); | ||
+--------------------------------------------------+ | ||
| regexp_like(Utf8("aBc"),Utf8("(b|d)"),Utf8("i")) | | ||
+--------------------------------------------------+ | ||
| true | | ||
+--------------------------------------------------+ | ||
``` | ||
|
||
Additional examples can be found [here](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/regexp.rs) | ||
|
||
### `regexp_match` | ||
|
||
Returns a list of [regular expression](https://docs.rs/regex/latest/regex/#syntax) matches in a string. | ||
|
@@ -1479,7 +1321,6 @@ contains(string, search_string) | |
- [today](#today) | ||
- [make_date](#make_date) | ||
- [to_char](#to_char) | ||
- [to_date](#to_date) | ||
- [to_local_time](#to_local_time) | ||
- [to_timestamp](#to_timestamp) | ||
- [to_timestamp_millis](#to_timestamp_millis) | ||
|
@@ -1727,49 +1568,6 @@ Additional examples can be found [here] | |
|
||
- date_format | ||
|
||
### `to_date` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
Converts a value to a date (`YYYY-MM-DD`). | ||
Supports strings, integer and double types as input. | ||
Strings are parsed as YYYY-MM-DD (e.g. '2023-07-20') if no [Chrono format]s are provided. | ||
Integers and doubles are interpreted as days since the unix epoch (`1970-01-01T00:00:00Z`). | ||
Returns the corresponding date. | ||
|
||
Note: `to_date` returns Date32, which represents its values as the number of days since unix epoch(`1970-01-01`) stored as signed 32 bit value. The largest supported date value is `9999-12-31`. | ||
|
||
``` | ||
to_date(expression[, ..., format_n]) | ||
``` | ||
|
||
#### Arguments | ||
|
||
- **expression**: Expression to operate on. | ||
Can be a constant, column, or function, and any combination of arithmetic operators. | ||
- **format_n**: Optional [Chrono format] strings to use to parse the expression. Formats will be tried in the order | ||
they appear with the first successful one being returned. If none of the formats successfully parse the expression | ||
an error will be returned. | ||
|
||
[chrono format]: https://docs.rs/chrono/latest/chrono/format/strftime/index.html | ||
|
||
#### Example | ||
|
||
``` | ||
> select to_date('2023-01-31'); | ||
+-----------------------------+ | ||
| to_date(Utf8("2023-01-31")) | | ||
+-----------------------------+ | ||
| 2023-01-31 | | ||
+-----------------------------+ | ||
> select to_date('2023/01/31', '%Y-%m-%d', '%Y/%m/%d'); | ||
+---------------------------------------------------------------+ | ||
| to_date(Utf8("2023/01/31"),Utf8("%Y-%m-%d"),Utf8("%Y/%m/%d")) | | ||
+---------------------------------------------------------------+ | ||
| 2023-01-31 | | ||
+---------------------------------------------------------------+ | ||
``` | ||
|
||
Additional examples can be found [here](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/to_date.rs) | ||
|
||
### `to_local_time` | ||
|
||
Converts a timestamp with a timezone to a timestamp without a timezone (with no offset or | ||
|
@@ -3850,7 +3648,6 @@ select map_values(map([100, 5], [42,43])); | |
|
||
- [digest](#digest) | ||
- [md5](#md5) | ||
- [sha224](#sha224) | ||
- [sha256](#sha256) | ||
- [sha384](#sha384) | ||
- [sha512](#sha512) | ||
|
@@ -3889,19 +3686,6 @@ md5(expression) | |
|
||
#### Arguments | ||
|
||
- **expression**: String expression to operate on. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
Can be a constant, column, or function, and any combination of string operators. | ||
|
||
### `sha224` | ||
|
||
Computes the SHA-224 hash of a binary string. | ||
|
||
``` | ||
sha224(expression) | ||
``` | ||
|
||
#### Arguments | ||
|
||
- **expression**: String expression to operate on. | ||
Can be a constant, column, or function, and any combination of string operators. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,19 +140,10 @@ All [aggregate functions](aggregate_functions.md) can be used as window function | |
|
||
## Ranking functions | ||
|
||
- [row_number](#row_number) | ||
- [rank](#rank) | ||
- [dense_rank](#dense_rank) | ||
- [ntile](#ntile) | ||
|
||
### `row_number` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
Number of the current row within its partition, counting from 1. | ||
|
||
```sql | ||
row_number() | ||
``` | ||
|
||
### `rank` | ||
|
||
Rank of the current row with gaps; same as row_number of its first peer. | ||
|
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.
These are in the new functions here: https://datafusion.apache.org/user-guide/sql/aggregate_functions_new.html