diff --git a/docs/sql-manual/sql-statements/data-modification/load-and-export/ALTER-ROUTINE-LOAD.md b/docs/sql-manual/sql-statements/data-modification/load-and-export/ALTER-ROUTINE-LOAD.md index 007a3ce4821bb..9842a25b62aef 100644 --- a/docs/sql-manual/sql-statements/data-modification/load-and-export/ALTER-ROUTINE-LOAD.md +++ b/docs/sql-manual/sql-statements/data-modification/load-and-export/ALTER-ROUTINE-LOAD.md @@ -2,104 +2,125 @@ { "title": "ALTER ROUTINE LOAD", "language": "en", - "description": "This syntax is used to modify an existing routine load job. Only jobs in PAUSED state can be modified." + "description": "Modifies a paused Routine Load job, including its Kafka target table, job properties, and Kafka source properties." } --- ## Description -This syntax is used to modify an existing routine load job. Only jobs in PAUSED state can be modified. +This statement modifies an existing Routine Load job. Only jobs in the `PAUSED` state can be modified. You can pause a Routine Load job by using [PAUSE ROUTINE LOAD](./PAUSE-ROUTINE-LOAD.md). + +After a successful modification, you can: + +- Use [SHOW ROUTINE LOAD](./SHOW-ROUTINE-LOAD.md) to check the modified job details. +- Use [RESUME ROUTINE LOAD](./RESUME-ROUTINE-LOAD.md) to restart the job. ## Syntax ```sql ALTER ROUTINE LOAD FOR [.] -[] -FROM [] -[] +[SET TARGET TABLE = ""] +[PROPERTIES ( + "" = "" + [, ...] +)] +[FROM ( + "" = "" + [, ...] +)]; ``` -## Required Parameters +## Parameters + +### 1. `[.]` + +Specifies the name of the job to modify. An identifier must start with a letter and cannot contain spaces or special characters unless the entire identifier is enclosed in backticks. + +An identifier cannot use a reserved keyword. For more information, see [Identifier Requirements](../../../basic-element/object-identifiers.md) and [Reserved Keywords](../../../basic-element/reserved-keywords.md). -**1. `[.]`** +### 2. `SET TARGET TABLE = ""` -> Specifies the name of the job to be modified. The identifier must begin with a letter character and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks. -> -> The identifier cannot use reserved keywords. For more details, please refer to identifier requirements and reserved keywords. +Specifies the new target table for the load job. -## Optional Parameters +Switching only the target table does not move historical data. Existing batches remain in the old table. After the job resumes, Doris continues consuming from the retained Kafka offsets and writes new batches to the new table. -**1. ``** +The target table must be in the same database as the job and must be a non-temporary OLAP table. Target-table switching supports only single-table Kafka Routine Load jobs. -> Specifies the job parameters to be modified. Currently supported parameters include: -> -> - desired_concurrent_number -> - max_error_number -> - max_batch_interval -> - max_batch_rows -> - max_batch_size -> - jsonpaths -> - json_root -> - strip_outer_array -> - strict_mode -> - timezone -> - num_as_string -> - fuzzy_parse -> - partial_columns -> - max_filter_ratio +### 3. `` -**2. ``** +Specifies the job properties to modify. The following properties are currently supported: -> Properties related to the data source. Currently supports: -> -> - `` -> - `` -> - `` -> - `` -> - Custom properties, such as `` +- `desired_concurrent_number` +- `max_error_number` +- `max_batch_interval` +- `max_batch_rows` +- `max_batch_size` +- `jsonpaths` +- `json_root` +- `strip_outer_array` +- `strict_mode` +- `timezone` +- `num_as_string` +- `fuzzy_parse` +- `partial_columns` +- `max_filter_ratio` -**3. ``** +### 4. `` -> The type of data source. Currently supports: -> -> - KAFKA +Specifies the data source type. When used together with `SET TARGET TABLE`, currently only the following type is supported: + +- `KAFKA` + +### 5. `` + +Specifies the data source properties to modify. The following properties are currently supported: + +- `kafka_broker_list` +- `kafka_topic` +- Custom properties, such as `property.group.id` +- `kafka_partitions` and `kafka_offsets`, which modify the offsets of Kafka partitions to be consumed. When `kafka_topic` is not changed, only currently consumed partitions can be modified; new partitions cannot be added. ## Access Control Requirements -Users executing this SQL command must have at least the following privileges: +The user executing this SQL command must have at least the following privileges: | Privilege | Object | Notes | -| :-------- | :----- | :---- | -| LOAD_PRIV | Table | ALTER ROUTINE LOAD requires LOAD privilege on the table | +| --- | --- | --- | +| `LOAD_PRIV` | Current target table | Required when modifying a single-table Routine Load job. | +| `LOAD_PRIV` | Database | Required when modifying a multi-table Routine Load job. | +| `LOAD_PRIV` | New target table | Additionally required when using `SET TARGET TABLE`. | + +## Examples -## Notes +### Modify `desired_concurrent_number` to `1` -- `kafka_partitions` and `kafka_offsets` are used to modify the offset of kafka partitions to be consumed, and can only modify currently consumed partitions. New partitions cannot be added. +```sql +ALTER ROUTINE LOAD FOR db1.label1 +PROPERTIES +( + "desired_concurrent_number" = "1" +); +``` -## Examples +### Modify `desired_concurrent_number`, partition offsets, and group ID + +```sql +ALTER ROUTINE LOAD FOR db1.label1 +PROPERTIES +( + "desired_concurrent_number" = "10" +) +FROM KAFKA +( + "kafka_partitions" = "0, 1, 2", + "kafka_offsets" = "100, 200, 100", + "property.group.id" = "new_group" +); +``` + +### Switch the target table to `new_table_name` -- Modify `desired_concurrent_number` to 1 - - ```sql - ALTER ROUTINE LOAD FOR db1.label1 - PROPERTIES - ( - "desired_concurrent_number" = "1" - ); - ``` - -- Modify `desired_concurrent_number` to 10, modify partition offsets, and modify group id - - ```sql - ALTER ROUTINE LOAD FOR db1.label1 - PROPERTIES - ( - "desired_concurrent_number" = "10" - ) - FROM kafka - ( - "kafka_partitions" = "0, 1, 2", - "kafka_offsets" = "100, 200, 100", - "property.group.id" = "new_group" - ); - ``` \ No newline at end of file +```sql +ALTER ROUTINE LOAD FOR db1.label1 +SET TARGET TABLE = "new_table_name"; +``` diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/load-and-export/ALTER-ROUTINE-LOAD.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/load-and-export/ALTER-ROUTINE-LOAD.md index 6d05564b98e60..13dbd1989b68a 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/load-and-export/ALTER-ROUTINE-LOAD.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/load-and-export/ALTER-ROUTINE-LOAD.md @@ -2,105 +2,125 @@ { "title": "ALTER ROUTINE LOAD", "language": "zh-CN", - "description": "该语法用于修改已经创建的例行导入作业。只能修改处于 PAUSED 状态的作业。" + "description": "修改已暂停的 Routine Load 作业,说明 Kafka 单表作业切换目标表、修改作业属性、更新 Kafka 数据源属性与消费 offset 的语法、权限要求和使用示例。" } --- ## 描述 -该语法用于修改已经创建的例行导入作业。只能修改处于 PAUSED 状态的作业。 +该语法用于修改已经创建的 Routine Load 导入作业。只能修改处于 `PAUSED` 状态的作业。您可以通过 [PAUSE ROUTINE LOAD](./PAUSE-ROUTINE-LOAD.md) 暂停 Routine Load 导入作业。 + +修改成功后,您可以: + +- 通过 [SHOW ROUTINE LOAD](./SHOW-ROUTINE-LOAD.md) 检查修改后的作业详情。 +- 通过 [RESUME ROUTINE LOAD](./RESUME-ROUTINE-LOAD.md) 重启该导入作业。 ## 语法 ```sql ALTER ROUTINE LOAD FOR [.] -[] -FROM [] -[] +[SET TARGET TABLE = ""] +[PROPERTIES ( + "" = "" + [, ...] +)] +[FROM ( + "" = "" + [, ...] +)]; ``` -## 必选参数 +## 参数说明 + +### 1. `[.]` + +指定要修改的作业名称。标识符必须以字母字符开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来。 + +标识符不能使用保留关键字。有关更多详细信息,请参阅[标识符要求](../../../basic-element/object-identifiers.md)和[保留关键字](../../../basic-element/reserved-keywords.md)。 -**1. `[.]`** +### 2. `SET TARGET TABLE = ""` -> 指定要修改的作业名称。标识符必须以字母字符开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来。 -> -> 标识符不能使用保留关键字。有关更多详细信息,请参阅标识符要求和保留关键字。 +指定要切换到的导入目标表。 -## 可选参数 +纯切表不会搬迁历史数据。旧批次仍保留在旧表中;作业恢复后,Doris 从保留的 Kafka offset 继续消费,并把新批次写入新表。 -**1. ``** +目标表必须与作业位于同一数据库,且为非临时 OLAP 表。只有单表 Kafka Routine Load 作业支持切换目标表。 -> 指定需要修改的作业参数。目前支持修改的参数包括: -> -> - desired_concurrent_number -> - max_error_number -> - max_batch_interval -> - max_batch_rows -> - max_batch_size -> - jsonpaths -> - json_root -> - strip_outer_array -> - strict_mode -> - timezone -> - num_as_string -> - fuzzy_parse -> - partial_columns -> - max_filter_ratio +### 3. `` -**2. ``** +指定需要修改的作业参数。目前支持修改的参数包括: -> 数据源的相关属性。目前支持: -> -> - kafka_partitions -> - kafka_offsets -> - kafka_broker_list -> - kafka_topic -> - 自定义 property,如 property.group.id +- `desired_concurrent_number` +- `max_error_number` +- `max_batch_interval` +- `max_batch_rows` +- `max_batch_size` +- `jsonpaths` +- `json_root` +- `strip_outer_array` +- `strict_mode` +- `timezone` +- `num_as_string` +- `fuzzy_parse` +- `partial_columns` +- `max_filter_ratio` -**3. ``** +### 4. `` -> 数据源的类型。当前支持: -> -> - KAFKA +数据源的类型。与 `SET TARGET TABLE` 组合使用时,当前仅支持: + +- `KAFKA` + +### 5. `` + +数据源的相关属性。目前仅支持: + +- `kafka_broker_list` +- `kafka_topic` +- 自定义 `property`,如 `property.group.id` +- `kafka_partitions` 和 `kafka_offsets`,用于修改待消费的 Kafka partition 的 offset。未修改 `kafka_topic` 时,仅能修改当前已经消费的 partition,不能新增 partition。 ## 权限控制 执行此 SQL 命令的用户必须至少具有以下权限: -| 权限(Privilege) | 对象(Object) | 说明(Notes) | -| :---------------- | :------------- | :---------------------------- | -| LOAD_PRIV | 表(Table) | SHOW ROUTINE LOAD 需要对表有LOAD权限 | +| 权限 | 对象 | 说明 | +| --- | --- | --- | +| `LOAD_PRIV` | 当前目标表 | 修改单表 Routine Load 作业时需要。 | +| `LOAD_PRIV` | 数据库 | 修改 multi-table Routine Load 作业时需要。 | +| `LOAD_PRIV` | 新目标表 | 使用 `SET TARGET TABLE` 时还需要此权限。 | -## 注意事项 +## 示例 -- `kafka_partitions` 和 `kafka_offsets` 用于修改待消费的 kafka partition 的 offset,仅能修改当前已经消费的 partition。不能新增 partition。 +### 将 `desired_concurrent_number` 修改为 `1` -## 示例 +```sql +ALTER ROUTINE LOAD FOR db1.label1 +PROPERTIES +( + "desired_concurrent_number" = "1" +); +``` -- 将 `desired_concurrent_number` 修改为 1 - - ```sql - ALTER ROUTINE LOAD FOR db1.label1 - PROPERTIES - ( - "desired_concurrent_number" = "1" - ); - ``` - -- 将 `desired_concurrent_number` 修改为 10,修改 partition 的 offset,修改 group id - - ```sql - ALTER ROUTINE LOAD FOR db1.label1 - PROPERTIES - ( - "desired_concurrent_number" = "10" - ) - FROM kafka - ( - "kafka_partitions" = "0, 1, 2", - "kafka_offsets" = "100, 200, 100", - "property.group.id" = "new_group" - ); - ``` +### 将 `desired_concurrent_number` 修改为 `10`,并修改 partition offset 和 group ID +```sql +ALTER ROUTINE LOAD FOR db1.label1 +PROPERTIES +( + "desired_concurrent_number" = "10" +) +FROM KAFKA +( + "kafka_partitions" = "0, 1, 2", + "kafka_offsets" = "100, 200, 100", + "property.group.id" = "new_group" +); +``` + +### 将目标表修改为 `new_table_name` + +```sql +ALTER ROUTINE LOAD FOR db1.label1 +SET TARGET TABLE = "new_table_name"; +``` diff --git a/ja-source/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/load-and-export/ALTER-ROUTINE-LOAD.md b/ja-source/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/load-and-export/ALTER-ROUTINE-LOAD.md index c0dd42e0ef24f..6e97a07dd94f3 100644 --- a/ja-source/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/load-and-export/ALTER-ROUTINE-LOAD.md +++ b/ja-source/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/load-and-export/ALTER-ROUTINE-LOAD.md @@ -2,101 +2,125 @@ { "title": "ALTER ROUTINE LOAD", "language": "ja", - "description": "この構文は既存のルーチンロードジョブを変更するために使用されます。PAUSED状態のジョブのみ変更可能です。" + "description": "一時停止中の Routine Load ジョブを変更する構文について、単一テーブルの Kafka Routine Load ジョブのターゲットテーブル切り替え、ジョブプロパティ、Kafka データソースプロパティ、権限、および使用例を説明します。" } --- + ## 説明 -この構文は、既存のroutine loadジョブを変更するために使用されます。PAUSED状態のジョブのみ変更できます。 +この構文は、作成済みの Routine Load ジョブを変更するために使用します。`PAUSED` 状態のジョブのみ変更できます。[PAUSE ROUTINE LOAD](./PAUSE-ROUTINE-LOAD.md) を使用して、Routine Load ジョブを一時停止できます。 + +変更が成功した後は、次の操作を実行できます。 + +- [SHOW ROUTINE LOAD](./SHOW-ROUTINE-LOAD.md) を使用して、変更後のジョブの詳細を確認します。 +- [RESUME ROUTINE LOAD](./RESUME-ROUTINE-LOAD.md) を使用して、ジョブを再開します。 ## 構文 ```sql ALTER ROUTINE LOAD FOR [.] -[] -FROM [] -[] +[SET TARGET TABLE = ""] +[PROPERTIES ( + "" = "" + [, ...] +)] +[FROM ( + "" = "" + [, ...] +)]; ``` -## 必須パラメータ - -**1. `[.]`** - -> 変更するジョブの名前を指定します。識別子は文字で始まる必要があり、識別子文字列全体がバッククォートで囲まれていない限り、スペースや特殊文字を含めることはできません。 -> -> 識別子は予約キーワードを使用できません。詳細については、識別子要件と予約キーワードを参照してください。 - -## オプションパラメータ - -**1. ``** - -> 変更するジョブパラメータを指定します。現在サポートされているパラメータには以下が含まれます: -> -> - desired_concurrent_number -> - max_error_number -> - max_batch_interval -> - max_batch_rows -> - max_batch_size -> - jsonpaths -> - json_root -> - strip_outer_array -> - strict_mode -> - timezone -> - num_as_string -> - fuzzy_parse -> - partial_columns -> - max_filter_ratio - -**2. ``** - -> データソースに関連するプロパティ。現在サポートされているもの: -> -> - `` -> - `` -> - `` -> - `` -> - ``などのカスタムプロパティ - -**3. ``** - -> データソースのタイプ。現在サポートされているもの: -> -> - KAFKA -## アクセス制御要件 +## パラメータ + +### 1. `[.]` + +変更するジョブ名を指定します。識別子は英字で始める必要があり、識別子全体をバッククォートで囲まない限り、空白または特殊文字を含めることはできません。 + +予約キーワードは識別子として使用できません。詳細については、[識別子の要件](../../../basic-element/object-identifiers.md)および[予約キーワード](../../../basic-element/reserved-keywords.md)を参照してください。 + +### 2. `SET TARGET TABLE = ""` + +切り替え先となる新しいターゲットテーブルを指定します。 + +ターゲットテーブルだけを切り替えても、過去のデータは移動されません。既存のバッチは旧テーブルに残ります。ジョブの再開後、Doris は保持されている Kafka オフセットから消費を続行し、新しいバッチを新しいテーブルに書き込みます。 + +ターゲットテーブルは、ジョブと同じデータベースに属する、一時テーブルではない OLAP テーブルである必要があります。ターゲットテーブルの切り替えは、単一テーブルの Kafka Routine Load ジョブでのみサポートされます。 + +### 3. `` + +変更するジョブプロパティを指定します。現在、次のプロパティがサポートされています。 + +- `desired_concurrent_number` +- `max_error_number` +- `max_batch_interval` +- `max_batch_rows` +- `max_batch_size` +- `jsonpaths` +- `json_root` +- `strip_outer_array` +- `strict_mode` +- `timezone` +- `num_as_string` +- `fuzzy_parse` +- `partial_columns` +- `max_filter_ratio` + +### 4. `` + +データソースの種類を指定します。`SET TARGET TABLE` と併用する場合、現在サポートされているのは次の種類のみです。 -このSQLコマンドを実行するユーザーは、少なくとも以下の権限を持つ必要があります: +- `KAFKA` -| 権限 | オブジェクト | 備考 | -| :-------- | :----- | :---- | -| LOAD_PRIV | テーブル | SHOW ROUTINE LOADはテーブルに対するLOAD権限が必要 | +### 5. `` -## 注意事項 +変更するデータソースプロパティを指定します。現在、次のプロパティがサポートされています。 -- `kafka_partitions`と`kafka_offsets`は、消費されるkafkaパーティションのオフセットを変更するために使用され、現在消費されているパーティションのみを変更できます。新しいパーティションを追加することはできません。 +- `kafka_broker_list` +- `kafka_topic` +- `property.group.id` などのカスタムプロパティ +- `kafka_partitions` と `kafka_offsets` は、消費対象の Kafka パーティションのオフセットを変更するために使用します。`kafka_topic` を変更しない場合、現在消費しているパーティションのオフセットのみ変更でき、新しいパーティションは追加できません。 + +## アクセス制御要件 + +この SQL コマンドを実行するユーザーには、少なくとも次の権限が必要です。 + +| 権限 | オブジェクト | 説明 | +| --- | --- | --- | +| `LOAD_PRIV` | 現在のターゲットテーブル | 単一テーブルの Routine Load ジョブを変更する場合に必要です。 | +| `LOAD_PRIV` | データベース | マルチテーブルの Routine Load ジョブを変更する場合に必要です。 | +| `LOAD_PRIV` | 新しいターゲットテーブル | `SET TARGET TABLE` を使用する場合に追加で必要です。 | ## 例 -- `desired_concurrent_number`を1に変更 - - ```sql - ALTER ROUTINE LOAD FOR db1.label1 - PROPERTIES - ( - "desired_concurrent_number" = "1" - ); - ``` -- `desired_concurrent_number`を10に変更し、パーティションオフセットを変更し、グループIDを変更する - - ```sql - ALTER ROUTINE LOAD FOR db1.label1 - PROPERTIES - ( - "desired_concurrent_number" = "10" - ) - FROM kafka - ( - "kafka_partitions" = "0, 1, 2", - "kafka_offsets" = "100, 200, 100", - "property.group.id" = "new_group" - ); - ``` +### `desired_concurrent_number` を `1` に変更する + +```sql +ALTER ROUTINE LOAD FOR db1.label1 +PROPERTIES +( + "desired_concurrent_number" = "1" +); +``` + +### `desired_concurrent_number` を `10` に変更し、パーティションのオフセットとグループ ID も変更する + +```sql +ALTER ROUTINE LOAD FOR db1.label1 +PROPERTIES +( + "desired_concurrent_number" = "10" +) +FROM KAFKA +( + "kafka_partitions" = "0, 1, 2", + "kafka_offsets" = "100, 200, 100", + "property.group.id" = "new_group" +); +``` + +### ターゲットテーブルを `new_table_name` に切り替える + +```sql +ALTER ROUTINE LOAD FOR db1.label1 +SET TARGET TABLE = "new_table_name"; +```