Skip to content

Commit

Permalink
[Improvement][Seatunnel-web] Document Placeholder feature (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
arshadmohammad authored Oct 16, 2024
1 parent 8418e01 commit 2c9d9e1
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,25 @@ Now ,let me show you how to use it.
#### Virtual Tables manage
![img.png](docs/images/VirtualImage.png)

### Features

#### 1 Configuration Placeholders
Placeholders are used in configurations to represent values that will be dynamically substituted at runtime or during processing.
They enhance configuration flexibility and reusability by allowing specific values to be injected as needed.

##### 1.1 Placeholder Format
\${p1:v1}: p1 is a placeholder for a configuration value. If the p1 value is not provided at execution time, the default value v1 is used.
\${p1}: If the p1 value is not provided at execution time, the execution will fail with an error.

##### 1.2 Escaping Placeholders
To escape placeholders, add a backslash before the placeholder. For example, \\\${p1:v1} or \\\${p1}.
This is necessary when you want to pass the placeholder as-is to the engine without replacing the value in Seatunnel-web.

##### 1.3 How Seatunnel-web Handles Placeholders
During job execution, before sending the job to the engine, Seatunnel-web replaces the actual values in placeholders. This ensures that the actual executed job is recorded in Seatunnel-web history.

NOTE: This feature is currently useful when execution is done through the API. The UI does not provide an option to pass placeholder values.

### Upgrades
#### 1. Upgrade from 1.0.1 or before to 1.0.2 or after.
Execute the following SQL to upgrade the database:
Expand Down
27 changes: 27 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,30 @@ sh bin/seatunnel-backend-daemon.sh start

#### 虚拟表
![img.png](docs/images/VirtualImage.png)

### 功能

#### 1 配置占位符
占位符用于配置中,表示将在运行时或处理过程中动态替换的值。
它们允许根据需要注入特定值,从而增强配置灵活性和可重用性。

#### 1.1 占位符格式
\${p1:v1}:p1 是配置值的占位符。如果在执行时未提供 p1 值,则使用默认值 v1。
\${p1}:如果在执行时未提供 p1 值,则执行将失败并出现错误。

#### 1.2 转义占位符
要转义占位符,请在占位符前添加反斜杠。例如,\\\${p1:v1} 或 \\\${p1}。
当您想将占位符按原样传递给引擎而不替换 Seatunnel-web 中的值时,这是必需的。

##### 1.3 Seatunnel-web 如何处理占位符
在作业执行期间,在将作业发送到引擎之前,Seatunnel-web 会替换占位符中的实际值。这可确保实际执行的作业记录在 Seatunnel-web 历史记录中。

注意:此功能目前在通过 API 执行时很有用。UI 不提供传递占位符值的选项。

### 升级
#### 1. 从 1.0.1 或之前版本升级到 1.0.2 或之后版本。
执行以下 SQL 升级数据库:

```ALTER TABLE `t_st_job_instance` ADD COLUMN `error_message` varchar(4096) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL;```


0 comments on commit 2c9d9e1

Please sign in to comment.