hutiefang76 opened a new issue, #12667:
URL: https://github.com/apache/seatunnel/issues/12667

   ## Search before asking
   
   - [x] Searched existing issues and pull requests; no existing fix for this 
reproduction was found.
   
   ## What happened
   
   DateUtils.matchDateFormatter accepts ISO local datetime text with a 
fractional second and optional Z, but its corresponding formatter puts the 
fraction and Z in the same optional block. A value such as 
2024-12-16T15:33:45.123 matches the pattern and then fails to parse. This also 
affects DATE fields parsed from CSV/Text through DateUtils.
   
   ## SeaTunnel Version
   
   dev at 760c33a94433db85b974ae4d6622d05b726a4a47
   
   ## SeaTunnel Config
   
   ```text
   Utility-level reproduction; no job configuration required.
   ```
   
   ## Running Command / reproduction
   
   Call DateUtils.parse("2024-12-16T15:33:45.123"). Expected LocalDate 
2024-12-16; actual DateTimeParseException with unparsed text at index 19. The 
same text with a trailing Z parses. Whole-second text without Z also parses.
   
   Regression command after adding the test:
   
   ```shell
   ./mvnw -q -pl seatunnel-common -am -Dtest=DateUtilsTest 
-Dsurefire.failIfNoSpecifiedTests=false package
   ```
   
   ## Error Exception
   
   JDK 17: DateUtilsTest, 6 tests passed after the fix. Against the original 
formatter, the same suite produced 1 error (fractional local datetime without 
Z).
   
   ## Java or Scala Version
   
   JDK 17, macOS.
   
   ## Are you willing to submit PR?
   
   - [x] Yes
   
   ## Code of Conduct
   
   - [x] I agree to follow the Apache Code of Conduct.
   


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