Skip to content

Commit b149e9e

Browse files
committed
YQL-19864 docs
commit_hash:cc82995d04c8bd3b7ca4d6fe69e91edc092e1b32
1 parent b8720ed commit b149e9e

File tree

19 files changed

+153
-8
lines changed

19 files changed

+153
-8
lines changed

yql/essentials/data/language/pragmas_opensource.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This initial version contains all features as of early 2025.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Changing the visibility of aliases entered in GROUP BY expr AS alias for WHERE {#group-by-expr-alias-where}
2+
3+
Since this version, in a query like
4+
5+
```yql
6+
SELECT foo, ... WHERE foo = 1 GROUP BY expr AS foo
7+
```
8+
9+
the value of foo in `WHERE` is taken from the original table, and not equal to `expr` as it was previously.
10+
11+
To get an error from the query if it changes behavior in this version, you need to add
12+
13+
```yql
14+
PRAGMA FailOnGroupByExprOverride;
15+
```
16+
17+
If you want to keep the previous behavior, you need to transform the query into this form:
18+
19+
```yql
20+
SELECT foo, ... FROM (SELECT expr AS foo ...) WHERE foo = 1 GROUP BY foo
21+
```
22+
23+
If you need to prepare the query for the transition to a new version, it is enough to remove the shadowing of the column name by the alias:
24+
25+
```yql
26+
SELECT foo_new, ... WHERE foo = 1 GROUP BY expr AS foo_new
27+
```
28+
29+
## TODO
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Changes in YQL versions
2+
3+
This section contains a list of changes in different versions of the YQL
4+
5+
## General description of YQL versions
6+
7+
The goal of language versioning is a controlled and user-safe evolution of the language, within which it is possible to:
8+
9+
* add new features;
10+
11+
* change default values ​​for pragmas or perform other non-backward-compatible changes;
12+
13+
* remove obsolete features.
14+
15+
The starting version of the language is `2025.01`.
16+
17+
Once a year, a new version of the language is released, called `YEAR.X`, for example `2025.01`. Other versions in the same year will increase the minor version number (`YEAR.02`, etc.).
18+
19+
For each version of the type `YEAR.X` **support is guaranteed for three years with the preservation of semantics and bug fixes**.
20+
21+
When version `YEAR+2.1` is released, a warning is issued for all versions of the type `YEAR.X` that they will soon cease to be supported.
22+
23+
When version `YEAR+3.1` is released, a warning is issued for all versions of the type `YEAR.X` that they are not supported and query execution is not guaranteed.
24+
25+
When specifying a version of `YEAR.X` greater than what is currently available in some service/library/tool, a query error is issued.
26+
27+
When each version is released, the documentation in the changelog indicates the changes included in this version and recommendations for migration.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
items:
2+
- name: Overview
3+
href: index.md
4+
- name: 2025.01
5+
href: 2025.01.md
6+
- name: 2025.02
7+
href: 2025.02.md

yql/essentials/docs/en/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ This documentation section contains the YQL reference that includes the sections
88
- [Syntax](syntax/index.md) with a full list of YQL commands
99
- [Built-in functions](builtins/index.md) with a description of the available built-in functions
1010
- [Recipes](recipes/index.md) with a description of recipes for various tasks
11+
- [Changelog](changelog/index.md) of YQL

yql/essentials/docs/en/syntax/select/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The `SELECT` query result is calculated as follows:
2424
* Apply [SAMPLE](sample.md)/[TABLESAMPLE](sample.md) to input tables.
2525
* Execute [FLATTEN COLUMNS](../flatten.md#flatten-columns) or [FLATTEN BY](../flatten.md); aliases set in `FLATTEN BY` become visible after this point.
2626
* Execute every [JOIN](../join.md).
27-
* Add to (or replace in) the data the columns listed in [GROUP BY ... AS ...](../group_by.md).
27+
* Add to (or replace in) the data the columns listed in [GROUP BY ... AS ...](../group_by.md) (this clause executes after `WHERE` since version [2025.02](../../changelog/2025.02.md#group-by-expr-alias-where)).
2828
* Execute [WHERE](where.md) - discard all the data mismatching the predicate.
2929
* Execute [GROUP BY](../group_by.md), evaluate aggregate functions.
3030
* Apply the filter [HAVING](../group_by.md#having).

yql/essentials/docs/en/toc_i.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ items:
77
include: { mode: link, path: builtins/toc_i.yaml }
88
- name: Recipes
99
include: { mode: link, path: recipes/toc_i.yaml }
10+
- name: Changelog
11+
include: { mode: link, path: changelog/toc_i.yaml }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Эта стартовая версия содержит все фичи на начало 2025 года.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Изменение видимости алиасов, введенных в GROUP BY expr AS alias для WHERE {#group-by-expr-alias-where}
2+
3+
Начиная с этой версии в запросе вида
4+
5+
```yql
6+
SELECT foo, ... WHERE foo = 1 GROUP BY expr AS foo
7+
```
8+
9+
значение foo в `WHERE` берется из исходной таблицы, а не равно `expr`, как было ранее.
10+
11+
Чтобы получить ошибку запроса, если он изменит поведение в этой версии, необходимо добавить
12+
13+
```yql
14+
PRAGMA FailOnGroupByExprOverride;
15+
```
16+
17+
Если необходимо сохранить предыдущее поведение, запрос нужно преобразовать в такую форму:
18+
19+
```yql
20+
SELECT foo, ... FROM (SELECT expr AS foo ...) WHERE foo = 1 GROUP BY foo
21+
```
22+
23+
Если нужно подготовить запрос к переходу на новую версию, достаточно убрать затенение alias-ом имени колонки:
24+
25+
```yql
26+
SELECT foo_new, ... WHERE foo = 1 GROUP BY expr AS foo_new
27+
```
28+
29+
## TODO

0 commit comments

Comments
 (0)