v.22.8Improvement
Adds parseDateTime64BestEffort Functions
AddsparseDateTime64BestEffortUS,parseDateTime64BestEffortUSOrNull,parseDateTime64BestEffortUSOrZerofunctions, closing #37492. #40015 (Tanya Bragin).
Why it matters
These functions address the need for robust and forgiving parsing of date-time strings intoDateTime64 types with microsecond accuracy. They improve user experience by handling various input formats gracefully and providing options to return null or zero on parse failure, which helps in data cleansing and error handling.How to use it
Use the functions in your SQL queries by calling them with a string argument containing the date-time value. For example:SELECT parseDateTime64BestEffortUS('2024-06-01 12:34:56.123456');The variants
parseDateTime64BestEffortUSOrNull and parseDateTime64BestEffortUSOrZero return NULL or 0 respectively if parsing fails, allowing you to handle invalid inputs gracefully.