diff --git a/ydb/docs/en/core/_includes/limitation-column-row-in-read-only-tx-warn.md b/ydb/docs/en/core/_includes/limitation-column-row-in-read-only-tx-warn.md new file mode 100644 index 000000000000..be17501ecb1c --- /dev/null +++ b/ydb/docs/en/core/_includes/limitation-column-row-in-read-only-tx-warn.md @@ -0,0 +1,5 @@ +{% note warning %} + +{% include [column-and-row-tables-in-read-only-tx](./limitation-column-row-in-read-only-tx.md) %} + +{% endnote %} \ No newline at end of file diff --git a/ydb/docs/en/core/_includes/limitation-column-row-in-read-only-tx.md b/ydb/docs/en/core/_includes/limitation-column-row-in-read-only-tx.md new file mode 100644 index 000000000000..a331b9e047e3 --- /dev/null +++ b/ydb/docs/en/core/_includes/limitation-column-row-in-read-only-tx.md @@ -0,0 +1,3 @@ +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. + +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`. \ No newline at end of file diff --git a/ydb/docs/en/core/concepts/_includes/transactions.md b/ydb/docs/en/core/concepts/_includes/transactions.md index 1e1d08830b3b..5e4e104f99f6 100644 --- a/ydb/docs/en/core/concepts/_includes/transactions.md +++ b/ydb/docs/en/core/concepts/_includes/transactions.md @@ -57,6 +57,16 @@ A [topic](../topic.md) in {{ ydb-short-name }} can be sharded into several parti ## Transactions with topics and tables {#topic-table-transactions} +{% note warning %} + +{% include [not_allow_for_olap](../../_includes/not_allow_for_olap_text.md) %} + +{% endnote %} + {{ 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 }}. -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). \ No newline at end of file +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). + +## Transactions with Column and Row Tables {#mixed-transactions} + +{% include [limitation](../../_includes/limitation-column-row-in-read-only-tx.md) %} diff --git a/ydb/docs/en/core/yql/reference/syntax/delete.md b/ydb/docs/en/core/yql/reference/syntax/delete.md index 335c9be619da..ff182260bebf 100644 --- a/ydb/docs/en/core/yql/reference/syntax/delete.md +++ b/ydb/docs/en/core/yql/reference/syntax/delete.md @@ -1,16 +1,6 @@ # DELETE FROM -{% if oss == true and backend_name == "YDB" %} - -{% note warning %} - -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. - -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`. - -{% endnote %} - -{% endif %} +{% include [column-and-row-tables-in-read-only-tx](../../../_includes/limitation-column-row-in-read-only-tx-warn.md) %} 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 %} diff --git a/ydb/docs/en/core/yql/reference/syntax/insert_into.md b/ydb/docs/en/core/yql/reference/syntax/insert_into.md index 8ca50f196e5c..d7657244f4ce 100644 --- a/ydb/docs/en/core/yql/reference/syntax/insert_into.md +++ b/ydb/docs/en/core/yql/reference/syntax/insert_into.md @@ -1,26 +1,8 @@ # INSERT INTO -{% if oss == true and backend_name == "YDB" %} +{% include [column-and-row-tables-in-read-only-tx](../../../_includes/limitation-column-row-in-read-only-tx-warn.md) %} -{% note warning %} - -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. - -{% if oss %} - -Available methods for loading data into columnar tables: - -* [{{ ydb-short-name }} CLI](../../../reference/ydb-cli/export-import/import-file.md) -* [Bulk data upsert](../../../recipes/ydb-sdk/bulk-upsert.md) -* [Yandex Data Transfer](https://yandex.cloud/ru/services/data-transfer) - -{% endif %} - -{% endnote %} - -{% endif %} - -{% 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 %} +{% 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 %} {% if feature_mapreduce %}The table is searched by name in the database specified by the [USE](use.md) operator.{% endif %} diff --git a/ydb/docs/en/core/yql/reference/syntax/replace_into.md b/ydb/docs/en/core/yql/reference/syntax/replace_into.md index a7235c96b7ff..149188a934cd 100644 --- a/ydb/docs/en/core/yql/reference/syntax/replace_into.md +++ b/ydb/docs/en/core/yql/reference/syntax/replace_into.md @@ -1,24 +1,6 @@ # REPLACE INTO -{% if oss == true and backend_name == "YDB" %} - -{% note warning %} - -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. - -{% if oss %} - -Available methods for loading data into columnar tables: - -* [{{ ydb-short-name }} CLI](../../../reference/ydb-cli/export-import/import-file.md) -* [Bulk data upsert](../../../recipes/ydb-sdk/bulk-upsert.md) -* [Yandex Data Transfer](https://yandex.cloud/ru/services/data-transfer) - -{% endif %} - -{% endnote %} - -{% endif %} +{% include [column-and-row-tables-in-read-only-tx](../../../_includes/limitation-column-row-in-read-only-tx-warn.md) %} 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. diff --git a/ydb/docs/en/core/yql/reference/syntax/update.md b/ydb/docs/en/core/yql/reference/syntax/update.md index a970a895e6a2..69ddb07ff878 100644 --- a/ydb/docs/en/core/yql/reference/syntax/update.md +++ b/ydb/docs/en/core/yql/reference/syntax/update.md @@ -1,24 +1,6 @@ # UPDATE -{% if oss == true and backend_name == "YDB" %} - -{% note warning %} - -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. - -{% if oss %} - -Available methods for loading data into columnar tables: - -* [{{ ydb-short-name }} CLI](../../../reference/ydb-cli/export-import/import-file.md) -* [Bulk data upsert](../../../recipes/ydb-sdk/bulk-upsert.md) -* [Yandex Data Transfer](https://yandex.cloud/ru/services/data-transfer) - -{% endif %} - -{% endnote %} - -{% endif %} +{% include [column-and-row-tables-in-read-only-tx](../../../_includes/limitation-column-row-in-read-only-tx-warn.md) %} 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. diff --git a/ydb/docs/en/core/yql/reference/syntax/upsert_into.md b/ydb/docs/en/core/yql/reference/syntax/upsert_into.md index 844e8063ea1c..240dd3be80d5 100644 --- a/ydb/docs/en/core/yql/reference/syntax/upsert_into.md +++ b/ydb/docs/en/core/yql/reference/syntax/upsert_into.md @@ -1,24 +1,6 @@ # UPSERT INTO -{% if oss == true and backend_name == "YDB" %} - -{% note warning %} - -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. - -{% if oss %} - -Available methods for loading data into columnar tables: - -* [{{ ydb-short-name }} CLI](../../../reference/ydb-cli/export-import/import-file.md) -* [Bulk data upsert](../../../recipes/ydb-sdk/bulk-upsert.md) -* [Yandex Data Transfer](https://yandex.cloud/ru/services/data-transfer) - -{% endif %} - -{% endnote %} - -{% endif %} +{% include [column-and-row-tables-in-read-only-tx](../../../_includes/limitation-column-row-in-read-only-tx-warn.md) %} 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. diff --git a/ydb/docs/ru/core/_includes/limitation-column-row-in-read-only-tx-warn.md b/ydb/docs/ru/core/_includes/limitation-column-row-in-read-only-tx-warn.md new file mode 100644 index 000000000000..be17501ecb1c --- /dev/null +++ b/ydb/docs/ru/core/_includes/limitation-column-row-in-read-only-tx-warn.md @@ -0,0 +1,5 @@ +{% note warning %} + +{% include [column-and-row-tables-in-read-only-tx](./limitation-column-row-in-read-only-tx.md) %} + +{% endnote %} \ No newline at end of file diff --git a/ydb/docs/ru/core/_includes/limitation-column-row-in-read-only-tx.md b/ydb/docs/ru/core/_includes/limitation-column-row-in-read-only-tx.md new file mode 100644 index 000000000000..eaf11b11ce86 --- /dev/null +++ b/ydb/docs/ru/core/_includes/limitation-column-row-in-read-only-tx.md @@ -0,0 +1,3 @@ +В настоящее время одновременное использование [колоночных](../concepts/glossary.md#column-oriented-table) и [строковых](../concepts/glossary.md#row-oriented-table) таблиц возможно только в Read-Only транзакциях. Поддержка транзакций с возможностью записи при одновременном использовании строковых и колоночных таблиц находится в разработке. + +Если попытаться выполнить операцию записи в транзакции, в которой задействованы и колоночные, и строковые таблицы, транзакция завершится с ошибкой: `Write transactions between column and row tables are disabled at current time`. diff --git a/ydb/docs/ru/core/concepts/_includes/transactions.md b/ydb/docs/ru/core/concepts/_includes/transactions.md index 167f43e5a3a4..647b4dec5fb8 100644 --- a/ydb/docs/ru/core/concepts/_includes/transactions.md +++ b/ydb/docs/ru/core/concepts/_includes/transactions.md @@ -55,6 +55,16 @@ ## Транзакции с участием топиков и таблиц {#topic-table-transactions} +{% note warning %} + +{% include [not_allow_for_olap](../../_includes/not_allow_for_olap_text.md) %} + +{% endnote %} + {{ ydb-short-name }} поддерживает транзакции с участием [строковых таблиц](../glossary.md#row-oriented-table) и/или топиков. Таким образом, можно транзакционно перекладывать данные из таблиц в топики и в обратном направлении, а также между топиками, чтобы данные не терялись и не дублировались даже в случае непредвиденных обстоятельств. -Подробнее о транзакционных операциях при работе с топиками см. в [{#T}](../topic.md#topic-transactions) и [{#T}](../../reference/ydb-sdk/topic.md). \ No newline at end of file +Подробнее о транзакционных операциях при работе с топиками см. в [{#T}](../topic.md#topic-transactions) и [{#T}](../../reference/ydb-sdk/topic.md). + +## Транзакции с участием строковых и столбцовых таблиц {#mixed-transactions} + +{% include [limitation](../../_includes/limitation-column-row-in-read-only-tx.md) %} diff --git a/ydb/docs/ru/core/concepts/transactions.md b/ydb/docs/ru/core/concepts/transactions.md index 6f13c8538067..6c10a41f3350 100644 --- a/ydb/docs/ru/core/concepts/transactions.md +++ b/ydb/docs/ru/core/concepts/transactions.md @@ -1 +1 @@ -{% include [transactions.md](_includes/transactions.md) %} \ No newline at end of file +{% include [transactions.md](./_includes/transactions.md) %} \ No newline at end of file diff --git a/ydb/docs/ru/core/dev/yql-tutorial/fill_tables_with_data.md b/ydb/docs/ru/core/dev/yql-tutorial/fill_tables_with_data.md index fbbca78bb9c2..0b50ecae3b56 100755 --- a/ydb/docs/ru/core/dev/yql-tutorial/fill_tables_with_data.md +++ b/ydb/docs/ru/core/dev/yql-tutorial/fill_tables_with_data.md @@ -1,14 +1,6 @@ # Добавление данных в таблицы -{% note warning %} - -{% include [not_allow_for_olap](../../_includes/not_allow_for_olap_text.md) %} - -{% include [not_allow_for_olap](../../_includes/ways_add_data_to_olap.md) %} - -{% endnote %} - -Наполните данными [созданные](create_demo_tables.md) ранее строковые таблицы с помощью конструкции [REPLACE INTO](../../yql/reference/syntax/replace_into.md). +Наполните данными [созданные ранее](create_demo_tables.md) таблицы с помощью конструкции [REPLACE INTO](../../yql/reference/syntax/replace_into.md). ```yql REPLACE INTO series (series_id, title, release_date, series_info) diff --git a/ydb/docs/ru/core/dev/yql-tutorial/insert_into.md b/ydb/docs/ru/core/dev/yql-tutorial/insert_into.md index bbd478df3fbd..96d73454e81a 100755 --- a/ydb/docs/ru/core/dev/yql-tutorial/insert_into.md +++ b/ydb/docs/ru/core/dev/yql-tutorial/insert_into.md @@ -1,14 +1,8 @@ # Вставка данных с помощью INSERT -{% note warning %} +{% include [column-and-row-tables-in-read-only-tx](../../_includes/limitation-column-row-in-read-only-tx-warn.md) %} -{% include [not_allow_for_olap](../../_includes/not_allow_for_olap_text.md) %} - -{% include [not_allow_for_olap](../../_includes/ways_add_data_to_olap.md) %} - -{% endnote %} - -Добавьте данные в строковую таблицу с помощью конструкции [INSERT INTO](../../yql/reference/syntax/insert_into.md). +Добавьте данные в таблицу с помощью конструкции [INSERT INTO](../../yql/reference/syntax/insert_into.md). {% include [yql-reference-prerequisites](_includes/yql_tutorial_prerequisites.md) %} diff --git a/ydb/docs/ru/core/dev/yql-tutorial/replace_into.md b/ydb/docs/ru/core/dev/yql-tutorial/replace_into.md index cb635ac293cb..431cfcc71010 100755 --- a/ydb/docs/ru/core/dev/yql-tutorial/replace_into.md +++ b/ydb/docs/ru/core/dev/yql-tutorial/replace_into.md @@ -1,14 +1,8 @@ # Вставка и модификация данных с помощью REPLACE -{% note warning %} +{% include [column-and-row-tables-in-read-only-tx](../../_includes/limitation-column-row-in-read-only-tx-warn.md) %} -{% include [not_allow_for_olap](../../_includes/not_allow_for_olap_text.md) %} - -{% include [not_allow_for_olap](../../_includes/ways_add_data_to_olap.md) %} - -{% endnote %} - -Добавьте данные в строковые таблицы с помощью конструкции [REPLACE INTO](../../yql/reference/syntax/replace_into.md). +Добавьте новые данные в таблицы с одновременным обновлением уже существующих данных с помощью конструкции [REPLACE INTO](../../yql/reference/syntax/replace_into.md). {% include [yql-reference-prerequisites](_includes/yql_tutorial_prerequisites.md) %} diff --git a/ydb/docs/ru/core/reference/ydb-cli/parameterized-queries-cli.md b/ydb/docs/ru/core/reference/ydb-cli/parameterized-queries-cli.md index 74567e0a49bd..b6c5b0083809 100644 --- a/ydb/docs/ru/core/reference/ydb-cli/parameterized-queries-cli.md +++ b/ydb/docs/ru/core/reference/ydb-cli/parameterized-queries-cli.md @@ -485,11 +485,9 @@ for i in $(seq 1 200);do echo "Line$i";done | \ #### Удаление множества записей из строковой таблицы {{ ydb-short-name }} по первичным ключам {#example-adaptive-delete-pk} -{% include [not_allow_for_olap_note](../../_includes/not_allow_for_olap_note.md) %} +Данный пример показывает, как можно удалять неограниченное количество записей из строковых таблиц {{ ydb-short-name }}, не рискуя превысить ограничения на количество записей в транзакции. -Данный пример показывает как можно удалять неограниченное количество записей из строковых таблиц {{ ydb-short-name }}, не рискуя превысить ограничения на количество записей в транзакции. - -Создадим тестовую строковую таблицу: +Создайте тестовую строковую таблицу: ```bash {{ ydb-cli }} -p quickstart yql -s 'create table test_delete_1( id UInt64 not null, primary key (id))' diff --git a/ydb/docs/ru/core/yql/reference/syntax/delete.md b/ydb/docs/ru/core/yql/reference/syntax/delete.md index 30d727530876..0990a33fce97 100644 --- a/ydb/docs/ru/core/yql/reference/syntax/delete.md +++ b/ydb/docs/ru/core/yql/reference/syntax/delete.md @@ -1,19 +1,9 @@ # DELETE FROM -{% if oss == true and backend_name == "YDB" %} +{% include [column-and-row-tables-in-read-only-tx](../../../_includes/limitation-column-row-in-read-only-tx-warn.md) %} -{% note warning %} - -{% include [OLAP_not_allow_text](../../../_includes/not_allow_for_olap_text.md) %} - -Вместо `DELETE FROM` для удаления данных из колоночных таблиц можно воспользоваться механизмом удаления строк по времени — [TTL](../../../concepts/ttl.md). TTL можно задать при [создании](create_table/index.md) таблицы через `CREATE TABLE` или [измененить позже](alter_table/index.md) через `ALTER TABLE`. - -{% endnote %} - -{% endif %} - -Удаляет строки из строковой таблицы, подходящие под условия, заданные в `WHERE`.{% if feature_mapreduce %} Таблица ищется по имени в базе данных, заданной оператором [USE](use.md).{% endif %} +Удаляет строки из таблицы, подходящие под условия, заданные в `WHERE`.{% if feature_mapreduce %} Таблица ищется по имени в базе данных, заданной оператором [USE](use.md).{% endif %} ## Пример diff --git a/ydb/docs/ru/core/yql/reference/syntax/insert_into.md b/ydb/docs/ru/core/yql/reference/syntax/insert_into.md index b2b1030cd4e8..5b2e29b2acc5 100644 --- a/ydb/docs/ru/core/yql/reference/syntax/insert_into.md +++ b/ydb/docs/ru/core/yql/reference/syntax/insert_into.md @@ -1,20 +1,10 @@ # INSERT INTO -{% if oss == true and backend_name == "YDB" %} - -{% note warning %} - -{% include [OLAP_not_allow_text](../../../_includes/not_allow_for_olap_text.md) %} - -{% include [ways_add_data_to_olap](../../../_includes/ways_add_data_to_olap.md) %} - -{% endnote %} - -{% endif %} +{% include [column-and-row-tables-in-read-only-tx](../../../_includes/limitation-column-row-in-read-only-tx-warn.md) %} {% if select_command != "SELECT STREAM" %} -Добавляет строки в {% if oss == true and backend_name == "YDB" %}строковую{% endif %} таблицу. {% if feature_bulk_tables %} Если целевая таблица уже существует и не является сортированной, операция `INSERT INTO` дописывает строки в конец таблицы. В случае сортированной таблицы, YQL пытается сохранить сортированность путем запуска сортированного слияния. {% endif %}{% if feature_map_tables %} При попытке вставить в таблицу строку с уже существующим значением первичного ключа операция завершится ошибкой с кодом `PRECONDITION_FAILED` и текстом `Operation aborted due to constraint violation: insert_pk`.{% endif %} +Добавляет строки в таблицу.{% if feature_bulk_tables %} Если целевая таблица уже существует и не является сортированной, операция `INSERT INTO` дописывает строки в конец таблицы. В случае сортированной таблицы, YQL пытается сохранить сортированность путем запуска сортированного слияния. {% endif %}{% if feature_map_tables %} При попытке вставить в таблицу строку с уже существующим значением первичного ключа операция завершится ошибкой с кодом `PRECONDITION_FAILED` и текстом `Operation aborted due to constraint violation: insert_pk`.{% endif %} {% if feature_mapreduce %}Таблица по имени ищется в базе данных, заданной оператором [USE](use.md).{% endif %} diff --git a/ydb/docs/ru/core/yql/reference/syntax/replace_into.md b/ydb/docs/ru/core/yql/reference/syntax/replace_into.md index 6426dad9f108..1ea9be42ec7a 100644 --- a/ydb/docs/ru/core/yql/reference/syntax/replace_into.md +++ b/ydb/docs/ru/core/yql/reference/syntax/replace_into.md @@ -1,18 +1,8 @@ # REPLACE INTO -{% if oss == true and backend_name == "YDB" %} +{% include [column-and-row-tables-in-read-only-tx](../../../_includes/limitation-column-row-in-read-only-tx-warn.md) %} -{% note warning %} - -{% include [OLAP_not_allow_text](../../../_includes/not_allow_for_olap_text.md) %} - -{% include [ways_add_data_to_olap](../../../_includes/ways_add_data_to_olap.md) %} - -{% endnote %} - -{% endif %} - -В отличие от [`INSERT INTO`](insert_into.md) и [`UPDATE`](update.md), запросы [`UPSERT INTO`](upsert_into.md) и `REPLACE INTO` не требуют предварительного чтения данных, поэтому выполняются быстрее. `REPLACE INTO` сохраняет данные в {% if backend_name == "YDB" and oss == true %}строковую таблицу{% else %}таблицу{% endif %} с перезаписью строк по первичному ключу.{% if feature_mapreduce %} Таблица по имени ищется в базе данных, заданной оператором [USE](use.md).{% endif %} Если заданный первичный ключ отсутствует, в таблицу будет добавлена новая строка. Если задан существующий `PRIMARY_KEY`, строка будет перезаписана. При этом значения столбцов, не участвующих в операции, заменяются на значения по умолчанию. +В отличие от [`INSERT INTO`](insert_into.md) и [`UPDATE`](update.md), запросы [`UPSERT INTO`](upsert_into.md) и `REPLACE INTO` не требуют предварительного чтения данных, поэтому выполняются быстрее. `REPLACE INTO` сохраняет данные в таблицу с перезаписью строк по первичному ключу.{% if feature_mapreduce %} Таблица ищется по имени в базе данных, заданной оператором [USE](use.md).{% endif %} Если заданный первичный ключ отсутствует, в таблицу будет добавлена новая строка. Если задан существующий первичный ключ, строка будет перезаписана. При этом значения столбцов, не определенных в операции `REPLACE INTO`, заменяются на значения по умолчанию. ## Примеры diff --git a/ydb/docs/ru/core/yql/reference/syntax/update.md b/ydb/docs/ru/core/yql/reference/syntax/update.md index dc5583eb5efc..2d646d14bde7 100644 --- a/ydb/docs/ru/core/yql/reference/syntax/update.md +++ b/ydb/docs/ru/core/yql/reference/syntax/update.md @@ -1,24 +1,12 @@ # UPDATE -{% if oss == true and backend_name == "YDB" %} +{% include [column-and-row-tables-in-read-only-tx](../../../_includes/limitation-column-row-in-read-only-tx-warn.md) %} -{% note warning %} - -{% include [OLAP_not_allow_text](../../../_includes/not_allow_for_olap_text.md) %} - -{% include [ways_add_data_to_olap.md](../../../_includes/ways_add_data_to_olap.md) %} - -{% endnote %} - -{% endif %} +Изменяет данные в таблице.{% if feature_mapreduce %} Таблица ищется по имени в базе данных, заданной оператором [USE](use.md).{% endif %} После ключевого слова `SET` через запятую указываются столбцы, значение которых необходимо заменить, и сами новые значения. Список обновляемых строк задается с помощью условия `WHERE`. Если условие `WHERE` отсутствует, изменения будут применены ко всем строкам таблицы. `UPDATE` не может менять значение колонок, входящих в состав первичного ключа. -Изменяет данные в строковой таблице.{% if feature_mapreduce %} Таблица по имени ищется в базе данных, заданной оператором [USE](use.md).{% endif %} После ключевого слова `SET` указываются столбцы, значение которых необходимо заменить, и сами новые значения. Список строк задается с помощью условия `WHERE`. Если `WHERE` отсутствует, изменения будут применены ко всем строкам таблицы. - -`UPDATE` не может менять значение `PRIMARY_KEY`. - ## Пример ```yql diff --git a/ydb/docs/ru/core/yql/reference/syntax/upsert_into.md b/ydb/docs/ru/core/yql/reference/syntax/upsert_into.md index 7695ee3e0a70..d30bb2a598d2 100644 --- a/ydb/docs/ru/core/yql/reference/syntax/upsert_into.md +++ b/ydb/docs/ru/core/yql/reference/syntax/upsert_into.md @@ -1,19 +1,8 @@ - # UPSERT INTO -{% if oss == true and backend_name == "YDB" %} - -{% note warning %} - -{% include [OLAP_not_allow_text](../../../_includes/not_allow_for_olap_text.md) %} - -{% include [ways_add_data_to_olap](../../../_includes/ways_add_data_to_olap.md) %} - -{% endnote %} - -{% endif %} +{% include [column-and-row-tables-in-read-only-tx](../../../_includes/limitation-column-row-in-read-only-tx-warn.md) %} -UPSERT (расшифровывается как UPDATE or INSERT) обновляет или добавляет множество строк в строковой таблице на основании сравнения по первичному ключу. Отсутствующие строки добавляются. В присутствующих строках обновляются значения заданных столбцов, значения остальных столбцов остаются неизменными. +UPSERT (расшифровывается как UPDATE or INSERT) обновляет или добавляет множество строк в таблице на основании сравнения по первичному ключу. Отсутствующие строки добавляются. В присутствующих строках обновляются значения заданных столбцов, значения остальных столбцов остаются неизменными. {% if feature_mapreduce %}