Skip to content
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

Merged
merged 4 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions docs/source/user-guide/sql/aggregate_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ Aggregate functions operate on a set of values to compute a single result.
## General

- [avg](#avg)
- [bit_and](#bit_and)
- [bit_or](#bit_or)
- [bit_xor](#bit_xor)
- [bool_and](#bool_and)
- [bool_or](#bool_or)
- [count](#count)
Expand Down Expand Up @@ -56,45 +53,6 @@ avg(expression)

- `mean`

### `bit_and`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Computes the bitwise AND of all non-null input values.

```
bit_and(expression)
```

#### Arguments

- **expression**: Expression to operate on.
Can be a constant, column, or function, and any combination of arithmetic operators.

### `bit_or`

Computes the bitwise OR of all non-null input values.

```
bit_or(expression)
```

#### Arguments

- **expression**: Expression to operate on.
Can be a constant, column, or function, and any combination of arithmetic operators.

### `bit_xor`

Computes the bitwise exclusive OR of all non-null input values.

```
bit_xor(expression)
```

#### Arguments

- **expression**: Expression to operate on.
Can be a constant, column, or function, and any combination of arithmetic operators.

### `bool_and`

Returns true if all non-null input values are true, otherwise false.
Expand Down
216 changes: 0 additions & 216 deletions docs/source/user-guide/sql/scalar_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
- [iszero](#iszero)
- [lcm](#lcm)
- [ln](#ln)
- [log](#log)
- [log10](#log10)
- [log2](#log2)
- [nanvl](#nanvl)
Expand Down Expand Up @@ -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`
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.
Expand Down Expand Up @@ -567,29 +549,11 @@ trunc(numeric_expression[, decimal_places])

## Conditional Functions

- [coalesce](#coalesce)
- [nullif](#nullif)
- [nvl](#nvl)
- [nvl2](#nvl2)
- [ifnull](#ifnull)

### `coalesce`
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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_.
Expand Down Expand Up @@ -644,7 +608,6 @@ _Alias of [nvl](#nvl)._

## String Functions

- [ascii](#ascii)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- [bit_length](#bit_length)
- [btrim](#btrim)
- [char_length](#char_length)
Expand All @@ -665,7 +628,6 @@ _Alias of [nvl](#nvl)._
- [replace](#replace)
- [reverse](#reverse)
- [right](#right)
- [rpad](#rpad)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- [rtrim](#rtrim)
- [split_part](#split_part)
- [starts_with](#starts_with)
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -1727,49 +1568,6 @@ Additional examples can be found [here]

- date_format

### `to_date`
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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
Expand Down Expand Up @@ -3850,7 +3648,6 @@ select map_values(map([100, 5], [42,43]));

- [digest](#digest)
- [md5](#md5)
- [sha224](#sha224)
- [sha256](#sha256)
- [sha384](#sha384)
- [sha512](#sha512)
Expand Down Expand Up @@ -3889,19 +3686,6 @@ md5(expression)

#### Arguments

- **expression**: String expression to operate on.
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

Expand Down
9 changes: 0 additions & 9 deletions docs/source/user-guide/sql/window_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.
Expand Down