Add multi-table rule match mode
Added rule_match_mode to Apache SeaTunnel Transform-V2 so multi-table transforms can choose FIRST_MATCH or ALL_MATCH when repeated exact table_path rules target the same upstream table.
apache/seatunnel · #11099
Problem
SeaTunnel supported outer table_match_regex rules and table-specific table_transform rules, but did not expose an explicit contract for how multiple table-specific rules should be evaluated for the same table. Complex CDC and multi-table jobs had to infer behavior from implementation details.
Approach
Implemented a RuleMatchMode option, preserved the legacy duplicate table_path fail-fast behavior when the option is absent, added FIRST_MATCH and ALL_MATCH resolution, composed chained map and flatMap transforms, kept table_match_regex as a fallback, wired the option through Transform-V2 factories, and updated English and Chinese docs.
Impact and scope
- Adds a user-facing feature for deterministic multi-table transform rule evaluation in SeaTunnel Transform-V2.
- Enables ALL_MATCH chaining where each matching rule consumes the schema and row produced by the previous rule.
- Preserves backward compatibility and the existing table_transform over table_match_regex precedence contract.
Validation
- Added common resolver coverage for legacy duplicate-rule rejection, FIRST_MATCH, ALL_MATCH, declaration order, fallback, identity behavior, and schema-change null short-circuiting.
- Added a real Copy transform regression where the second exact table rule reads a field created by the first rule.
- PR validation included focused Transform-V2 tests and a seatunnel-transforms-v2 package build with skipped integration tests.