Skip to content

Commit 6340586

Browse files
ADD EN version of SELECT (#6090)
Co-authored-by: Ivan Blinkov <ivan@ydb.tech>
1 parent 8343cfd commit 6340586

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+366
-49
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% if backend_name == "YDB" %}
2+
3+
{% note warning %}
4+
5+
{% include [OLAP_not_allow_text](not_allow_for_olap_text.md) %}
6+
7+
{% endnote %}
8+
9+
{% endif %}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Supported only for [row-oriented](../concepts/datamodel/table.md#row-oriented-tables) tables. Support for [column-oriented](../concepts/datamodel/table.md#column-oriented-tables) tables is currently under development.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
## Retrieving data with a Select {#query-processing}
22

3-
Retrieving data using a [`SELECT`](../../../../yql/reference/syntax/select.md) statement in [YQL](../../../../yql/reference/index.md). Handling the retrieved data selection in the app.
3+
Retrieving data using a [`SELECT`](../../../../yql/reference/syntax/select/index.md) statement in [YQL](../../../../yql/reference/index.md). Handling the retrieved data selection in the app.
44

ydb/docs/en/core/dev/yql-tutorial/select_all_columns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Selecting data from all columns
22

3-
Select all columns from the table using [SELECT](../../yql/reference/syntax/select.md):
3+
Select all columns from the table using [SELECT](../../yql/reference/syntax/select/index.md):
44

55
{% include [yql-reference-prerequisites](_includes/yql_tutorial_prerequisites.md) %}
66

ydb/docs/en/core/yql/reference/yql-core/builtins/_includes/basic/evaluate_expr_atom.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## EvaluateExpr, EvaluateAtom {#evaluate_expr_atom}
22

3-
Evaluate an expression before the start of the main calculation and input its result to the query as a literal (constant). In many contexts, where only a constant would be expected in standard SQL (for example, in table names, in the number of rows in [LIMIT](../../../syntax/select.md#limit), and so on), this functionality is implicitly enabled automatically.
3+
Evaluate an expression before the start of the main calculation and input its result to the query as a literal (constant). In many contexts, where only a constant would be expected in standard SQL (for example, in table names, in the number of rows in [LIMIT](../../../syntax/select/limit_offset.md), and so on), this functionality is implicitly enabled automatically.
44

55
EvaluateExpr can be used where the grammar already expects an expression. For example, you can use it to:
66

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% include [x](_includes/select/commit.md) %}

ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/discard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DISCARD
22

3-
Calculates {% if select_command == "SELECT STREAM" %}[`SELECT STREAM`](../select_stream.md){% else %}[`SELECT`](../select.md){% endif %}{% if feature_mapreduce %}{% if reduce_command %}, [`{{ reduce_command }}`](../reduce.md){% endif %}, or [`{{ process_command }}`](../process.md){% endif %} without returning the result neither to the client or table. {% if feature_mapreduce %}You can't use it along with [INTO RESULT](../into_result.md).{% endif %}
3+
Calculates {% if select_command == "SELECT STREAM" %}[`SELECT STREAM`](../select_stream.md){% else %}[`SELECT`](../select/index.md){% endif %}{% if feature_mapreduce %}{% if reduce_command %}, [`{{ reduce_command }}`](../reduce.md){% endif %}, or [`{{ process_command }}`](../process.md){% endif %} without returning the result neither to the client or table. {% if feature_mapreduce %}You can't use it along with [INTO RESULT](../into_result.md).{% endif %}
44

55
It's good to combine it with [`Ensure`](../../builtins/basic.md#ensure) to check the final calculation result against the user's criteria.
66

ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/expressions/lambda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ List arguments in round brackets, following them by the arrow and lambda functio
66

77
The scope for the lambda body: first the local named expressions, then arguments, then named expressions defined above by the lambda function at the top level of the query.
88

9-
Only use pure expressions inside the lambda body (those might also be other lambdas, possibly passed through arguments). However, you can't use [SELECT](../../select.md), [INSERT INTO](../../insert_into.md), or other top-level expressions.
9+
Only use pure expressions inside the lambda body (those might also be other lambdas, possibly passed through arguments). However, you can't use [SELECT](../../select/index.md), [INSERT INTO](../../insert_into.md), or other top-level expressions.
1010

1111
One or more of the last lambda parameters can be marked with a question mark as optional: if they haven't been specified when calling lambda, they are assigned the `NULL` value.
1212

ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/expressions/tables.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ A table expression is an expression that returns a table. Table expressions in Y
1010

1111
Semantics of a table expression depends on the context where it is used. In YQL, table expressions can be used in the following contexts:
1212

13-
* Table context: after [FROM](../../select.md#from).
13+
* Table context: after [FROM](../../select/from.md).
1414
In this case, table expressions work as expected: for example, `$input = SELECT a, b, c FROM T; SELECT * FROM $input` returns a table with three columns.
15-
The table context also occurs after [UNION ALL](../../select.md#unionall){% if feature_join %}, [JOIN](../../join.md#join){% endif %}{% if feature_mapreduce and process_command == "PROCESS" %}, [PROCESS](../../process.md#process), [REDUCE](../../reduce.md#reduce){% endif %};
15+
The table context also occurs after [UNION ALL](../../select/union.md#unionall){% if feature_join %}, [JOIN](../../join.md#join){% endif %}{% if feature_mapreduce and process_command == "PROCESS" %}, [PROCESS](../../process.md#process), [REDUCE](../../reduce.md#reduce){% endif %};
1616
* Vector context: after [IN](#in). In this context, the table expression must contain exactly one column (the name of this column doesn't affect the expression result in any way).
1717
A table expression in a vector context is typed as a list (the type of the list element is the same as the column type in this case). Example: `SELECT * FROM T WHERE key IN (SELECT k FROM T1)`;
1818
* A scalar context arises _in all the other cases_. As in a vector context, a table expression must contain exactly one column, but the value of the table expression is a scalar, that is, an arbitrarily selected value of this column (if no rows are returned, the result is `NULL`). Example: `$count = SELECT COUNT(*) FROM T; SELECT * FROM T ORDER BY key LIMIT $count / 2`;

ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/group_by/distinct.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Applying [aggregate functions](../../../builtins/aggregation.md) only to distinc
44

55
{% note info %}
66

7-
Applying `DISTINCT` to calculated values is not currently implemented. For this purpose, you can use a [subquery](../../select.md#from) or the expression `GROUP BY ... AS ...`.
7+
Applying `DISTINCT` to calculated values is not currently implemented. For this purpose, you can use a [subquery](../../select/from.md) or the expression `GROUP BY ... AS ...`.
88

99
{% endnote %}
1010

@@ -20,5 +20,5 @@ ORDER BY count DESC
2020
LIMIT 3;
2121
```
2222

23-
You can also use `DISTINCT` to fetch distinct rows using [`SELECT DISTINCT`](../../select.md#distinct).
23+
You can also use `DISTINCT` to fetch distinct rows using [`SELECT DISTINCT`](../../select/distinct.md).
2424

0 commit comments

Comments
 (0)