Skip to content

Commit fd26392

Browse files
committed
Fixes
1 parent 65d655e commit fd26392

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ydb/docs/en/core/yql/reference/types/serial.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ The `Sequence` object supports several parameters that determine its behavior. T
1111
By default, values generated by the `Sequence` start from one, are incremented by one with each new value, and are limited according to the chosen type.
1212

1313
{% note info %}
14+
1415
Serial columns are supported both for columns included in the primary key and for non-key columns.
1516

1617
However, such columns cannot be [altered](../syntax/alter_table/family#mod-column-groups) or [dropped](../syntax/alter_table/columns.md) from the table — attempting to perform these operations will result in an error.
18+
1719
{% endnote %}
1820

1921
| Type | Maximum Value | YDB Type |
@@ -33,8 +35,10 @@ Error: Failed to get next val for sequence: /dev/test/users/_serial_column_user_
3335
```
3436

3537
{% note info %}
38+
3639
The next value is allocated by the generator before the actual insertion into the table and is considered used even if the row is not successfully inserted (for example, in case of transaction rollback).
3740
As a result, the values in such a column may have gaps and may not form a continuous sequence.
41+
3842
{% endnote %}
3943

4044
Tables with `Serial` columns support [copy](../../../reference/ydb-cli/tools-copy.md), [rename](../../../reference/ydb-cli/commands/tools/rename.md), [dump](../../../reference/ydb-cli/export-import/tools-dump.md), [restore](../../../reference/ydb-cli/export-import/import-file.md), and [import](../../../reference/ydb-cli/export-import/import-s3.md)/[export](../../../reference/ydb-cli/export-import/export-s3.md) operations.
@@ -53,6 +57,7 @@ CREATE TABLE users (
5357
email Utf8,
5458
PRIMARY KEY (user_hash, user_id)
5559
);
60+
```
5661

5762
The `user_hash` field can be calculated on the application side, for example, by applying a hash function to the `email`.
5863

ydb/docs/ru/core/yql/reference/types/serial.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
{% note info %}
1515

16-
Колонки типа `Serial` поддерживаются как для колонок, входящих в состав первичного ключа, так и для неключевых колонок.
16+
Столбцы типа `Serial` поддерживаются как для колонок, входящих в состав первичного ключа, так и для неключевых колонок.
1717

1818
Однако такие колонки нельзя [изменить](../syntax/alter_table/family#mod-column-groups) или [удалить](../syntax/alter_table/columns.md) из таблицы — при попытке выполнить эти операции будет возвращена ошибка.
1919

@@ -37,7 +37,11 @@ Error: Failed to get next val for sequence: /dev/test/users/_serial_column_user_
3737

3838
{% note info %}
3939

40+
<<<<<<< HEAD
4041
Cледующее значение выдаётся генератором до непосредственной вставки в таблицу и уже будет считаться использованным, даже если строка, содержащая это значение, не была успешно вставлена, например, при откате транзакции. Поэтому множество значений такой колонки может содержать пропуски и состоять из нескольких промежутков.
42+
=======
43+
Следующее значение выдаётся генератором до непосредственной вставки в таблицу и уже будет считаться использованным, даже если строка, содержащая это значение, не была успешно вставлена (например, при откате транзакции). Поэтому множество значений такой колонки может содержать пропуски и состоять из нескольких промежутков.
44+
>>>>>>> Fixes
4145
4246
{% endnote %}
4347

0 commit comments

Comments
 (0)