fengstack commented on PR #18726: URL: https://github.com/apache/dolphinscheduler/pull/18726#issuecomment-6337487533
Thanks for the follow-up @SbloodyS! Updated in commit 5b672593d8: ### 1. Preserve legacy standard-placeholder numeric offsets `calcMinutes(String, Date)` is now restored to the exact legacy implementation and is used only for standard placeholders, so every numeric operand keeps the day-offset semantics regardless of its shape: - `$[yyyyMMdd+1400]` => `20260626` (+1400 days, as before this PR) - `$[yyyyMMdd-3650]` => `20120828`, `$[yyyyMMdd+3650]` => `20320823` (unchanged) - `$[yyyy-MM-dd+0800]` => `2024-11-03` (+800 days, as before this PR); the previous literal-preserving assertions for standard placeholders were corrected accordingly, and quoted tails that fail arithmetic parsing (e.g. `$[yyyy-MM-dd'+0800']`) now leave the placeholder unresolved, matching the legacy behavior ### 2. Boundary-function format literals no longer rely solely on a timezone-shaped suffix The boundary functions (month_first_day, month_begin/ end, week_first_day/ last_day, week_begin/ end, this_day/ last_day, add_months) now resolve their format argument through a new `calcFormatOffset`. A trailing tail is treated as an offset only when it consists solely of arithmetic characters (digits, operators, parentheses) and is not a timezone-shaped literal. Otherwise it stays part of the date format: - `$[month_first_day(yyyy-MM-dd'T'HH:mm:ss+08:00' (CST)')]` => `2022-08-01T00:00:00+08:00 (CST)` - `$[this_day(yyyy-MM-dd'T'HH:mm:ss+08:00' (CST)')]` => `2022-08-26T00:00:00+08:00 (CST)` - `$[month_first_day(yyyy-MM-dd+0800)]` => `2022-08-01+0800`, `$[month_first_day(yyyy-MM-dd-1)]` => `2022-08-01` (unchanged) ### Regression coverage The `+1400` assertion was corrected and `timePlaceHolderWithTrailingFormatLiteralSuffix` was added; the four standard-placeholder literal assertions were updated to the legacy expectations. All 137 tests in `dolphinscheduler-task-api` pass and spotless is clean. -- 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]
