feat: Improved time-string parsing and inference (generally, and via the SQL interface) #22606
+32
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses an Issue raised on the Discord (in the
#sql
channel) by @etrotta.%R
chrono hour-minute format to the set of recognised time specifiers - which we already identify in datetime strings).to_datetime
andto_time
functions so that hour-minute format (%R
, aka:%H:%M
) is also recognised in the SQL interface (both standalone, as a time, and as part of a larger datetime/timestamp string). A subsequent/follow-up PR will bring a similar improvement to SQLCAST
ops.Example
Use of
'%H:%M'
literal strings in WHERE clauses:Properly inferred by
str.to_time()
: