DanielLeens commented on PR #12005:
URL: https://github.com/apache/seatunnel/pull/12005#issuecomment-6538180317

   Synced the branch with `dev` and addressed the one blocking item from the 
last review (Issue 1, nullable split column). New head: 
`b1c450488eac35b4ec339929e6fae12bd0d296c7`.
   
   **Merge with `dev`** (`3ac2d1cec6aa7b3741c4dacdd23020f778e23c02`), commit 
`61e89d50c28`:
   - Only one file conflicted: 
`seatunnel-connectors-v2/connector-jdbc/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/FixedChunkSplitterTest.java`,
 an import-block conflict (`dev` added 
`java.util.ArrayList/Arrays/Collection/Collections` for its new tests). 
Resolved by keeping `dev`'s imports; both `dev`'s new test methods and this 
PR's test methods are retained.
   - Every other file merged automatically. `git diff --name-status origin/dev 
HEAD` after the merge lists exactly the 11 files this PR already touched (no 
deletions, no `pom.xml`).
   
   **Issue 1 - nullable Oracle split column** (commit `b1c450488ea`):
   - `OracleDialect.java`: the per-column `ALL_TAB_COLUMNS` lookup that already 
validated the data-bound collation now also reads `NULLABLE` (`SELECT 
COLLATION, NULLABLE ...`, line 471) and fails closed unless the column is 
declared `NOT NULL` (lines 488-496, constant `NOT_NULL_FLAG` at line 82). The 
method was renamed to `validateStringRangeSplitColumnMetadata` (line 467) since 
it no longer checks collation only. Because this is an `unsafe` decision 
returned from `validateStringRangeSplit`, the existing 
`ChunkSplitter.resolveStringSplitStrategy` path rejects explicit 
`split.string-strategy = range` with the reason and falls back for `auto`, 
mirroring the collation/encoding checks. No new query is issued; the extra 
column rides on the existing statement.
   - Docs: `docs/en/connectors/source/Jdbc.md` line 201 and 
`docs/zh/connectors/source/Jdbc.md` line 196 (the `split.string-strategy` row) 
now state that the Oracle split column must be declared `NOT NULL`, why (range 
predicates never match a NULL key, so such rows would be silently skipped), and 
that a nullable column is rejected by `range` and falls back under `auto`.
   - Regression test: 
`OracleDialectStringRangeSplitTest#testRejectsNullableSplitColumn` (line 200) 
stubs binary NLS, ASCII-compatible encoding, `BINARY` collation and 
fixed-length samples that would pass every other gate, with `NULLABLE = 'Y'`; 
it asserts the decision is unsafe with the nullable reason and that sampling is 
never executed. Without the new check this input yields a `safe` decision, so 
the test fails on the previous code. The shared stub for the safe path now 
returns `NULLABLE = 'N'` (line 256).
   - Out of scope here, as agreed in the review: the cross-dialect `IS NULL` 
branch in the shared `FixedChunkSplitter` predicate builders remains a separate 
PR.
   
   Compile and tests are left to CI per the validation policy; locally only 
`spotless:apply` / `spotless:check` for `connector-jdbc` were run (check 
passes). Fork CI run for the new head: 
https://github.com/DanielLeens/seatunnel/actions/runs/41162746769
   


-- 
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]

Reply via email to