fengstack commented on PR #18726:
URL: 
https://github.com/apache/dolphinscheduler/pull/18726#issuecomment-6338396619

   Good catch, thanks @SbloodyS! Updated in commit 1c8b244395. 
`startsWithTimezoneOffsetLiteral` now validates the token following the compact 
timezone: the sign is treated as a format literal only when the timezone-shaped 
number is immediately followed by **another sign** that starts a separate 
offset (e.g. the `-` in `0800-1`). Continuations of the same arithmetic 
expression are complete operands and are evaluated:
   
   - `$[month_first_day(yyyyMMdd-1000/24/60)]` => `20220801` (business date 
2022-09-01, 1000 minutes subtracted; the `/` continues the operand rather than 
starting an offset)
   - `$[this_day(yyyyMMdd-2*3)]` => `20220820` (multiplication operand)
   - `$[month_first_day(yyyyMMdd-10000)]` => `19950401` (five-digit numeric 
operand)
   - `$[month_first_day(yyyyMMdd+1000/0)]` => ignore-invalid preserves the 
placeholder, strict mode throws `IllegalArgumentException` (division is now 
attempted, so error handling is no longer bypassed)
   - `$[month_first_day(yyyyMMdd+0800-1)]` => `20220801+0800` (unchanged: a 
sign right after the timezone still marks tz + offset)
   
   Coverage added in `timePlaceHolderWithTzShapedArithmeticOperand` (division, 
multiplication, longer numerics, and both failure modes with a timezone-shaped 
prefix). All 141 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]

Reply via email to