SEPURI-SAI-KRISHNA commented on issue #12975: URL: https://github.com/apache/seatunnel/issues/12975#issuecomment-6399861807
Thanks @SEZ9. The PR is already open as #12976 and it does what you describe. Both call sites now pass an explicit locale: ```java // formatdatetime, DateTimeFunction:619 and fromUnixTime, DateTimeFunction:803 DateTimeFormatter df = DateTimeFormatter.ofPattern(format, Locale.ENGLISH); ``` **On the behaviour change, it is called out in the PR description, and `Locale.ENGLISH` was chosen over `Locale.ROOT` for exactly that reason.** I measured both against today's output rather than assuming they agree: | pattern | today, en-US | `Locale.ROOT` | `Locale.ENGLISH` | | --- | --- | --- | --- | | `EEEE` | Friday | Fri | Friday | | `MMMM` | October | Oct | October | `Locale.ROOT` silently abbreviates 2 of the 7 text patterns, so it would change output for English workers too. `Locale.ENGLISH` changes 0 of 7, which keeps the change confined to the workers that were producing localized text. It also matches what this class already does for `DAYNAME` and `MONTHNAME` through `DateFormatSymbols.getInstance(Locale.ENGLISH)`. So users on a non-English worker who were getting localized month and day names will now get English, which is the deliberate part of the fix, and users on an English worker see byte identical output. The regression test runs the real `SQLTransform` under `ENGLISH`, `tr-TR` and `ja-JP` defaults and restores the previous locale in a `finally`, following `testAtTimeZone` in the same class. One case asserts `FORMATDATETIME(dt,'EEEE')` equals `DAYNAME(dt)` and `FORMATDATETIME(dt,'MMMM')` equals `MONTHNAME(dt)`, which is the inconsistency this fixes, with a numeric-pattern control alongside. Agreed that an optional locale argument is a separate follow-up; this PR keeps the default deterministic and does not add an option. -- 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]
