nankeChen75 opened a new pull request, #12638: URL: https://github.com/apache/seatunnel/pull/12638
### Purpose of this pull request Refs #9583. This PR backports the empty-`sinkActions` guard from commit `2739847410` to `2.3.13-release`, without including the unrelated table-level fault-isolation changes. When `TableFilter` excludes every input table for a sink, `sinkActions` becomes empty. Previously, `tryGenerateMultiTableSink()` still accessed `sinkActions.get(0)`, causing an `IndexOutOfBoundsException`. The method now returns `Optional.empty()` when there are no candidate sink actions. Please confirm whether `2.3.13-release` is the intended backport target. ### Does this PR introduce _any_ user-facing change? Yes. This fixes an exception during Zeta job configuration parsing. Previously, excluding all input tables for a sink could cause an `IndexOutOfBoundsException` in `tryGenerateMultiTableSink()`. After this change, the parser generates no sink action for that empty input instead of accessing the empty list. A job with an empty sink branch alongside a valid branch can complete successfully. This does not guarantee successful execution of a job with no remaining sinks. No configuration options, defaults, public APIs, or dependencies are changed. This PR addresses the reproduced empty-`sinkActions` path; it does not claim to resolve every possible table-map issue described in the original report. ### How was this patch tested? Added regression coverage: - `MultipleTableJobConfigParserTest#testAllTablesFilteredOutProducesNoSinkActions`: parses a FakeSource → TableFilter → Console configuration in which all tables are excluded, and asserts that the sink action list is empty. - `TestTableFilterIT#testFilterWithEmptySinkBranch`: runs a Zeta job with an all-filtered branch feeding Console and a second branch retaining teacher and course. Assert verifies exactly 3 teacher rows and 2 course rows. Both new tests were verified against the broken and fixed implementations: 1. Remove the guard: both tests fail with `IndexOutOfBoundsException` in `tryGenerateMultiTableSink()`. 2. Restore the guard: both tests pass. 3. For the integration test, rebuild the starter JAR before each run to ensure the container executes the corresponding implementation. The integration job finishes with `FINISHED`, reading 6 rows and writing 5 rows. Manual reproduction was also performed on the official 2.3.11 binary: - All tables excluded: the job fails with the reported exception. - One table excluded and two retained: `MultiTableSinkWriter` is initialized, the retained tables produce the expected rows, and the job finishes successfully. Formatting and build verification completed successfully: - `./mvnw spotless:apply` - `./mvnw -q -DskipTests verify` For the local Docker environment, the IDEA IT run configuration used `-Dapi.version=1.44`. This is a local compatibility setting and is not part of the patch. ### Check list - [x] No new JAR binaries or dependencies are introduced; additional license notices are not applicable. - [x] No new configuration or feature documentation is required. - [x] No incompatible changes are introduced. - [x] Connector registration changes are not applicable. - [x] Unit and integration regression tests are included. -- 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]
