nzw921rx opened a new pull request, #11062:
URL: https://github.com/apache/seatunnel/pull/11062
## Purpose of this pull request
Closes #11061
Add a new SQL transform plugin powered by Apache Calcite, providing standard
SQL capabilities (SELECT, WHERE, CASE WHEN, built-in functions, JSON
extraction, etc.) for data transformation. Key components:
- **Calcite Engine**: `CalciteSQLEngine` compiles SQL once at startup and
executes per-row at runtime, with bidirectional SeaTunnel-Calcite type mapping.
- **Shaded Dependency**: `seatunnel-calcite` module shading Calcite 1.38.0
under `org.apache.seatunnel.shade.*`.
- **UDF System**: `CalciteUdf` SPI for custom UDFs + `ZetaUdfBridge` for
reusing existing ZetaUDF jars. Built-in UDFs: MASK, MASK_HASH, DES_ENCRYPT,
DES_DECRYPT, URL_ENCODE, URL_DECODE.
- **Multi-table CDC**: Per-table SQL overrides, regex table matching,
automatic plan rebuild on schema changes.
## Does this PR introduce any user-facing change?
Yes. Adds a new `Calcite` transform plugin. Example usage:
```hocon
transform {
Calcite {
plugin_input = "source_table"
plugin_output = "result"
sql = "SELECT id, UPPER(name) AS name, MASK(phone, 3, 7, '*') AS phone
FROM source_table WHERE age >= 18"
}
}
```
Full documentation added in `docs/en/transforms/calcite.md` and
`docs/zh/transforms/calcite.md`.
## How was this patch tested?
```bash
#UT
./mvnw test -pl seatunnel-transforms-v2
#IT
./mvnw -DskipUT -DskipIT=false verify -pl
seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-e2e-part-2
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]