You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "det101 (via GitHub)" <gi...@apache.org> on 2026/07/01 06:08:06 UTC

[PR] [Feature][Connector-V2] Support table_options for StarRocks SaveMode auto-create [seatunnel]

det101 opened a new pull request, #11242:
URL: https://github.com/apache/seatunnel/pull/11242

   ### Purpose of this pull request
   
   Follow-up to #11101 (PR1) for #11047: extend the shared sink `table_options` contract to **StarRocks SaveMode auto-create**.
   
   This PR lets users pass StarRocks table properties (for example `replication_num`, `storage_format`) via `table_options` when `schema_save_mode` triggers DDL. Options are merged into the generated `CREATE TABLE ... PROPERTIES (...)` clause.
   
   **Scope (StarRocks only; builds on merged PR1):**
   
   - Reuse `SinkConnectorCommonOptions.TABLE_OPTIONS` (already on `dev` from #11101)
   - Early validation via `Conditions.extension` in `StarRocksSinkFactory.optionRule()` (same pattern as JDBC PR1)
   - Merge properties with `SqlTableClauseMerger` in `connector-common`
   - Pass `table_options` through `StarRocksCatalog` constructor (not `CatalogTable.options`) to avoid upstream metadata pollution in CDC / multi-table jobs
   - Reject non-empty `table_options` when `save_mode_create_template` differs from the built-in default (custom templates must embed properties in the template itself)
   
   **Out of scope:** JDBC changes (already in #11101), new `seatunnel-api` types, E2E in this PR.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes.
   
   - New optional StarRocks sink config: `table_options` (map), using the common option introduced in #11101.
   - Applied only when SaveMode auto-creates tables (`CREATE_SCHEMA_WHEN_NOT_EXIST`, `RECREATE_SCHEMA`, etc.).
   - Does **not** affect Stream Load at runtime and does **not** run `ALTER TABLE` on existing tables.
   - **Not compatible** with a **custom** `save_mode_create_template` (validation fails at `--check` / job submission); use template `PROPERTIES` instead.
   - With the **default** template, duplicate keys in `PROPERTIES` are overridden by `table_options`.
   - No StarRocks property allowlist; invalid keys fail when StarRocks executes `CREATE TABLE`.
   - Documentation updated: `docs/en/connectors/sink/StarRocks.md`, `docs/zh/connectors/sink/StarRocks.md`.
   
   ### How was this patch tested?
   
   **Unit tests added/updated:**
   
   - `SqlTableClauseMergerTest` — merge / override / append `PROPERTIES`
   - `StarRocksSaveModeUtilTableOptionsTest` — validation + SQL merge
   - `StarRocksTableOptionsConditionExtensionTest` — `optionRule` / `--check` path
   - `StarRocksCreateTableTest` — end-to-end SQL generation with `table_options`
   - `PreviewActionTest` — preview SQL uses sink `table_options` only (not upstream `CatalogTable.options`)
   
   **Commands run locally:**
   
   ```bash
   ./mvnw spotless:apply -pl seatunnel-connectors-v2/connector-common,seatunnel-connectors-v2/connector-starrocks
   ./mvnw test -pl seatunnel-connectors-v2/connector-common,seatunnel-connectors-v2/connector-starrocks \
     -Dtest=SqlTableClauseMergerTest,StarRocksSaveModeUtilTableOptionsTest,\
   StarRocksTableOptionsConditionExtensionTest,StarRocksCreateTableTest,PreviewActionTest
   ```
   
   ### Check list
   
   ### Check list
   
   - [ ] If any new Jar binary package adding in your PR, please add License Notice according to
     [New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/developer/new-license.md)
   - [x] If necessary, please update the documentation to describe the new feature.
     https://github.com/apache/seatunnel/tree/dev/docs
   - [ ] If necessary, please update `incompatible-changes.md` to describe the incompatibility caused by this PR.
   - [ ] If you are contributing the connector code, please check that the following files are updated:
     1. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
     2. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
     3. Add ci label in [label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
     4. Add e2e testcase in [seatunnel-e2e
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] PR2:Support table_options for StarRocks SaveMode auto-create [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo merged PR #11242:
URL: https://github.com/apache/seatunnel/pull/11242


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] PR2:Support table_options for StarRocks SaveMode auto-create [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11242:
URL: https://github.com/apache/seatunnel/pull/11242#issuecomment-4902495592

   Thanks for syncing the branch. I rechecked the current head and the CI/merge-gate state because my earlier CI note was tied to an older snapshot.
   
   The previous note referred to head `0046935903b1d6c61b2a28b16a7e534ffbca0f76`, `compare status: diverged`, `behind_by=30`, and a `Build [failure]` signal. That is no longer the current state.
   
   Current snapshot:
   - head SHA: `1b136160c40ea5e43da2264d10dc8c4e763c17e0`
   - base branch: `dev`
   - compare status: `ahead`
   - ahead_by: `15`
   - behind_by: `0`
   - current visible gate: `Build` is queued
   
   From Daniel's source-review side, I still do not see a reopened code-side blocker on the StarRocks SaveMode `table_options` path I previously approved. The next useful step is to let the queued `Build` finish. If it fails again on this updated head, please share the new failing check link here and I can help narrow it down from the current run instead of the stale one.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] PR2:Support table_options for StarRocks SaveMode auto-create [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11242:
URL: https://github.com/apache/seatunnel/pull/11242#issuecomment-4880722587

   @-


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org