Skip to content

Commit c982680

Browse files
committed
Fixes
1 parent 326f594 commit c982680

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

ydb/docs/en/core/yql/reference/syntax/alter-sequence.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ALTER SEQUENCE `/Root/users/_serial_column_user_id`
4747
RESTART 1000;
4848
```
4949

50-
An alternative way to achieve the same result is to first change the start value, and then `RESTART` the `Sequence`. After this, subsequent calls to `RESTART` without an explicit value will set the current value to 1000:
50+
An alternative way to change the current value is to first set a new start value, and then `RESTART` the `Sequence`. After this, subsequent calls to `RESTART` without an explicit value will set the current value to 1000:
5151

5252
```yql
5353
ALTER SEQUENCE `/Root/users/_serial_column_user_id` INCREMENT BY 5 START WITH 1000;

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ At present, the `Sequence` object supports several parameters that determine its
1010

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

13-
> **Note:**
14-
> Serial columns are supported both for columns included in the primary key and for non-key columns.
15-
>
16-
> However, such columns cannot be [altered](../syntax/alter_table/family#mod-column-groups) or [dropped](../syntax/alter_table/columns.md) from the table —
17-
> attempting to perform these operations will result in an error.
13+
{% note info %}
14+
Serial columns are supported both for columns included in the primary key and for non-key columns.
15+
16+
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.
17+
{% endnote %}
1818

1919
| Type | Maximum Value | YDB Type |
2020
|-------------|----------------------|----------|
@@ -32,8 +32,10 @@ Error: Failed to get next val for sequence: /dev/test/users/_serial_column_user_
3232
<main>: Error: sequence [OwnerId: <some>, LocalPathId: <some>] doesn't have any more values available, code: 200503
3333
```
3434

35-
**Note:** 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).
35+
{% note info %}
36+
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).
3637
As a result, the values in such a column may have gaps and may not form a continuous sequence.
38+
{% endnote %}
3739

3840
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.
3941

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111

1212
По умолчанию генерируемые значения начинаются с единицы, увеличиваются на один при каждом новом значении и ограничены в соответствии с выбранным типом.
1313

14-
> **Примечание:**
15-
> Колонки типа `Serial` поддерживаются как для колонок, входящих в состав первичного ключа, так и для неключевых колонок.
16-
>
17-
> Однако такие колонки нельзя [изменить](../syntax/alter_table/family#mod-column-groups) или [удалить](../syntax/alter_table/columns.md) из таблицы —
18-
> при попытке выполнить эти операции будет возвращена ошибка.
14+
{% note info %}
15+
Колонки типа `Serial` поддерживаются как для колонок, входящих в состав первичного ключа, так и для неключевых колонок.
16+
17+
Однако такие колонки нельзя [изменить](../syntax/alter_table/family#mod-column-groups) или [удалить](../syntax/alter_table/columns.md) из таблицы — при попытке выполнить эти операции будет возвращена ошибка.
18+
{% endnote %}
1919

2020
| Тип | Максимальное значение | Тип значения |
2121
|---------------|-----------------------|--------------|
@@ -33,7 +33,9 @@ Error: Failed to get next val for sequence: /dev/test/users/_serial_column_user_
3333
<main>: Error: sequence [OwnerId: <some>, LocalPathId: <some>] doesn't have any more values available, code: 200503
3434
```
3535

36-
Отметим, что следующее значение выдаётся генератором до непосредственной вставки в таблицу и уже будет считаться использованным, даже если строка, содержащая это значение, не была успешно вставлена, например, при откате транзакции. Поэтому множество значений такой колонки может содержать пропуски и состоять из нескольких промежутков.
36+
{% note info %}
37+
Cледующее значение выдаётся генератором до непосредственной вставки в таблицу и уже будет считаться использованным, даже если строка, содержащая это значение, не была успешно вставлена, например, при откате транзакции. Поэтому множество значений такой колонки может содержать пропуски и состоять из нескольких промежутков.
38+
{% endnote %}
3739

3840
Для таблиц с автоинкрементными колонками поддержаны операции [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) и [import](../../../reference/ydb-cli/export-import/import-s3.md)/[export](../../../reference/ydb-cli/export-import/export-s3.md).
3941

@@ -90,5 +92,5 @@ CREATE TABLE users_bad (
9092
);
9193
```
9294

93-
В следующем примере автоинкрементная колонка является единственным и первым элементом ключа — это приведёт к неравномерной нагрузке и узкому месту на последней партиции.
95+
В этом примере автоинкрементная колонка является единственным и первым элементом ключа — это приведёт к неравномерной нагрузке и узкому месту на последней партиции.
9496

0 commit comments

Comments
 (0)