Skip to content

Commit 1baa66d

Browse files
authored
[Docs] ColumnShard writes (#22392) (#24836)
2 parents c36ce27 + 3d8aed3 commit 1baa66d

21 files changed

+62
-183
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{% note warning %}
2+
3+
{% include [column-and-row-tables-in-read-only-tx](./limitation-column-row-in-read-only-tx.md) %}
4+
5+
{% endnote %}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The simultaneous use of [column-oriented tables](../concepts/glossary.md#column-oriented-table) and [row-oriented tables](../concepts/glossary.md#row-oriented-table) is possible only in read-only transactions. Support for write transactions involving both types of tables simultaneously is under development.
2+
3+
If a write transaction includes both types of tables, it fails with the following error: `Write transactions between column and row tables are disabled at current time`.

ydb/docs/en/core/concepts/_includes/transactions.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ A [topic](../topic.md) in {{ ydb-short-name }} can be sharded into several parti
5757

5858
## Transactions with topics and tables {#topic-table-transactions}
5959

60+
{% note warning %}
61+
62+
{% include [not_allow_for_olap](../../_includes/not_allow_for_olap_text.md) %}
63+
64+
{% endnote %}
65+
6066
{{ ydb-short-name }} supports transactions involving [row-oriented tables](../glossary.md#row-oriented-table) and/or [topics](../glossary.md#topic). This makes it possible to transactionally transfer data from tables to topics and vice versa, as well as between topics. This ensures that data is neither lost nor duplicated in case of a network outage or other issues. This enables the implementation of the transactional outbox pattern within {{ ydb-short-name }}.
6167

62-
For more information about transactions with tables and topics in {{ ydb-short-name }}, see [{#T}](../topic.md#topic-transactions) and [{#T}](../../reference/ydb-sdk/topic.md).
68+
For more information about transactions with tables and topics in {{ ydb-short-name }}, see [{#T}](../topic.md#topic-transactions) and [{#T}](../../reference/ydb-sdk/topic.md).
69+
70+
## Transactions with Column and Row Tables {#mixed-transactions}
71+
72+
{% include [limitation](../../_includes/limitation-column-row-in-read-only-tx.md) %}

ydb/docs/en/core/yql/reference/syntax/delete.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
# DELETE FROM
22

3-
{% if oss == true and backend_name == "YDB" %}
4-
5-
{% note warning %}
6-
7-
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.
8-
9-
Instead of using `DELETE FROM` to delete data from colum-oriented tables, you can use the mechanism of deleting rows by time — [TTL](../../../concepts/ttl.md). TTL can be set when [creating](create_table/index.md) the table via `CREATE TABLE` or [modified](alter_table/index.md) later via `ALTER TABLE`.
10-
11-
{% endnote %}
12-
13-
{% endif %}
3+
{% include [column-and-row-tables-in-read-only-tx](../../../_includes/limitation-column-row-in-read-only-tx-warn.md) %}
144

155
Deletes rows that match the `WHERE` clause, from the table.{% if feature_mapreduce %} The table is searched by name in the database specified by the [USE](use.md) operator.{% endif %}
166

ydb/docs/en/core/yql/reference/syntax/insert_into.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,8 @@
11
# INSERT INTO
22

3-
{% if oss == true and backend_name == "YDB" %}
3+
{% include [column-and-row-tables-in-read-only-tx](../../../_includes/limitation-column-row-in-read-only-tx-warn.md) %}
44

5-
{% note warning %}
6-
7-
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.
8-
9-
{% if oss %}
10-
11-
Available methods for loading data into columnar tables:
12-
13-
* [{{ ydb-short-name }} CLI](../../../reference/ydb-cli/export-import/import-file.md)
14-
* [Bulk data upsert](../../../recipes/ydb-sdk/bulk-upsert.md)
15-
* [Yandex Data Transfer](https://yandex.cloud/ru/services/data-transfer)
16-
17-
{% endif %}
18-
19-
{% endnote %}
20-
21-
{% endif %}
22-
23-
{% if select_command != "SELECT STREAM" %} Adds rows to the table. {% if feature_bulk_tables %} If the target table already exists and is not sorted, the operation `INSERT INTO` adds rows at the end of the table. In the case of a sorted table, YQL tries to preserve sorting by running a sorted merge. {% endif %}{% if feature_map_tables %} If you try to insert a row into a table with an existing primary key value, the operation fails with the `PRECONDITION_FAILED` error code and the `Operation aborted due to constraint violation: insert_pk` message returned.{% endif %}
5+
{% if select_command != "SELECT STREAM" %} Adds rows to the table.{% if feature_bulk_tables %} If the target table already exists and is not sorted, the operation `INSERT INTO` adds rows at the end of the table. In the case of a sorted table, YQL tries to preserve sorting by running a sorted merge. {% endif %}{% if feature_map_tables %} If you try to insert a row into a table with an existing primary key value, the operation fails with the `PRECONDITION_FAILED` error code and the `Operation aborted due to constraint violation: insert_pk` message returned.{% endif %}
246

257
{% if feature_mapreduce %}The table is searched by name in the database specified by the [USE](use.md) operator.{% endif %}
268

ydb/docs/en/core/yql/reference/syntax/replace_into.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
# REPLACE INTO
22

3-
{% if oss == true and backend_name == "YDB" %}
4-
5-
{% note warning %}
6-
7-
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.
8-
9-
{% if oss %}
10-
11-
Available methods for loading data into columnar tables:
12-
13-
* [{{ ydb-short-name }} CLI](../../../reference/ydb-cli/export-import/import-file.md)
14-
* [Bulk data upsert](../../../recipes/ydb-sdk/bulk-upsert.md)
15-
* [Yandex Data Transfer](https://yandex.cloud/ru/services/data-transfer)
16-
17-
{% endif %}
18-
19-
{% endnote %}
20-
21-
{% endif %}
3+
{% include [column-and-row-tables-in-read-only-tx](../../../_includes/limitation-column-row-in-read-only-tx-warn.md) %}
224

235
Saves data to a table, overwriting the rows based on the primary key.{% if feature_mapreduce %} The table is searched by name in the database specified by the [USE](use.md) operator.{% endif %} If the given primary key is missing, a new row is added to the table. If the given `PRIMARY_KEY` exists, the row is overwritten. The values of columns not involved in the operation are replaced by their default values.
246

ydb/docs/en/core/yql/reference/syntax/update.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
# UPDATE
22

3-
{% if oss == true and backend_name == "YDB" %}
4-
5-
{% note warning %}
6-
7-
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.
8-
9-
{% if oss %}
10-
11-
Available methods for loading data into columnar tables:
12-
13-
* [{{ ydb-short-name }} CLI](../../../reference/ydb-cli/export-import/import-file.md)
14-
* [Bulk data upsert](../../../recipes/ydb-sdk/bulk-upsert.md)
15-
* [Yandex Data Transfer](https://yandex.cloud/ru/services/data-transfer)
16-
17-
{% endif %}
18-
19-
{% endnote %}
20-
21-
{% endif %}
3+
{% include [column-and-row-tables-in-read-only-tx](../../../_includes/limitation-column-row-in-read-only-tx-warn.md) %}
224

235
Updates the data in the table.{% if feature_mapreduce %} The table is searched by name in the database specified by the [USE](use.md) operator.{% endif %} After the `SET` keyword, enter the columns where you want to update values and the new values themselves. The list of rows is defined by the `WHERE` clause. If `WHERE` is omitted, the updates are applied to all the rows of the table.
246

ydb/docs/en/core/yql/reference/syntax/upsert_into.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
# UPSERT INTO
22

3-
{% if oss == true and backend_name == "YDB" %}
4-
5-
{% note warning %}
6-
7-
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.
8-
9-
{% if oss %}
10-
11-
Available methods for loading data into columnar tables:
12-
13-
* [{{ ydb-short-name }} CLI](../../../reference/ydb-cli/export-import/import-file.md)
14-
* [Bulk data upsert](../../../recipes/ydb-sdk/bulk-upsert.md)
15-
* [Yandex Data Transfer](https://yandex.cloud/ru/services/data-transfer)
16-
17-
{% endif %}
18-
19-
{% endnote %}
20-
21-
{% endif %}
3+
{% include [column-and-row-tables-in-read-only-tx](../../../_includes/limitation-column-row-in-read-only-tx-warn.md) %}
224

235
UPSERT (which stands for UPDATE or INSERT) updates or inserts multiple rows to a table based on a comparison by the primary key. Missing rows are added. For the existing rows, the values of the specified columns are updated, but the values of the other columns are preserved.
246

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{% note warning %}
2+
3+
{% include [column-and-row-tables-in-read-only-tx](./limitation-column-row-in-read-only-tx.md) %}
4+
5+
{% endnote %}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
В настоящее время одновременное использование [колоночных](../concepts/glossary.md#column-oriented-table) и [строковых](../concepts/glossary.md#row-oriented-table) таблиц возможно только в Read-Only транзакциях. Поддержка транзакций с возможностью записи при одновременном использовании строковых и колоночных таблиц находится в разработке.
2+
3+
Если попытаться выполнить операцию записи в транзакции, в которой задействованы и колоночные, и строковые таблицы, транзакция завершится с ошибкой: `Write transactions between column and row tables are disabled at current time`.

0 commit comments

Comments
 (0)