Skip to content

[Fix][Transform-V2] Make SQL case conversion locale independent - #11950

Closed
tagadearpit wants to merge 6 commits into
apache:devfrom
tagadearpit:fix/sql-string-case-locale
Closed

tagadearpit wants to merge 6 commits into
apache:devfrom
tagadearpit:fix/sql-string-case-locale

Conversation

@tagadearpit

Copy link
Copy Markdown
Contributor

Fixes #11949

Purpose of this pull request

This change makes the SQL transform lower() and upper() functions deterministic across worker machines by using Locale.ROOT instead of the JVM default locale. Under a Turkish default locale, the previous implementation converted I to ı and i to İ, which could make identical jobs produce different results on different workers.

The implementation is limited to StringFunction.lower() and StringFunction.upper() and preserves existing null behavior.

Does this PR introduce any user-facing change?

Yes. SQL case conversion is now locale-independent. For example, with the JVM default locale set to tr-TR:

Before: lower("I") = "ı", upper("i") = "İ"
After:  lower("I") = "i", upper("i") = "I"

This is a correctness fix for deterministic SQL transformations and does not require configuration changes or a migration.

How was this patch tested?

A regression test was added to StringFunctionTest that temporarily sets the default locale to Turkish, verifies the expected lower() and upper() results, and restores the original locale in a finally block.

Verification completed locally:

  • StringFunctionTest: 34 tests passed, 0 failures, 0 errors.
  • SeaTunnel transforms module verification lifecycle: passed.
  • SeaTunnel Spotless formatting/check: passed.
  • Direct pre-fix harness reproduced lower=ı upper=İ.
  • Direct post-fix harness passed with lower=i upper=I.
  • git diff --check: passed.

The repository-wide ./mvnw -q -DskipTests verify and ./mvnw test commands were also attempted. They are blocked by existing repository/environment issues in the config-shade module and frontend build; the changed transforms module and its complete StringFunctionTest pass independently.

@tagadearpit

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing this fix.

The issue is reproducible under tr-TR: the previous implementation returns lower("I") = "ı" and upper("i") = "İ" because it uses the JVM default locale. This patch switches both functions to Locale.ROOT, preserving null behavior and making SQL transformations deterministic across workers.

A regression test temporarily sets the Turkish locale, verifies lower("I") = "i" and upper("i") = "I", and restores the original locale in a finally block.

Validation completed:

  • StringFunctionTest: 34 passed.
    • Transforms module verification: passed.
    • Spotless formatting/check: passed.
    • Pre-fix harness reproduced lower=ı upper=İ.
    • Post-fix harness passed with lower=i upper=I.
      The full repository commands were attempted as well; their failures are unrelated to this change and occur in the config-shade/frontend environment.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Problem Does This PR Solve?

Under a JVM whose default locale is Turkish/Azerbaijani (tr-TR, az), String.toLowerCase()/toUpperCase() apply Turkish-specific casing rules where I lowercases to the dotless ı and i uppercases to the dotted İ. Because the SQL lower()/upper() transform functions relied on the JVM default locale, the exact same SeaTunnel job could silently produce different string values depending on which worker's locale it happened to run on. This PR fixes it by switching both functions to Locale.ROOT, which is the standard, well-known remedy for this class of "Turkish-I problem."

1. Code Change Review

1.1 Core Logic Analysis

The change is a two-line fix in StringFunction:

// Before
return arg.toLowerCase();
...
return arg.toUpperCase();

// After
return arg.toLowerCase(Locale.ROOT);
...
return arg.toUpperCase(Locale.ROOT);

Key Findings:

  • The fix is minimal and precisely targeted at the two functions named in the linked issue (#11949); no unrelated code was touched.
  • Locale.ROOT is the correct choice here (as opposed to Locale.ENGLISH, which still has a few locale-specific quirks) — it gives fully locale-independent, ASCII-safe case conversion.
  • Null handling is preserved exactly as before (arg == null short-circuits to null before the case conversion).
  • I checked the rest of seatunnel-transforms-v2 for the same latent hazard: there are quite a few other toUpperCase()/toLowerCase() calls without a Locale argument (e.g. ZetaSQLFunction#459/687, DateTimeFunction#70/185/264/384, CastFunction#93, NumericFunction#236/293, SQLTransform#83). These are internal keyword/function-name/engine-type dispatch (switch (x.toUpperCase())), not user-visible string transformation, so they're out of scope for this fix, but the same theoretical Turkish-locale risk exists there too (see Issue 1 below).
  • This is a pure library-call fix; there is no interaction with checkpoint state, serialization, or any async/cross-thread path — StringFunction.lower/upper are stateless, per-row scalar SQL functions invoked synchronously during row transformation.

Runtime path (for completeness, since it's a transform function):

SQLTransform -> ZetaSQLEngine row evaluation -> ZetaSQLFunction dispatch("LOWER"/"UPPER")
  -> StringFunction.lower(args) / upper(args) -> Locale.ROOT case conversion -> returned into the row

No cross-node, cross-thread, or persisted-state boundary is crossed, so there's no checkpoint/recovery compatibility angle to worry about here.

1.2 Compatibility Impact

Fully compatible for the overwhelming majority of deployments (any JVM default locale other than Turkish/Azerbaijani sees byte-for-byte identical output before and after this change, since Locale.ROOT and most locales agree on ASCII case mapping). The only deployments that will see a behavior change are those running with a tr-TR/az JVM default locale, and for those the change corrects what is objectively a bug (non-deterministic, locale-dependent results for a supposedly pure function), not a supported feature — there is no reasonable scenario where a user was intentionally depending on lower("I") == "ı".

1.3 Performance / Side-Effect Analysis

Negligible — passing an explicit Locale.ROOT argument to toLowerCase/toUpperCase has effectively the same cost as the locale-lookup the JVM already performs internally for the no-arg overload. No new allocations, no new fields, no new branches.

1.4 Error Handling and Logging

No behavior change here; error handling (null passthrough) is unchanged. No new logging was needed or added.

Issue 1 (Low, non-blocking): The same "default locale" hazard still exists in unrelated case-insensitive dispatch code elsewhere in this module (see 1.1). It's out of scope for this focused fix, but worth a follow-up ticket since it's the same bug class. Raised by another reviewer: No.

Issue 2 (Low, non-blocking): A short inline comment at the Locale.ROOT call sites (e.g. // Locale.ROOT avoids Turkish-locale dotted/dotless-I casing surprises) would help future maintainers avoid "simplifying" this back to the no-arg overload. Raised by another reviewer: No.

2. Code Quality Assessment

2.1 Coding Standards

Clean, idiomatic, follows the existing file's style. The two changed lines and the new import java.util.Locale; are the only production-code touch points — no unrelated formatting changes.

2.2 Test Coverage and Test Stability

A new regression test, testLowerAndUpperAreIndependentOfDefaultLocale, directly exercises the bug: it flips Locale.getDefault() to tr-TR, asserts the corrected lower("I") == "i" / upper("i") == "I", and restores the original default locale in a finally block, so the mutation can't leak into later tests even if an assertion fails mid-test. I checked the module for JUnit5 parallel-execution configuration (junit-platform.properties) and found none, so tests in this class run sequentially in a single thread — mutating the JVM-global default locale for the duration of one test method is safe here and does not introduce cross-test interference.

Stability rating: Stable. No Thread.sleep, no timing assumptions, no shared mutable state beyond the properly try/finally-guarded locale flip, deterministic assertions.

Coverage is appropriate and hits exactly the previously-broken path; I don't see a need for additional cases (e.g. az locale) since tr-TR alone is sufficient to prove Locale.ROOT is now used instead of the default.

2.3 Documentation Updates

Not required — this is a correctness/determinism fix with no config, default value, or public contract change; nothing in docs/en or docs/zh describes locale-dependent casing behavior that would need updating.

3. Architectural Soundness

3.1 Elegance of the Solution

Precise fix — this is exactly the right, minimal, well-known remedy for the problem, with no scope creep.

3.2 Maintainability

Improves it slightly (removes a latent footgun); the two extra lines are self-explanatory once you know the "Locale.ROOT" idiom, though see Issue 2 for a suggested comment.

3.3 Extensibility

N/A — no new extension points introduced.

3.4 Historical-Version Compatibility

No serialization, checkpoint, or config compatibility surface is touched. Fully backward compatible with all previously-saved jobs/state.

4. Issue Summary

Number Issue Location Severity
1 Same default-locale hazard remains in unrelated toUpperCase()/toLowerCase() dispatch code elsewhere in the module ZetaSQLFunction.java, DateTimeFunction.java, CastFunction.java, NumericFunction.java, SQLTransform.java Low
2 No inline comment explaining why Locale.ROOT is required at the two call sites StringFunction.java:264,272 Low

5. Merge Recommendation

Conclusion: Ready to merge

I don't see any blocking issues with the code itself — the fix is correct, minimal, well-tested, and backward compatible.

  1. Blockers — must be fixed
    • None.
  2. Recommended fixes — non-blocking
    • Issue 1: consider a follow-up ticket to audit/fix the other default-locale toUpperCase()/toLowerCase() call sites in this module.
    • Issue 2: a one-line comment at the two Locale.ROOT call sites for future maintainers.

One process note: I checked the current "Build" check, and it's currently red — but drilling into the actual fork CI run, the failures are entirely confined to unrelated integration-test jobs (paimon-connector-it, doris-connector-it, oracle-cdc-connector-it, rocketmq-connector-it), while the transform-v2-it and unit-test jobs that actually exercise this module's code all passed. This branch is also currently 9 commits behind dev. Given the failures look environmental/unrelated to this diff, syncing with the latest dev and re-running CI is worth trying before merge, but this isn't a code-quality blocker from my side.

Overall: nice, focused bug fix — thanks for tracking down and fixing a genuinely tricky class of bug (locale-dependent non-determinism) with a clean, well-tested change.

@tagadearpit
tagadearpit force-pushed the fix/sql-string-case-locale branch from 9882094 to 259af7d Compare August 24, 2026 18:21

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Problem Does This PR Solve?

Under a JVM whose default locale is Turkish/Azerbaijani (tr-TR, az), String.toLowerCase()/toUpperCase() apply Turkish-specific casing rules where I lowercases to the dotless ı and i uppercases to the dotted İ. Because the SQL lower()/upper() transform functions relied on the JVM default locale, the exact same SeaTunnel job could silently produce different string values depending on which worker's locale it happened to run on. This PR fixes it by switching both functions to Locale.ROOT, the standard remedy for this class of "Turkish-I problem."

1. Code Change Review

1.1 Core Logic Analysis

I re-diffed the current head (259af7d54c2) against the commit I reviewed previously (9882094a9f9, 2026-08-23) file-by-file (StringFunction.java, StringFunctionTest.java) and confirmed they are byte-identical — the branch was simply rebased onto a newer dev (now 1 commit behind / 1 ahead), no production or test code changed. So this is a fresh re-review of unchanged content:

// Before
return arg.toLowerCase();
...
return arg.toUpperCase();

// After
return arg.toLowerCase(Locale.ROOT);
...
return arg.toUpperCase(Locale.ROOT);

Key Findings (unchanged from last round):

  • The fix is minimal and precisely targeted at the two functions named in the linked issue (#11949); no unrelated code touched.
  • Locale.ROOT is the correct choice (vs. Locale.ENGLISH, which still carries a few locale-specific quirks) — fully locale-independent, ASCII-safe case conversion.
  • Null handling is preserved exactly as before (arg == null short-circuits to null).
  • The same latent hazard (no-arg toUpperCase()/toLowerCase()) still exists elsewhere in seatunnel-transforms-v2 (ZetaSQLFunction, DateTimeFunction, CastFunction, NumericFunction, SQLTransform), but those are internal keyword/type dispatch (switch (x.toUpperCase())), not user-visible string transformation — out of scope here, tracked as Issue 1 below.
  • Pure library-call fix, stateless and synchronous per-row — no interaction with checkpoint state, serialization, or any cross-thread/cross-node boundary.

Runtime path:

SQLTransform -> ZetaSQLEngine row evaluation -> ZetaSQLFunction dispatch("LOWER"/"UPPER")
  -> StringFunction.lower(args) / upper(args) -> Locale.ROOT case conversion -> returned into the row

1.2 Compatibility Impact

Fully compatible. Any JVM default locale other than Turkish/Azerbaijani produces byte-for-byte identical output before and after, since Locale.ROOT agrees with virtually all locales on ASCII case mapping. The only deployments affected are those running with a tr-TR/az JVM default locale, and for those this corrects an objective bug (non-deterministic output for a supposedly pure function) rather than changing a supported, intentionally-relied-upon behavior.

1.3 Performance / Side-Effect Analysis

Negligible — passing an explicit Locale.ROOT has the same cost as the locale lookup the no-arg overload already performs internally. No new allocations, fields, or branches.

1.4 Error Handling and Logging

No behavior change; null passthrough is unchanged, no new logging needed.

Issue 1 (Low, non-blocking, carried over): The same default-locale hazard remains in unrelated case-insensitive dispatch code elsewhere in this module. Out of scope for this focused fix but worth a follow-up ticket.

Issue 2 (Low, non-blocking, carried over): A short inline comment at the two Locale.ROOT call sites would help future maintainers avoid "simplifying" this back to the no-arg overload.

2. Code Quality Assessment

2.1 Coding Standards

Clean, idiomatic, matches the file's existing style. The two changed lines plus the new import java.util.Locale; are the only production-code touch points.

2.2 Test Coverage and Test Stability

testLowerAndUpperAreIndependentOfDefaultLocale flips Locale.getDefault() to tr-TR, asserts lower("I") == "i" / upper("i") == "I", and restores the original default in a finally block, so the mutation can't leak into later tests even on assertion failure. No JUnit5 parallel-execution config exists for this module, so the global-default-locale mutation is safe for the duration of this single sequential test.

Stability rating: Stable. No sleeps, no timing assumptions, no shared mutable state beyond the properly try/finally-guarded locale flip, deterministic assertions.

2.3 Documentation Updates

Not required — pure correctness/determinism fix, no config, default, or public contract change.

3. Architectural Soundness

3.1 Elegance of the Solution

Precise, minimal, well-known remedy — no scope creep.

3.2 Maintainability

Slightly improves it (removes a latent footgun); see Issue 2 for a documentation nit.

3.3 Extensibility

N/A.

3.4 Historical-Version Compatibility

No serialization, checkpoint, or config compatibility surface touched. Fully backward compatible with all previously-saved jobs/state.

4. Issue Summary

Number Issue Location Severity
1 Same default-locale hazard remains in unrelated toUpperCase()/toLowerCase() dispatch code elsewhere in the module ZetaSQLFunction.java, DateTimeFunction.java, CastFunction.java, NumericFunction.java, SQLTransform.java Low
2 No inline comment explaining why Locale.ROOT is required at the two call sites StringFunction.java:264,272 Low

5. Merge Recommendation

Conclusion: Ready to merge

  1. Blockers — must be fixed
    • None.
  2. Recommended fixes — non-blocking
    • Issue 1: consider a follow-up ticket to audit the other default-locale toUpperCase()/toLowerCase() call sites in this module.
    • Issue 2: a one-line comment at the two Locale.ROOT call sites for future maintainers.

CI note: the head commit was force-pushed/rebased since my last review (same code, just re-based onto a slightly newer dev), so I re-checked the fork's actual run rather than trusting the apache-side "Build" pointer. Of 30 jobs, only jdbc-connectors-it-part-1 (11, ubuntu-latest) shows cancelled (no failures at all); every relevant lane — transform-v2-it-part-1/part-2, unit-test (8/11, both OSes) — passed. That cancellation is unrelated to this diff (it doesn't touch transform-v2 at all) and looks environmental. This isn't a code-quality blocker.

Thanks again for tracking down and fixing this Turkish-I-problem-style non-determinism with such a clean, well-tested change — nothing new to add on re-review since the diff is unchanged from last time.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Problem Does This PR Solve?

  • User pain point: under a JVM whose default locale is Turkish/Azerbaijani (tr-TR, az), String.toLowerCase()/toUpperCase() apply Turkish-specific casing rules where I lowercases to the dotless ı and i uppercases to the dotted İ, so the SQL lower()/upper() transform functions could silently produce different results depending on which worker's JVM locale a job happened to run on.
  • Fix approach: switch both functions to Locale.ROOT, the standard, locale-independent remedy for this class of "Turkish-I problem."
  • One-sentence summary: a re-review at the current head after a dev merge — no PR-authored code changed since my last review.

1. Code Change Review

1.1 Core Logic Analysis

What changed since my last review (259af7d54c2, COMMENTED 2026-08-25T10:33:19Z): exactly one new commit, 83e82ce6f8d ("Merge branch 'dev' into fix/sql-string-case-locale"), pulling in one unrelated dev commit (389a49eb26, "[Improve][Connector-V2] Add support for INTERVAL data types in Oracle connector"). I confirmed this is a real, clean merge and not a silent content change: git diff 259af7d54c2..83e82ce6f8d -- StringFunction.java StringFunctionTest.java produces zero output — both files are byte-identical to the head I already reviewed. The full dev...HEAD diff is still exactly the same two files it has been throughout this PR's life:

// Before
return arg.toLowerCase();
...
return arg.toUpperCase();

// After
return arg.toLowerCase(Locale.ROOT);
...
return arg.toUpperCase(Locale.ROOT);

Everything I verified in my prior review still holds unchanged: the fix is minimal and precisely targeted at the two functions named in the linked issue (#11949); Locale.ROOT is the correct choice over Locale.ENGLISH; null handling is preserved exactly (arg == null short-circuits before case conversion); this is a stateless, per-row scalar SQL function with no checkpoint/serialization/cross-thread interaction. Runtime path, unchanged:

SQLTransform -> ZetaSQLEngine row evaluation -> ZetaSQLFunction dispatch("LOWER"/"UPPER")
  -> StringFunction.lower(args) / upper(args) -> Locale.ROOT case conversion -> returned into the row

1.2 Compatibility Impact

Fully compatible, unchanged from my prior review. Any JVM default locale other than Turkish/Azerbaijani sees byte-for-byte identical output before and after; the only affected deployments (tr-TR/az default locale) get a correctness fix, not a behavior change to something intentionally relied upon.

1.3 Performance / Side-Effect Analysis

Unchanged — negligible; passing an explicit Locale.ROOT has effectively the same cost as the locale lookup the no-arg overload already performs internally.

1.4 Error Handling and Logging

No change; null passthrough behavior is unchanged, no new logging needed.

Issue 1 (Low, non-blocking, carried over): the same default-locale hazard exists in unrelated case-insensitive dispatch code elsewhere in seatunnel-transforms-v2 (ZetaSQLFunction, DateTimeFunction, CastFunction, NumericFunction, SQLTransform) — out of scope for this focused fix, worth a follow-up ticket.

Issue 2 (Low, non-blocking, carried over): a short inline comment at the two Locale.ROOT call sites would help future maintainers avoid "simplifying" this back to the no-arg overload.

2. Code Quality Assessment

2.1 Coding Standards

Unchanged — clean, idiomatic, matches the file's existing style. The two changed lines plus the new import java.util.Locale; remain the only production-code touch points.

2.2 Test Coverage and Test Stability

Unchanged — testLowerAndUpperAreIndependentOfDefaultLocale flips Locale.getDefault() to tr-TR, asserts the corrected lower("I") == "i" / upper("i") == "I", and restores the original default in a finally block. No JUnit5 parallel-execution config for this module, so the global-default-locale mutation is safe for the duration of this single sequential test.

Stability rating: Stable. No sleeps, no timing assumptions, no shared mutable state beyond the properly try/finally-guarded locale flip, deterministic assertions.

2.3 Documentation Updates

Not required — pure correctness/determinism fix, no config, default, or public contract change.

3. Architectural Soundness

3.1 Elegance of the Solution

Precise fix, unchanged assessment — minimal, well-known remedy, no scope creep.

3.2 Maintainability

Slightly improves it (removes a latent footgun); see Issue 2 above.

3.3 Extensibility

N/A.

3.4 Historical-Version Compatibility

No serialization, checkpoint, or config compatibility surface touched. Fully backward compatible with all previously-saved jobs/state.

4. Issue Summary

Number Issue Location Severity
1 Same default-locale hazard remains in unrelated toUpperCase()/toLowerCase() dispatch code elsewhere in the module ZetaSQLFunction.java, DateTimeFunction.java, CastFunction.java, NumericFunction.java, SQLTransform.java Low
2 No inline comment explaining why Locale.ROOT is required at the two call sites StringFunction.java Low

5. Merge Recommendation

Conclusion: Ready to merge

  1. Blockers — must be fixed
    • None.
  2. Recommended fixes — non-blocking
    • Issue 1: consider a follow-up ticket to audit the other default-locale toUpperCase()/toLowerCase() call sites in this module.
    • Issue 2: a one-line comment at the two Locale.ROOT call sites for future maintainers.

CI note: the current head's fork Build run (32854961358) was still queued at review time — the branch was just rebased onto dev's latest tip (picking up an unrelated Oracle-connector commit) seconds before I checked, so a fresh run had not yet started. Since the diff touched by this PR is byte-identical to the head I already reviewed (259af7d54c2, whose fork run showed transform-v2-it-part-1/part-2 and both unit-test lanes green, with only unrelated integration-test jobs affected), I have no reason to expect a different result for this module's tests on the new run. This is a merge/rebase-only re-review; nothing in the PR's own diff changed since my last comment, so there is nothing new here for me to flag on the code itself.

Nothing new to add beyond confirming the diff is unchanged — thanks again for tracking down and fixing this Turkish-I-problem-style non-determinism with such a clean, well-tested change.

@DanielLeens

Copy link
Copy Markdown
Contributor

Quick follow-up after re-checking the current head (585b7fe).

The only commit added since my last review is 585b7fe ("ci: trigger pull request build"), which is an empty commit — zero files changed. So the PR diff is still byte-identical to what I already reviewed: just StringFunction.java (Locale.ROOT on the two case-conversion calls) and the new testLowerAndUpperAreIndependentOfDefaultLocale test. Nothing new to re-review on the code side, so I'm not posting another full review for the same code version.

I did dig into why the Build check is now showing red, since that's new information since my last comment. The three failing jobs on the fork run are all unrelated to this PR's module:

  • engine-v2-it (11, ubuntu-latest): SinkErrorToMysqlIT.testSinkMaxErrorRatioThreshold timed out after 2 minutes waiting for a lingering HikariPool housekeeper thread and a st-multi-table-sink-writer thread to exit inside the test container — a known-flaky thread-teardown timing issue in an unrelated MySQL sink-error-handling IT, nothing to do with SQL transforms.
  • doris-connector-it (11, ubuntu-latest): DorisErrorIT failed with UnknownHostException: doris_e2e: Temporary failure in name resolution — a Docker-network DNS resolution flake reaching the Doris test container.
  • connector-file-local-it (8, ubuntu-latest): Maven build failure resolving flink-annotations:1.20.1 from Maven Central (Connection reset) — a transient artifact-download failure, not a test/code failure at all.

None of these touch seatunnel-transforms-v2 or exercise StringFunction/case-conversion code in any way, so my prior "Ready to merge" conclusion stands unchanged. This looks like ordinary CI flakiness across three independent lanes rather than anything caused by this change — a rerun of those three jobs should clear it.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Problem Does This PR Solve?

  • User pain point: under a JVM whose default locale is Turkish/Azerbaijani (tr-TR, az), String.toLowerCase()/toUpperCase() apply Turkish-specific casing rules where I lowercases to the dotless ı and i uppercases to the dotted İ, so the SQL lower()/upper() transform functions could silently produce different results depending on which worker's JVM locale a job happened to run on.
  • Fix approach: switch both functions to Locale.ROOT, the standard, locale-independent remedy for this class of "Turkish-I problem."
  • One-sentence summary: another CI-trigger-only re-review — no PR-authored code changed since my last full review, but the fork's CI run picked up two new (and, on inspection, still unrelated) failures worth diagnosing precisely.

1. Code Change Review

1.1 Core Logic Analysis

What changed since my last review (83e82ce6f8d, COMMENTED 2026-08-25T15:16:23Z): two more commits, 585b7fe ("ci: trigger pull request build") and e7e4e6a ("ci: refresh pull request build status"). I confirmed both are empty, CI-retrigger-only commits: git diff 83e82ce6f8d..e7e4e6a11a -- StringFunction.java StringFunctionTest.java produces zero output, and git diff origin/dev...e7e4e6a11a --stat still shows exactly the same two files this PR has touched throughout its life:

// Before
return arg.toLowerCase();
...
return arg.toUpperCase();

// After
return arg.toLowerCase(Locale.ROOT);
...
return arg.toUpperCase(Locale.ROOT);

Everything verified in prior rounds still holds unchanged: the fix is minimal and precisely targeted at the two functions named in the linked issue (#11949); Locale.ROOT is the correct choice over Locale.ENGLISH; null handling is preserved exactly (arg == null short-circuits before case conversion); this is a stateless, per-row scalar SQL function with no checkpoint/serialization/cross-thread interaction. Runtime path, unchanged:

SQLTransform -> ZetaSQLEngine row evaluation -> ZetaSQLFunction dispatch("LOWER"/"UPPER")
  -> StringFunction.lower(args) / upper(args) -> Locale.ROOT case conversion -> returned into the row

1.2 Compatibility Impact

Fully compatible, unchanged from prior reviews. Any JVM default locale other than Turkish/Azerbaijani produces byte-for-byte identical output before and after; the only affected deployments (tr-TR/az default locale) get a correctness fix, not a behavior change to something intentionally relied upon.

1.3 Performance / Side-Effect Analysis

Unchanged — negligible; passing an explicit Locale.ROOT has effectively the same cost as the locale lookup the no-arg overload already performs internally.

1.4 Error Handling and Logging

No change; null passthrough behavior is unchanged, no new logging needed.

Issue 1 (Low, non-blocking, carried over): the same default-locale hazard exists in unrelated case-insensitive dispatch code elsewhere in seatunnel-transforms-v2 (ZetaSQLFunction, DateTimeFunction, CastFunction, NumericFunction, SQLTransform) — out of scope for this focused fix, worth a follow-up ticket. Raised by another reviewer: No.

Issue 2 (Low, non-blocking, carried over): a short inline comment at the two Locale.ROOT call sites would help future maintainers avoid "simplifying" this back to the no-arg overload. Raised by another reviewer: No.

2. Code Quality Assessment

2.1 Coding Standards

Unchanged — clean, idiomatic, matches the file's existing style. The two changed lines plus the new import java.util.Locale; remain the only production-code touch points.

2.2 Test Coverage and Test Stability

Unchanged — testLowerAndUpperAreIndependentOfDefaultLocale flips Locale.getDefault() to tr-TR, asserts the corrected lower("I") == "i" / upper("i") == "I", and restores the original default in a finally block. No JUnit5 parallel-execution config for this module, so the global-default-locale mutation is safe for the duration of this single sequential test. I re-verified in the live fork run (job Run / unit-test (8, ubuntu-latest), run 33115374146) that StringFunctionTest executed cleanly: Tests run: 34, Failures: 0, Errors: 0, Skipped: 0 — the new regression test genuinely reproduces and proves the fix for the dotted/dotless-I bug, not just default-locale behavior.

Stability rating: Stable. No sleeps, no timing assumptions, no shared mutable state beyond the properly try/finally-guarded locale flip, deterministic assertions.

2.3 Documentation Updates

Not required — pure correctness/determinism fix, no config, default, or public contract change.

3. Architectural Soundness

3.1 Elegance of the Solution

Precise fix, unchanged assessment — minimal, well-known remedy, no scope creep.

3.2 Maintainability

Slightly improves it (removes a latent footgun); see Issue 2 above.

3.3 Extensibility

N/A.

3.4 Historical-Version Compatibility

No serialization, checkpoint, or config compatibility surface touched. Fully backward compatible with all previously-saved jobs/state.

4. Issue Summary

Number Issue Location Severity
1 Same default-locale hazard remains in unrelated toUpperCase()/toLowerCase() dispatch code elsewhere in the module ZetaSQLFunction.java, DateTimeFunction.java, CastFunction.java, NumericFunction.java, SQLTransform.java Low
2 No inline comment explaining why Locale.ROOT is required at the two call sites StringFunction.java:264,272 Low

5. Merge Recommendation

Conclusion: Ready to merge

  1. Blockers — must be fixed
    • None.
  2. Recommended fixes — non-blocking
    • Issue 1: consider a follow-up ticket to audit the other default-locale toUpperCase()/toLowerCase() call sites in this module.
    • Issue 2: a one-line comment at the two Locale.ROOT call sites for future maintainers.

CI diagnosis (live re-check, fork run 33115374146 at head e7e4e6a11a): since the branch was rebased/retriggered again, I re-checked the fork's actual run rather than the apache-side Build pointer, which is only a mirror of it. Of the full matrix, only two jobs are non-green, and both are new failures (different from the three I diagnosed last round, which were already cleared/rotated out by GitHub's retention):

  • unit-test (8, ubuntu-latest): the actual failing test is CoordinatorServiceTest.testClearCoordinatorServiceDropsPendingJobsUnderRejectStrategy in seatunnel-engine-server, which threw org.awaitility.core.ConditionTimeoutException (a Mockito WantedButNotInvoked assertion that didn't resolve within its 5-second Awaitility window). This is a Zeta job-coordinator/master lifecycle test with zero relationship to seatunnel-transforms-v2 or StringFunction — a classic async-timing flake, not something this diff could plausibly cause. StringFunctionTest itself ran and passed cleanly within this same job (see 2.2 above).
  • doris-connector-it (11, ubuntu-latest): DorisErrorIT.testDoris failed with java.net.UnknownHostException: doris_e2e: Temporary failure in name resolution — a Docker-network DNS resolution flake reaching the Doris test container, the same class of infra flake I already flagged for this exact test on 2026-08-27. Nothing to do with this PR's module.

Every job that actually exercises this PR's code — transform-v2-it-part-1/part-2 (both JDK 8 and 11) and unit-test (11, ubuntu-latest) — is green. My "Ready to merge" conclusion is unchanged for the fourth consecutive round; the code itself has not changed since 259af7d54c2 (2026-08-24). I've already recommended syncing with dev and rerunning in prior rounds (the branch did pick up dev on 2026-08-25 and is currently 17 commits behind a fast-moving dev, with no conflicts on this PR's two files), so at this point the actionable next step is simply a job-level rerun of these two specific jobs (unit-test (8, ubuntu-latest) and doris-connector-it (11, ubuntu-latest)) rather than another full resync — the failures are independent, environmental, and unrelated to the diff each time, so a targeted rerun should be sufficient to go fully green.

Overall: still a nice, focused bug fix — thanks for your patience through several rounds of CI noise on an otherwise unchanged, clean, well-tested change.

@tagadearpit

Copy link
Copy Markdown
Contributor Author

The changes has been successfully pushed

@DanielLeens

Copy link
Copy Markdown
Contributor

Thanks for the update, and confirmed.

I re-checked the current head (40c507d8) against the commit I last reviewed (e7e4e6a11a, COMMENTED 2026-08-28T10:29:48Z). The only commit added is a merge (Merge branch 'dev' into fix/sql-string-case-locale, parents e7e4e6a11a + f0046a0022) that pulls in 40 new dev commits — but the PR's own diff is still confined to exactly the same two files it has been throughout this PR's life (StringFunction.java and StringFunctionTest.java), and neither appears anywhere in the e7e4e6a11a...40c507d8 file list, so they're byte-identical to what I already reviewed. This is the dev sync I'd suggested in earlier rounds (the branch was 17 commits behind at my last check) finally landing — not a code change on your side.

CI is currently queued/in-progress on your fork's Build run for this new head (started ~14:54 UTC), so results aren't in yet. Given the sync, I'd expect the previously-flaky jobs (unit-test, doris-connector-it, etc.) to get a clean shot at re-running against current dev; I'll take another look once the run finishes.

Nothing new to add on the code itself — my "Ready to merge" conclusion from prior rounds stands, contingent on this fresh CI run coming back green.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review acknowledgment: I re-read the entire diff and re-traced the runtime path from scratch against the current head 40c507d84f, rather than only diffing against my last review. Short version: git diff e7e4e6a11a..40c507d84f -- seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sql/zeta/functions/StringFunction.java seatunnel-transforms-v2/src/test/java/org/apache/seatunnel/transform/sql/zeta/functions/StringFunctionTest.java produces zero output — the only commit added since my last review (e7e4e6a11a, COMMENTED 2026-08-28T10:29:48Z) is another Merge branch 'dev' into fix/sql-string-case-locale (parents e7e4e6a11a + f0046a002, pulling in 5 more dev commits on top of the 40 already merged in the previous round). The PR's own two files remain byte-identical to what I reviewed three times already.

What Problem Does This PR Solve?

  • User pain point: under a JVM whose default locale is Turkish/Azerbaijani (tr-TR, az), String.toLowerCase()/toUpperCase() apply Turkish-specific casing rules (I → dotless ı, i → dotted İ), so the SQL LOWER()/UPPER() transform functions could silently produce different results depending on which worker's JVM locale a job happens to run on.
  • Fix approach: switch both functions to Locale.ROOT, the standard, locale-independent remedy.
  • One-sentence summary: this is a fourth re-review of the same two-line fix — no PR-authored code changed since my last round; I re-verified everything from first principles anyway per this dispatch's instructions.

1. Code Change Review

1.1 Core Logic Analysis

// StringFunction.java:264, 272
return arg.toLowerCase(Locale.ROOT);   // was: arg.toLowerCase()
return arg.toUpperCase(Locale.ROOT);   // was: arg.toUpperCase()

Re-verified independently this round: Locale.ROOT is the correct choice over Locale.ENGLISH (both give ASCII-stable results for this input space, but ROOT is the idiomatic "I explicitly don't want locale-sensitive behavior" signal and matches how the new regression test names itself). Null handling is unchanged — the arg == null short-circuit still runs before any case conversion. This is a pure, stateless, per-row scalar function; no checkpoint/serialization/cross-thread state is involved. Runtime flow, re-confirmed by reading SQLTransform → ZetaSQLFunction dispatch → StringFunction.lower/upper end to end:

SQLTransform.map(row) -> ZetaSQLEngine evaluates the SELECT list -> ZetaSQLFunction.executeFunctionExpression("LOWER"/"UPPER", args)
  -> switch(functionName.toUpperCase()) dispatches to StringFunction.lower(args)/upper(args)
     -> Locale.ROOT case conversion -> value written back into the row's column

I separately re-confirmed the dispatch switch in ZetaSQLFunction.java:459 matching on functionName.toUpperCase() (no explicit Locale) is not itself broken by this: the two constant case labels are pure-ASCII "LOWER"/"UPPER", so even under a Turkish JVM default, the dispatch itself still matches correctly — the same-class hazard I noted last round (see Issue 1 below) is real but does not undermine this specific fix.

1.2 Compatibility Impact

Fully compatible — unchanged from every prior round. Any JVM running under a non-Turkish/Azerbaijani default locale gets byte-for-byte identical output before and after. tr-TR/az-locale deployments get a correctness fix, not a behavior change users were relying on (the previous behavior was an unintentional bug, not a documented contract).

1.3 Performance / Side-Effect Analysis

Negligible — toLowerCase(Locale.ROOT) has the same cost profile as the no-arg overload (which itself resolves Locale.getDefault() internally); no new allocation pattern, no hot-path regression.

1.4 Error Handling and Logging

Unchanged — no new failure path introduced, nothing swallowed.

2. Code Quality Assessment

2.1 Coding Standards

Clean, minimal, idiomatic — still only the two changed lines plus the new import java.util.Locale;, no scope creep.

2.2 Test Coverage and Test Stability

testLowerAndUpperAreIndependentOfDefaultLocale (StringFunctionTest.java) flips Locale.getDefault() to tr-TR, asserts lower("I") == "i" and upper("i") == "I" (the exact Turkish-I collision this fix targets), and restores the original default in a finally block — this is a genuine regression test, not a tautology, since it fails against the pre-fix code ("I".toLowerCase() under tr-TR yields "ı", not "i"). No sleeps, no shared mutable state beyond the properly finally-guarded global-default-locale mutation, deterministic assertions. I checked this module has no parallel test execution configured (no junit.jupiter.execution.parallel.enabled=true in its junit-platform.properties), so the global default-locale mutation stays safe for a single sequential test class.
Test Stability rating: Stable.

2.3 Documentation Updates

Not required — pure correctness/determinism fix, no config, default, or public contract change.

3. Architectural Soundness

3.1 Elegance of the Solution

Precise, minimal, well-known remedy — unchanged assessment across all four rounds.

3.2 Maintainability

Unchanged from last round: still no inline comment at the two Locale.ROOT call sites explaining why the explicit locale is required (see Issue 2, carried over, still open — the code itself hasn't changed so there was nothing new to add here this round).

3.3 Extensibility

N/A.

3.4 Historical-Version Compatibility

No serialization, checkpoint, or config compatibility surface touched. Fully backward compatible with all previously-saved jobs/state — re-confirmed, unchanged.

4. Issue Summary

Both carried-over issues from my previous rounds remain open (neither is addressed by this round's dev-sync-only commit, and neither blocks merge):

Number Issue Location Severity Raised by another reviewer
1 Same default-locale hazard remains in unrelated case-insensitive dispatch/keyword-parsing code elsewhere in this module ZetaSQLFunction.java:459,687,707, ZetaSQLType.java:323,570, DateTimeFunction.java:70,185,264,384, CastFunction.java:93, NumericFunction.java:246,303, VectorFunction.java:270, SQLTransform.java:83 Low No
2 No inline comment explaining why Locale.ROOT is required at the two call sites (risk: a future contributor "simplifies" it back to the no-arg overload) StringFunction.java:264,272 Low No

I re-verified Issue 1's scope this round (grepped for .toUpperCase()/.toLowerCase() across seatunnel-transforms-v2/.../sql/ fresh rather than trusting my earlier list) — same call sites, nothing newly introduced or newly fixed. Since these are all case-folding of hardcoded ASCII SQL keywords/type names against ASCII-only switch labels (e.g. "SUBSTRING", "INSTR", "TIMESTAMP"), they're latent rather than actively wrong for common keywords, but a keyword containing a bare i/I (e.g. INSTR, TRIM) would still mismatch its switch label under a Turkish-locale JVM — worth the follow-up ticket I suggested last round.

5. Merge Recommendation

Conclusion: Ready to merge after fixes

  1. Blockers — must be fixed

    • None in the code. However: gh pr view currently reports mergeStateStatus: DIRTY / mergeable: CONFLICTING — dev has advanced past f0046a002 (the tip this PR's last merge commit synced to) and now conflicts with this branch. This needs a rebase/re-merge before a maintainer can actually click merge; it's a mechanical blocker, not a code-quality one.
    • CI (Build) is red on the fork for this head (https://github.com/tagadearpit/seatunnel/actions/runs/33404016935), but both failures are unrelated to this PR's diff: RocketMqIT.testSourceRocketMqRestore (checkpoint-restore message-count off-by-one, 45 vs 46 — a known-flaky restore-count assertion, not touched by this PR) and JdbcHanaIT (ContainerLaunchException — SAP HANA testcontainer failed to start, infra flake). Neither exercises StringFunction/ZetaSQLFunction. Worth a clean re-run after the rebase rather than a code fix.
  2. Recommended fixes — non-blocking

    • Issue 1 (Low, carried over): follow-up ticket to audit the other default-locale toUpperCase()/toLowerCase() call sites in this module.
    • Issue 2 (Low, carried over): a one-line comment at the two Locale.ROOT call sites.

Overall assessment: the fix itself has been correct and stable across all four rounds I've reviewed; the only actionable item this round is mechanical (rebase onto current dev to clear the conflict, then get a clean CI run — the two current failures are pre-existing flakes unrelated to this change). Thanks for your patience through the repeated dev-sync cycles, @tagadearpit — as always, I have comment-only rights on this repo, so a write-capable maintainer should handle the rebase/merge once CI is green on the synced head.

@tagadearpit

Copy link
Copy Markdown
Contributor Author

Hi @DanielLeens @davidzollo @zhangshenghang,

Following up on this PR: the underlying issue (#11949) was addressed and merged into dev via #11951 (1a8c637e), which introduced the same Locale.ROOT case-conversion fix and a corresponding test in StringFunctionTest.java. Because both PRs added tests at the same location, this PR is currently showing merge conflicts against dev.

Since the fix is already present on dev, please review and advise if this PR can be closed as superseded by #11951, or if you would like the branch rebased/synced with dev. Thank you!

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Problem Does This PR Solve?

Under a JVM whose default locale is Turkish/Azerbaijani (tr-TR, az), String.toLowerCase()/toUpperCase() apply Turkish-specific casing rules (I -> dotless i, i -> dotted I with a dot above), so the SQL LOWER()/UPPER() transform functions could silently produce different results depending on which worker's JVM locale a job happens to run on. This PR's original approach was to switch both functions to Locale.ROOT, the standard, locale-independent remedy. However, as detailed below, that fix has now shipped through a different PR, and this branch's current head has a new, self-inflicted problem that supersedes everything I said in my four prior review rounds.

1. Code Change Review

1.1 Core Logic Analysis

This is a fifth re-review, and the situation has fundamentally changed since my last round (40c507d84f, COMMENTED 2026-09-01T10:28:28Z). Two things happened in parallel that both need to be called out plainly:

(a) The production fix is now redundant. The identical fix (StringFunction.java switching toLowerCase()/toUpperCase() to Locale.ROOT) was merged into dev on 2026-09-01 via #11951 (commit 1a8c637e996, "[Fix][Transform-V2] Make SQL case conversion locale independent"). I confirmed this directly: git diff apache/dev...d68908fed69 -- .../StringFunction.java produces zero output — StringFunction.java on this PR's head is now byte-identical to dev, because dev already carries this exact fix. The only remaining diff between this branch and dev is a single, now-duplicate test method in StringFunctionTest.java. The author flagged this themselves in an issue comment on 2026-09-03T11:00:24Z, asking whether the PR should be closed as superseded by #11951 — I can confirm that assessment is correct from the source, not just from the author's account.

(b) The latest commit on this branch (d68908fed69, a "Merge branch 'dev' into fix/sql-string-case-locale" made 2026-09-03 ~11:03 UTC, merging parent 2e2e9b80400 into the previously-reviewed 40c507d84f) introduced a genuine, compile-breaking syntax error while resolving the conflict between this PR's own testLowerAndUpperAreIndependentOfDefaultLocale and dev's already-present, near-identical testLowerAndUpperAreLocaleIndependent (both added by #11951). Reading the actual current file content (not just the diff hunk) at seatunnel-transforms-v2/src/test/java/org/apache/seatunnel/transform/sql/zeta/functions/StringFunctionTest.java:430-448:

@Test
public void testLowerAndUpperAreIndependentOfDefaultLocale() {
    Locale original = Locale.getDefault();
    try {
        Locale.setDefault(Locale.forLanguageTag("tr-TR"));
        Assertions.assertEquals("i", StringFunction.lower(Collections.singletonList("I")));
        Assertions.assertEquals("I", StringFunction.upper(Collections.singletonList("i")));
    } finally {
        Locale.setDefault(original);
public void testLowerAndUpperAreLocaleIndependent() {
    Locale originalLocale = Locale.getDefault();
    try {
        Locale.setDefault(Locale.forLanguageTag("tr-TR"));

        Assertions.assertEquals("i", StringFunction.lower(Collections.singletonList("I")));
        Assertions.assertEquals("I", StringFunction.upper(Collections.singletonList("i")));
    } finally {
        Locale.setDefault(originalLocale);
    }
}

The finally block opened at line 437 is never closed, the try opened at line 433 is never closed, and the method opened at line 431 is never closed — the second method's signature (public void testLowerAndUpperAreLocaleIndependent(), with no @Test annotation of its own) sits directly inside the unclosed finally block. This is not a leftover <<<<<<</=======/>>>>>>> conflict-marker artifact (I grepped the whole module for those, none present) — it looks like a manual/tool-assisted conflict resolution that deleted the markers but dropped the closing braces for one side. The file does not parse as valid Java.

I verified this is not a theoretical read of mine: I dereferenced the apache-side Build check pointer for this exact head (d68908fed69) to the real fork run (tagadearpit/seatunnel run 33747600878), and the Code style job fails with:

Caused by: com.google.googlejavaformat.java.FormatterException: 439:6: error: illegal start of expression
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.29.0:check ... on project seatunnel-transforms-v2

This is a genuine javac/google-java-format parse failure at exactly the line I identified by reading the source, and it gates every other job in the matrix — unit-test, transform-v2-it-part-1/2, and everything else show skipped because the Code style precondition job never passes. In other words: as of this head, the module does not even compile far enough to run StringFunctionTest (or anything else in seatunnel-transforms-v2), let alone prove the original fix. This is unrelated to any of the "environmental CI flake" diagnoses I made in my four prior rounds — this is a real, self-contained defect in this PR's own latest commit.

Runtime path (unchanged from prior rounds, for the underlying StringFunction.lower/upper logic itself, which — to be clear — is fine and already in production via dev):

SQLTransform.map(row) -> ZetaSQLEngine evaluates the SELECT list -> ZetaSQLFunction dispatch("LOWER"/"UPPER")
  -> StringFunction.lower(args) / upper(args) -> Locale.ROOT case conversion -> value written back into the row's column

1.2 Compatibility Impact

Fully compatible with respect to the production code — moot at this point since StringFunction.java on this branch is identical to what's already on dev. Not applicable to the broken test file, since it doesn't compile at all right now.

1.3 Performance / Side-Effect Analysis

Not applicable — the module fails to build at this head, so there is no running code to assess for performance or side effects beyond what's already live on dev via #11951.

1.4 Error Handling and Logging

No new error handling or logging changes beyond what I already reviewed and approved of in prior rounds (unchanged null-passthrough behavior in StringFunction).

Issue 1 (High, new this round, blocking): StringFunctionTest.java:430-448 does not compile — an unclosed try/finally/method body from a botched dev-merge conflict resolution leaves a second method's signature embedded inside the first method's finally block, breaking the whole module's build. Confirmed independently via source inspection and the fork's live Code style CI failure (illegal start of expression at line 439). Raised by another reviewer: No.

Issue 2 (Medium, new this round, blocking in effect): The PR is now functionally superseded. StringFunction.java is byte-identical to dev (the fix already shipped via #11951, merged 2026-09-01). The only thing this PR could still contribute is a test method, but dev already carries an equivalent one (testLowerAndUpperAreLocaleIndependent, added by the same #11951) that exercises the identical scenario (tr-TR locale, lower("I")/upper("i")). There is no remaining unique value in landing this branch as-is. Raised by another reviewer: No — though the author raised the same concern in their 2026-09-03T11:00:24Z comment, asking whether to close as superseded; I'm treating that as a related, not identical, point since they asked a question rather than asserting the conclusion.

2. Code Quality Assessment

2.1 Coding Standards

Not assessable in the normal sense — the file does not parse, so no formatting/style judgment is meaningful until the merge is fixed. The original two-line StringFunction.java fix (now living on dev via #11951, not via this PR) was clean and idiomatic, as I noted in every prior round.

2.2 Test Coverage and Test Stability

Stability rating: High risk. Not because of flaky timing or Thread.sleep patterns (the original testLowerAndUpperAreIndependentOfDefaultLocale test, when it was last syntactically valid at 40c507d84f, was properly try/finally-guarded and deterministic, as I confirmed in my 2026-09-01 review) — but because the test file as it exists on the current head is not valid Java and cannot compile, which is the most severe possible test-stability outcome: zero tests in this class (and the entire seatunnel-transforms-v2 module, since Code style gates the whole build) can run at all. Per the review structure's requirement, this is also recorded as the formal Issue 1 (High) above.

2.3 Documentation Updates

Not required — this was always a pure correctness/determinism fix with no config, default, or public contract change, and that hasn't changed.

3. Architectural Soundness

3.1 Elegance of the Solution

The original fix design (precise, minimal, Locale.ROOT) was sound and is exactly what I approved across four prior rounds — but it's now living on dev via a different PR, not this one. As it currently stands, this branch is not a solution to anything; it's a broken, redundant duplicate.

3.2 Maintainability

Actively harmful in its current state — merging this would either fail CI outright (it already does) or, if someone force-fixed just enough to pass, would add a second near-duplicate locale test method sitting alongside the one #11951 already put on dev, which is a maintenance smell (two tests asserting the same behavior under slightly different names/variable names).

3.3 Extensibility

N/A.

3.4 Historical-Version Compatibility

No serialization, checkpoint, or config compatibility surface is touched by the underlying fix concept (this remains true), but that's now beside the point since the actual code path in question already ships via dev/#11951.

4. Issue Summary

Number Issue Location Severity
1 Botched dev-merge conflict resolution leaves StringFunctionTest.java syntactically invalid (unclosed method/try/finally, a second method signature embedded inside the first's finally block) — confirmed by a live CI parse failure (illegal start of expression at line 439) that blocks the entire module's build StringFunctionTest.java:430-448 High
2 PR is functionally superseded: the production fix (StringFunction.java) is byte-identical to dev, which already has this exact change via #11951 (merged 2026-09-01); the remaining test is a near-duplicate of one dev already carries StringFunction.java (no diff vs. dev), StringFunctionTest.java Medium

5. Merge Recommendation

Conclusion: Not recommended for merge

  1. Blockers — must be fixed

    • Issue 1 (High): the current head does not compile. This alone blocks merge regardless of anything else.
    • Issue 2 (Medium): even if Issue 1 were fixed, there is no remaining unique contribution to merge — the production fix is already on dev via #11951, and the surviving test would be a redundant duplicate of one dev already has.
  2. Recommended fixes — non-blocking

    • None beyond the above — this isn't a "polish before merge" situation.

Overall assessment: I want to be upfront that my prior four rounds of review (2026-08-24 through 2026-09-01) correctly evaluated the fix as it existed at each of those points, and none of that analysis was wrong for the code I was looking at then. What's changed is that the underlying problem got fixed independently through #11951 while this PR was cycling through dev-sync rounds, and the most recent sync attempt (today, d68908fed69) botched its own conflict resolution and left the branch in a non-compiling state. Given the fix is already live on dev, I don't think this is a "resolve the conflict and merge" situation — I'd recommend @tagadearpit close this PR as superseded by #11951, which is exactly what they proposed in their 2026-09-03 comment. If there's ever a desire to also land the "independent" test name/wording from this branch, that could be done as a small separate follow-up against current dev, but it isn't necessary — dev's existing testLowerAndUpperAreLocaleIndependent already covers the same regression scenario. No better alternative implementation is needed here since the target behavior is already correctly implemented and tested on dev; the only remaining question is administrative (close vs. force-fix-then-close), which I'll leave to the author.

Thank you for tracking down and originally fixing this Turkish-I-problem-style non-determinism, @tagadearpit — the core insight and fix were correct from round one. Apologies for the churn across five review rounds; closing this out as superseded is the cleanest path forward now that #11951 has landed the same fix.

@nzw921rx

Copy link
Copy Markdown
Member

PR #11951 merged, close this , Thank you for your efforts.

@nzw921rx nzw921rx closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Transform-V2] SQL lower and upper depend on the worker default locale

3 participants