Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/upstream/dev' into transfo…
Browse files Browse the repository at this point in the history
…rm_sql_schema_change
  • Loading branch information
CosmosNi committed Jan 24, 2025
2 parents 482f43b + a3513eb commit d0b3c77
Show file tree
Hide file tree
Showing 235 changed files with 7,928 additions and 2,223 deletions.
1 change: 1 addition & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ header:
- '**/*.ini'
- '**/*.svg'
- '**/*.txt'
- '**/*.csv'
- '**/.gitignore'
- '**/LICENSE'
- '**/NOTICE'
Expand Down
4 changes: 2 additions & 2 deletions bin/install-plugin.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ REM Get seatunnel home
set "SEATUNNEL_HOME=%~dp0..\"
echo Set SEATUNNEL_HOME to [%SEATUNNEL_HOME%]

REM Connector default version is 2.3.9, you can also choose a custom version. eg: 2.3.9: install-plugin.bat 2.3.9
set "version=2.3.9"
REM Connector default version is 2.3.10, you can also choose a custom version. eg: 2.3.10: install-plugin.bat 2.3.10
set "version=2.3.10"
if not "%~1"=="" set "version=%~1"

REM Create the lib directory
Expand Down
4 changes: 2 additions & 2 deletions bin/install-plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
# get seatunnel home
SEATUNNEL_HOME=$(cd $(dirname $0);cd ../;pwd)

# connector default version is 2.3.9, you can also choose a custom version. eg: 2.3.9: sh install-plugin.sh 2.3.9
version=2.3.9
# connector default version is 2.3.10, you can also choose a custom version. eg: 2.3.10: sh install-plugin.sh 2.3.10
version=2.3.10

if [ -n "$1" ]; then
version="$1"
Expand Down
4 changes: 2 additions & 2 deletions deploy/kubernetes/seatunnel/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ keywords:
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 2.3.9
version: 2.3.10

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 2.3.9
appVersion: 2.3.10
2 changes: 2 additions & 0 deletions docs/en/concept/sink-options-placeholders.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ The placeholders are mainly controlled by the following expressions:
- Used to get the table unique-key fields in the upstream catalog table
- `${field_names}`
- Used to get the table field keys in the upstream catalog table
- `${comment}`
- Used to get the table comment in the upstream catalog table

## Configuration

Expand Down
48 changes: 46 additions & 2 deletions docs/en/connector-v2/Config-Encryption-Decryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Base64 encryption support encrypt the following parameters:
- username
- password
- auth
- token
- access_key
- secret_key

Next, I'll show how to quickly use SeaTunnel's own `base64` encryption:

Expand Down Expand Up @@ -130,13 +133,14 @@ If you want to customize the encryption method and the configuration of the encr

1. Create a java maven project

2. Add `seatunnel-api` module in dependencies like the following shown:
2. Add `seatunnel-api` module with the provided scope in dependencies like the following shown:

```xml
<dependency>
<groupId>org.apache.seatunnel</groupId>
<artifactId>seatunnel-api</artifactId>
<version>${seatunnel.version}</version>
<scope>provided</scope>
</dependency>
```
3. Create a new class and implement interface `ConfigShade`, this interface has the following methods:
Expand Down Expand Up @@ -174,7 +178,47 @@ If you want to customize the encryption method and the configuration of the encr
}
}
```
4. Add `org.apache.seatunnel.api.configuration.ConfigShade` in `resources/META-INF/services`
4. Create a file named `org.apache.seatunnel.api.configuration.ConfigShade` in `resources/META-INF/services`, the file content should be the fully qualified class name of the class that you defined in step 3.

5. Package it to jar and add jar to `${SEATUNNEL_HOME}/lib`
6. Change the option `shade.identifier` to the value that you defined in `ConfigShade#getIdentifier`of you config file, please enjoy it \^_\^

### How to encrypt and decrypt with customized params

If you want to encrypt and decrypt with customized params, you can follow the steps below:
1. Add a configuration named `shade.properties` in the env part of the configuration file, the value of this configuration is in the form of key-value pairs (the type of the key must be a string), as shown below:

```hocon
env {
shade.properties = {
suffix = "666"
}
}
```

2. Override the `ConfigShade` interface's `open` method, as shown below:

```java
public static class ConfigShadeWithProps implements ConfigShade {

private String suffix;
private String identifier = "withProps";

@Override
public void open(Map<String, Object> props) {
this.suffix = String.valueOf(props.get("suffix"));
}
}
```
3. Use the parameters passed in the open method in the encryption and decryption methods, as shown below:

```java
public String encrypt(String content) {
return content + suffix;
}

public String decrypt(String content) {
return content.substring(0, content.length() - suffix.length());
}
```
7 changes: 5 additions & 2 deletions docs/en/connector-v2/sink/Clickhouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ CREATE TABLE IF NOT EXISTS `${database}`.`${table}` (
ORDER BY (${rowtype_primary_key})
PRIMARY KEY (${rowtype_primary_key})
SETTINGS
index_granularity = 8192;
index_granularity = 8192
COMMENT '${comment}';
```

If custom fields are added to the template, for example, adding an `id` field:
Expand All @@ -109,7 +110,8 @@ CREATE TABLE IF NOT EXISTS `${database}`.`${table}` (
ORDER BY (${rowtype_primary_key})
PRIMARY KEY (${rowtype_primary_key})
SETTINGS
index_granularity = 8192;
index_granularity = 8192
COMMENT '${comment}';
```

The connector will automatically retrieve the corresponding types from the upstream source and fill in the template, removing the `id` field from the `rowtype_fields`. This method can be used to modify custom field types and attributes.
Expand All @@ -121,6 +123,7 @@ The following placeholders can be used:
- `rowtype_fields`: Retrieves all fields from the upstream schema and automatically maps them to Clickhouse field descriptions.
- `rowtype_primary_key`: Retrieves the primary key from the upstream schema (this may be a list).
- `rowtype_unique_key`: Retrieves the unique key from the upstream schema (this may be a list).
- `comment`: Retrieves the table comment from the upstream schema.

## How to Create a Clickhouse Data Synchronization Jobs

Expand Down
Loading

0 comments on commit d0b3c77

Please sign in to comment.