date_trunc
always returns Timestamp(Nanosecond, None)
which might truncate ranges
#6653
Labels
enhancement
New feature or request
Is your feature request related to a problem or challenge?
Prior to #6632 and #6638 the
date_trunc
function was inconsistent between reported types and actual types for arrays/scalarsNow it is consistent in the sense that
However, by using
Timestamp(Nanosecond, None)
everywhere will truncate the range over whichdate_trunc
will work -- specifically if there is some value that can be represented usingTimestamp(Second)
that doesn't fit into aTimestamp(Nanosecond)
such as a value before1677-09-21 00:12:43.145224193
or after2262-04-11 23:47:16.854775807
date_trunc will error.Describe the solution you'd like
We could potentially change the function to keep the same
TimeUnit
of its input:Namely
Describe alternatives you've considered
We could also just leave the current behavior
Additional context
See comments #6632 (comment)
The text was updated successfully, but these errors were encountered: