[Improve][Connector-V2][Jdbc] Support Oracle append values insert mode - #10996
Merged
Conversation
DanielLeens
reviewed
Jun 2, 2026
DanielLeens
left a comment
Contributor
There was a problem hiding this comment.
Thanks for working on this. I reviewed the latest head from scratch and traced the generated insert SQL path, the validation guards, and the insert-only runtime boundary.
What this PR solves
- User pain: Oracle users may want to use
INSERT /*+ APPEND_VALUES */for append-only bulk writes, but SeaTunnel currently only emits the conventional insert form. - Fix approach: add an explicit
oracle_insert_modeoption, inject theAPPEND_VALUEShint only on the generated insert SQL path, and fail fast for unsupported combinations. - One-line summary: the latest head keeps the feature boundary tight, and I did not find a new blocker on the Oracle append-values path.
Runtime path I checked
sink construction
-> JdbcOutputFormatBuilder.build() [60-109]
-> validateOracleInsertMode(...)
-> choose generated insert-only path only when the config is compatible
generated insert SQL path
-> createSimpleBufferedExecutor(...) [112-124]
-> dialect.getInsertIntoStatement(...)
-> applyOracleAppendValuesHintIfNeeded(...) [358-...]
guard rails
-> reject non-Oracle dialect
-> reject custom query
-> reject exactly-once
-> reject auto_commit=false
-> reject primary-key / upsert-style modes
Review result
JdbcOutputFormatBuilder.java:63-90validates the mode before any executor selection, which is the right place to keep the feature boundary explicit.- The hint injection is limited to the generated insert SQL path, so it does not silently mutate custom SQL.
- The tests in
JdbcOutputFormatBuilderTest.java:137-248cover the important allowed/forbidden combinations. - I did not find a new source-level blocker on the latest head.
Tests / CI
- The new unit coverage is targeted and stable.
- I did not see a flaky-test pattern in the added tests.
- The current GitHub
Buildis still in progress, but I do not have a source-level blocker to add on top of the latest code.
Conclusion: can merge
- Blocking items
- None from my side on the latest head.
- Suggested non-blocking follow-up
- None from my side on this code path.
From the code-review side this looks good.
DanielLeens
approved these changes
Jun 3, 2026
DanielLeens
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the update. I re-reviewed the latest head from scratch, including the new head commit, and traced the Oracle insert-only sink path again.
What this PR solves
- User pain: Oracle users may want
INSERT /*+ APPEND_VALUES */for append-only bulk writes, but SeaTunnel currently emits only the conventional insert form. - Fix approach: add
oracle_insert_mode, keep the hint injection on the generated insert-only SQL path, and fail fast for unsupported combinations. - One-line summary: the latest head keeps the feature boundary tight, and the follow-up
JdbcHiveITfix does not reopen the Oracle sink path.
Runtime chain I checked
sink construction
-> JdbcSinkFactory.createSink(...)
-> JdbcOutputFormatBuilder.build()
-> validateOracleInsertMode(...)
-> createSimpleBufferedExecutor(...)
-> dialect.getInsertIntoStatement(...)
-> applyOracleAppendValuesHintIfNeeded(...)
Re-review result
- The Oracle logic is still correctly guarded in
JdbcOutputFormatBuilder.java:63-168,355-413. - The latest head commit only updates
JdbcHiveITfor the catalog-utils signature and does not change the Oracle runtime path. - The UT / E2E additions remain aligned with the intended insert-only boundary.
Tests / stability
- The added UTs are stable: no fixed sleeps, no hard-coded shared ports, and the assertions target deterministic guard-rail behavior.
- The Oracle IT still covers the generated insert path.
- I do not have a new source-level blocker on the latest head.
Conclusion: can merge
- Blocking items
- None from my side on the latest head.
- Suggested non-blocking follow-up
- None.
From the code-review side this looks good to merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of this pull request
Add an opt-in Oracle JDBC sink insert optimization option:
When enabled for supported Oracle insert-only generated SQL writes, SeaTunnel injects the Oracle
APPEND_VALUEShint into the generated insert statement:INSERT /*+ APPEND_VALUES */ INTO ...The default mode is
CONVENTIONAL, so existing jobs keep the current JDBC insert behavior unless users explicitly enable this option.Does this PR introduce any user-facing change?
Yes.
This PR adds a new optional JDBC sink config
oracle_insert_mode, with default valueCONVENTIONAL. Existing jobs are not affected by default.APPEND_VALUESis restricted to Oracle insert-only generated SQL writes and requires:generate_sink_sql = trueauto_commit = truequeryprimary_keysis_exactly_once = falsesupport_upsert_by_insert_only = falseHow was this patch tested?
./mvnw -pl seatunnel-connectors-v2/connector-jdbc \ -Dtest=JdbcOutputFormatBuilderTest \ -DfailIfNoTests=false \ -Dmaven.gitcommitid.skip=true testResult:
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0.Result:
BUILD SUCCESS.Result:
BUILD SUCCESS.Attempted Oracle E2E locally:
./mvnw -pl seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1 \ -Dtest=JdbcOracleIT \ -DfailIfNoTests=false \ -Dmaven.gitcommitid.skip=true testIt reached
JdbcOracleITstartup but failed before running the test cases because the local machine has no valid Docker/Testcontainers environment:Check list