[Fix][Connector-V2] Respect Paimon alter table ignore flag - #11009
Conversation
Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
DanielLeens
left a comment
There was a problem hiding this comment.
Thanks for the contribution. I reviewed the full current diff on the latest head (d5337cca70) and this looks like a focused fix that correctly restores the intended ignoreIfNotExists semantics in the Paimon catalog wrapper.
What this PR solves
- User pain: callers can pass
ignoreIfNotExists = falseintoPaimonCatalog.alterTable(...), but the current wrapper always forwardstrueto the underlying Paimon catalog, so a missing table can be silently ignored instead of failing fast. - Fix approach: pass the flag through as-is in both
alterTableoverloads, and translate the underlying PaimonTableNotExistExceptioninto SeaTunnel's ownTableNotExistException. - One-line summary: this PR makes the alter-table wrapper behave consistently with its own method contract.
Simple example
If schema evolution tries to add a column to a Paimon table that has already been deleted, ignoreIfNotExists = false should surface an error immediately. Before this patch it could still be ignored; after this patch it fails fast as expected, while the ignoreIfNotExists = true path still keeps the best-effort behavior.
Actual runtime path I re-checked
schema change event
-> AlterPaimonTableSchemaEventHandler.apply() [80-92]
-> applySingleSchemaChangeEvent(...) [94-134]
-> add/modify/change paths call paimonCatalog.alterTable(..., false)
-> drop-column path calls paimonCatalog.alterTable(..., true)
catalog wrapper
-> PaimonCatalog.alterTable(...) [358-387]
-> old behavior: always delegated with `true`
-> new behavior: delegates with the caller's actual ignore flag
-> missing table:
- ignore=false => throw TableNotExistException
- ignore=true => keep ignore semantics
Findings
- The bug is real and it is on the normal schema-evolution path, not an unreachable edge branch.
- The fix is complete for both overloads (
SchemaChangeandList<SchemaChange>). - The new regression test covers both forms and directly checks the intended semantic split between
falseandtrue. - I did not find a blocking correctness issue in the current implementation.
Test stability
The new test in PaimonCatalogTest looks stable to me:
- no sleeps
- no timing-based assertions
- no fixed-port or external-service dependency
- direct
assertThrows/assertDoesNotThrowcoverage for the exact bug
Stability rating for the new test change: stable.
CI readout
I checked the failing Build job as well.
Dead linksfails on two external Airtable links indocs/zh/connectors/source/Airtable.mdreturning406.unit-test (8, ubuntu-latest)fails inseatunnel-engine-client, specificallySeaTunnelEngineClusterRoleTest.testWorkerIsFirstMemberThenGetJobDetailStatus, which times out waiting forCANCELEDand still seesCANCELING.
I do not see evidence that either failure is caused by this PR:
- the PR diff only touches the two Paimon files
- the failing unit test is in
seatunnel-engine-client, outside this diff - there is no newer
upstream/devfix on that failing test path after this PR's merge-base
So from my side this looks like unrelated CI noise / flakiness rather than a blocker caused by the current Paimon change.
Conclusion
Conclusion: can merge
- Blocking items
- None from my side on the current code.
- Suggested follow-up
- Please rerun or recheck the current CI failures, but I would treat them as unrelated to this PR's source change unless new evidence shows otherwise.
Overall, this is a clean and appropriately scoped fix. The wrapper behavior now matches the caller contract, and the regression test covers the exact scenario that was previously wrong.
Purpose of this pull request
The Paimon catalog wrapper ignored the
ignoreIfNotExistsargument in bothalterTableoverloads and always passedtrueto the underlying Paimon catalog. As a result, alter table operations that should fail when the target table does not exist were silently ignored.This PR passes
ignoreIfNotExiststhrough correctly and maps Paimon table-not-found errors to SeaTunnelTableNotExistException.Does this PR introduce any user-facing change?
Yes. Paimon alter table operations with
ignoreIfNotExists = falsenow fail when the target table does not exist, instead of being silently ignored.How was this patch tested?
Added unit coverage for both single
SchemaChangeand list-basedalterTableoverloads.Ran:
./mvnw -pl seatunnel-connectors-v2/connector-paimon -Dtest=PaimonCatalogTest test./mvnw -pl seatunnel-connectors-v2/connector-paimon test./mvnw -pl seatunnel-connectors-v2/connector-paimon spotless:checkCheck list
New License Guide
incompatible-changes.mdto describe the incompatibility caused by this PR.