linhongliu-db opened a new pull request #33490:
URL: https://github.com/apache/spark/pull/33490


   ### What changes were proposed in this pull request?
   In PR #32959, we found some weird datetime strings that can be parsed. 
([details](https://github.com/apache/spark/pull/32959#discussion_r665015489))
   This PR blocks the invalid datetime string.
   
   ### Why are the changes needed?
   bug fix
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes, below strings will have different results when cast to datetime.
   ```sql
   select cast('12::' as timestamp); -- Before: 2021-07-07 12:00:00, After: NULL
   select cast('T' as timestamp); -- Before: 2021-07-07 00:00:00, After: NULL
   ```
   
   
   ### How was this patch tested?
   some new test cases
   


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to