Skip to content

Commit f5a294e

Browse files
docs: function alias (#2106)
* Update 01-ddl-create_task.md * iff * greatest & least * add var_pop, variance_pop alias for function covar_pop * add var_samp, variance_samp alias for function covar_samp * insert overwrite into * Update dml-insert-multi.md --------- Co-authored-by: z <[email protected]>
1 parent 6a477be commit f5a294e

File tree

15 files changed

+170
-30
lines changed

15 files changed

+170
-30
lines changed

docs/en/sql-reference/10-sql-commands/00-ddl/04-task/01-ddl-create_task.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_position: 1
55

66
import FunctionDescription from '@site/src/components/FunctionDescription';
77

8-
<FunctionDescription description="Introduced or updated: v1.2.371"/>
8+
<FunctionDescription description="Introduced or updated: v1.2.738"/>
99

1010
The CREATE TASK statement is used to define a new task that executes a specified SQL statement on a scheduled basis or dag based task graph.
1111

@@ -14,7 +14,7 @@ The CREATE TASK statement is used to define a new task that executes a specified
1414
## Syntax
1515

1616
```sql
17-
CREATE TASK [ IF NOT EXISTS ] <name>
17+
CREATE [ OR REPLACE ] TASK [ IF NOT EXISTS ] <name>
1818
WAREHOUSE = <string>
1919
SCHEDULE = { <num> MINUTE | <num> SECOND | USING CRON <expr> <time_zone> }
2020
[ AFTER <string> [ , <string> , ... ]]

docs/en/sql-reference/10-sql-commands/10-dml/dml-insert-multi.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,12 @@ SELECT ...
5050

5151
| Parameter | Description |
5252
| ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
53-
| OVERWRITE | Indicates whether existing data should be truncated before insertion. |
53+
| `OVERWRITE` | Indicates whether existing data should be truncated before insertion. |
5454
| `( <target_col_name> [ , ... ] )` | Specifies the column names in the target table where data will be inserted.<br/>- If omitted, data will be inserted into all columns in the target table. |
55-
| VALUES `( <source_col_name> [ , ... ] )` | Specifies the source column names from which data will be inserted into the target table.<br/>- If omitted, all columns returned by the subquery will be inserted into the target table.<br/>- The data types of the columns listed in `<source_col_name>` must match or be compatible with those specified in `<target_col_name>`. |
56-
| SELECT ... | A subquery that provides the data to be inserted into the target table(s).<br/>- You have the option to explicitly assign aliases to columns within the subquery. This allows you to reference the columns by their aliases within WHEN clauses and VALUES clauses. |
57-
| WHEN | Conditional statement to determine when to insert data into specific target tables.<br/>- A conditional multi-table insert requires at least one WHEN clause.<br/>- A WHEN clause can include multiple INTO clauses, and these INTO clauses can target the same table.<br/>- To unconditionally execute a WHEN clause, you can use `WHEN 1 THEN ...`. |
58-
| ELSE | Specifies the action to take if none of the conditions specified in the WHEN clauses are met. |
59-
55+
| `VALUES ( <source_col_name> [ , ... ] )` | Specifies the source column names from which data will be inserted into the target table.<br/>- If omitted, all columns returned by the subquery will be inserted into the target table.<br/>- The data types of the columns listed in `<source_col_name>` must match or be compatible with those specified in `<target_col_name>`. |
56+
| `SELECT ...` | A subquery that provides the data to be inserted into the target table(s).<br/>- You have the option to explicitly assign aliases to columns within the subquery. This allows you to reference the columns by their aliases within WHEN clauses and VALUES clauses. |
57+
| `WHEN` | Conditional statement to determine when to insert data into specific target tables.<br/>- A conditional multi-table insert requires at least one WHEN clause.<br/>- A WHEN clause can include multiple INTO clauses, and these INTO clauses can target the same table.<br/>- To unconditionally execute a WHEN clause, you can use `WHEN 1 THEN ...`. |
58+
| `ELSE` | Specifies the action to take if none of the conditions specified in the WHEN clauses are met. |
6059
## Important Notes
6160

6261
- Aggregate functions, external UDFs, and window functions are not allowed in the `VALUES(...)` expressions.

docs/en/sql-reference/10-sql-commands/10-dml/dml-insert.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
title: INSERT
33
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
5+
6+
<FunctionDescription description="Introduced or updated: v1.2.738"/>
47

58
Inserts one or more rows into a table.
69

@@ -13,7 +16,7 @@ See also: [INSERT (multi-table)](dml-insert-multi.md)
1316
## Syntax
1417

1518
```sql
16-
INSERT { OVERWRITE | INTO } <table>
19+
INSERT { OVERWRITE [ INTO ] | INTO } <table>
1720
-- Optionally specify the columns to insert into
1821
( <column> [ , ... ] )
1922
-- Insertion options:
@@ -25,10 +28,10 @@ INSERT { OVERWRITE | INTO } <table>
2528
}
2629
```
2730

28-
| Parameter | Description |
29-
|-----------|----------------------------------------------------------------------------------|
30-
| OVERWRITE | Indicates whether existing data should be truncated before insertion. |
31-
| VALUES | Allows direct insertion of specific values or the default values of the columns. |
31+
| Parameter | Description |
32+
|--------------------|----------------------------------------------------------------------------------|
33+
| `OVERWRITE [INTO]` | Indicates whether existing data should be truncated before insertion. |
34+
| `VALUES` | Allows direct insertion of specific values or the default values of the columns. |
3235

3336
## Important Notes
3437

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: GREATEST_IGNORE_NULLS
3+
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
5+
6+
<FunctionDescription description="Introduced or updated: v1.2.738"/>
7+
8+
Returns the maximum value from a set of values, ignoring any NULL values.
9+
10+
See also: [GREATEST](greatest.md)
11+
12+
## Syntax
13+
14+
```sql
15+
GREATEST_IGNORE_NULLS(<value1>, <value2> ...)
16+
```
17+
18+
## Examples
19+
20+
```sql
21+
SELECT GREATEST_IGNORE_NULLS(5, 9, 4), GREATEST_IGNORE_NULLS(5, 9, null);
22+
```
23+
24+
```sql
25+
┌────────────────────────────────────────────────────────────────────┐
26+
│ greatest_ignore_nulls(5, 9, 4) │ greatest_ignore_nulls(5, 9, NULL) │
27+
├────────────────────────────────┼───────────────────────────────────┤
28+
99
29+
└────────────────────────────────────────────────────────────────────┘
30+
```
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
---
22
title: GREATEST
33
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
45

5-
Returns the maximum value from a set of values.
6+
<FunctionDescription description="Introduced or updated: v1.2.738"/>
7+
8+
Returns the maximum value from a set of values. If any value in the set is `NULL`, the function returns `NULL`.
9+
10+
See also: [GREATEST_IGNORE_NULLS](greatest-ignore-nulls.md)
611

712
## Syntax
813

@@ -13,11 +18,13 @@ GREATEST(<value1>, <value2> ...)
1318
## Examples
1419

1520
```sql
16-
SELECT GREATEST(5, 9, 4);
21+
SELECT GREATEST(5, 9, 4), GREATEST(5, 9, null);
22+
```
1723

18-
┌───────────────────┐
19-
│ greatest(5, 9, 4) │
20-
├───────────────────┤
21-
9
22-
└───────────────────┘
24+
```sql
25+
┌──────────────────────────────────────────┐
26+
│ greatest(5, 9, 4) │ greatest(5, 9, NULL) │
27+
├───────────────────┼──────────────────────┤
28+
9NULL
29+
└──────────────────────────────────────────┘
2330
```

docs/en/sql-reference/20-sql-functions/03-conditional-functions/if.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
title: IF
33
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
5+
6+
<FunctionDescription description="Introduced or updated: v1.2.738"/>
47

58
If `<cond1>` is TRUE, it returns `<expr1>`. Otherwise if `<cond2>` is TRUE, it returns `<expr2>`, and so on.
69

@@ -10,6 +13,10 @@ If `<cond1>` is TRUE, it returns `<expr1>`. Otherwise if `<cond2>` is TRUE, it r
1013
IF(<cond1>, <expr1>, [<cond2>, <expr2> ...], <expr_else>)
1114
```
1215

16+
## Aliases
17+
18+
- [IFF](iff.md)
19+
1320
## Examples
1421

1522
```sql
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: IFF
3+
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
5+
6+
<FunctionDescription description="Introduced or updated: v1.2.738"/>
7+
8+
Alias for [IF](if.md).
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: LEAST_IGNORE_NULLS
3+
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
5+
6+
<FunctionDescription description="Introduced or updated: v1.2.738"/>
7+
8+
Returns the maximum value from a set of values, ignoring any NULL values.
9+
10+
See also: [LEAST](least.md)
11+
12+
## Syntax
13+
14+
```sql
15+
LEAST_IGNORE_NULLS(<value1>, <value2> ...)
16+
```
17+
18+
## Examples
19+
20+
```sql
21+
SELECT LEAST_IGNORE_NULLS(5, 9, 4), LEAST_IGNORE_NULLS(5, 9, null);
22+
```
23+
24+
```sql
25+
┌──────────────────────────────────────────────────────────────┐
26+
│ least_ignore_nulls(5, 9, 4) │ least_ignore_nulls(5, 9, NULL) │
27+
├─────────────────────────────┼────────────────────────────────┤
28+
45
29+
└──────────────────────────────────────────────────────────────┘
30+
```
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
---
22
title: LEAST
33
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
45

5-
Returns the minimum value from a set of values.
6+
<FunctionDescription description="Introduced or updated: v1.2.738"/>
7+
8+
Returns the minimum value from a set of values. If any value in the set is `NULL`, the function returns `NULL`.
9+
10+
See also: [LEAST_IGNORE_NULLS](least-ignore-nulls.md)
611

712
## Syntax
813

@@ -13,11 +18,13 @@ LEAST(<value1>, <value2> ...)
1318
## Examples
1419

1520
```sql
16-
SELECT LEAST(5, 9, 4);
21+
SELECT LEAST(5, 9, 4), LEAST(5, 9, null);
22+
```
1723

18-
┌────────────────┐
19-
│ least(5, 9, 4) │
20-
├────────────────┤
21-
4
22-
└────────────────┘
24+
```
25+
┌────────────────────────────────────┐
26+
│ least(5, 9, 4) │ least(5, 9, NULL) │
27+
├────────────────┼───────────────────┤
28+
│ 4 │ NULL │
29+
└────────────────────────────────────┘
2330
```

docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-covar-pop.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
---
22
title: COVAR_POP
33
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
45

5-
COVAR_POP returns the population covariance of a set of number pairs.
6+
<FunctionDescription description="Introduced or updated: v1.2.738"/>
7+
8+
Returns the population covariance of a set of number pairs.
69

710
## Syntax
811

@@ -17,6 +20,11 @@ COVAR_POP(<expr1>, <expr2>)
1720
| `<expr1>` | Any numerical expression |
1821
| `<expr2>` | Any numerical expression |
1922

23+
## Aliases
24+
25+
- [VAR_POP](aggregate-var-pop.md)
26+
- [VARIANCE_POP](aggregate-variance-pop.md)
27+
2028
## Return Type
2129

2230
float64

docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-covar-samp.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
title: COVAR_SAMP
33
---
44

5-
Aggregate function.
5+
import FunctionDescription from '@site/src/components/FunctionDescription';
66

7-
The covar_samp() function returns the sample covariance (Σ((x - x̅)(y - y̅)) / (n - 1)) of two data columns.
7+
<FunctionDescription description="Introduced or updated: v1.2.738"/>
8+
9+
Returns the sample covariance (Σ((x - x̅)(y - y̅)) / (n - 1)) of two data columns.
810

911
:::caution
1012
NULL values are not counted.
@@ -23,6 +25,11 @@ COVAR_SAMP(<expr1>, <expr2>)
2325
| `<expr1>` | Any numerical expression |
2426
| `<expr2>` | Any numerical expression |
2527

28+
## Aliases
29+
30+
- [VAR_SAMP](aggregate-var-samp.md)
31+
- [VARIANCE_SAMP](aggregate-variance-samp.md)
32+
2633
## Return Type
2734

2835
float64, when `n <= 1`, returns +∞.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: VAR_POP
3+
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
5+
6+
<FunctionDescription description="Introduced or updated: v1.2.738"/>
7+
8+
Alias for [COVAR_POP](aggregate-covar-pop.md).
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: VAR_SAMP
3+
---
4+
5+
import FunctionDescription from '@site/src/components/FunctionDescription';
6+
7+
<FunctionDescription description="Introduced or updated: v1.2.738"/>
8+
9+
Alias for [COVAR_SAMP](aggregate-covar-samp.md).
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: VARIANCE_POP
3+
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
5+
6+
<FunctionDescription description="Introduced or updated: v1.2.738"/>
7+
8+
Alias for [COVAR_POP](aggregate-covar-pop.md).
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: VARIANCE_SAMP
3+
---
4+
5+
import FunctionDescription from '@site/src/components/FunctionDescription';
6+
7+
<FunctionDescription description="Introduced or updated: v1.2.738"/>
8+
9+
Alias for [COVAR_SAMP](aggregate-covar-samp.md).

0 commit comments

Comments
 (0)