-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EPIC] A collection of Date/Time related open issues #3148
Comments
@alamb @avantgardnerio i created a separated ticket for tracking timestamp related open issues (from both datafusion and arrow-rs) |
This is amazing @waitingkuo -- thank you |
@waitingkuo you can @ me to review your pr about the times. |
Proposal: We attack this in multiple steps parts:
I think the above plan will allow us to tackle the problem in stages, without ever technically breaking ANSI compliance and reaching full compliance at the end state. Caveat: I'm not sure if we will ever reach the end state, and I'm okay with that personally. |
Thank you @avantgardnerio and @waitingkuo for driving this issue. It is awesome to see |
@alamb @avantgardnerio @liukun4515 i just finished the first 2 from @avantgardnerio's proposal
now we have DataFusion CLI v12.0.0
❯ show time zone;
+--------------------------------+---------+
| name | setting |
+--------------------------------+---------+
| datafusion.execution.time_zone | UTC |
+--------------------------------+---------+
1 row in set. Query took 0.059 seconds. i'm just starting the work for postgresql has this
Converts string to time stamp according to the given format. (See also to_timestamp(double precision) in Table 9.32.) to_timestamp('05 Dec 2000', 'DD Mon YYYY') → 2000-12-05 00:00:00-05 and this
Convert Unix epoch (seconds since 1970-01-01 00:00:00+00) to timestamp with time zone Looks like its In general, do you think we should align these function signatures with postgresql? BTW |
I think it would be ok to align the functions with postgres as long as there is some clear way to get the current behavior as well (e.g. the query needs to be tweaked or something) |
I filed #3980 and added it to this ticket -- I plan to add more date/time open issues here to help track them |
I think #2785 belongs in this list as well! |
added, thank you @mjvankampen |
Filed See #5753 to track work for intervals |
Hi @watfordkcf -- thanks! I believe @tustvold is in the middle of cleaning and making consistent the various timestamp arithmetic / kernels / intervals The largest outstanding gap that I know of is correct timezone handling (basically anything other than UTC timestamps are like to hit corner cases / bugs) -- this is related to #959 In terms of #6876, that would be lovely I think. |
Do we have any method to convert or cast the integer type/integer expr with the timeunit to the interval? I want to implement a app or function like this I can't find the any method to convert the I just can find a way to resolve the issue by using the For example: I have a table like below, and want to convert the
Using the concat to get the
|
@liukun4515 there is the
Also casting strings to intervals handle units
Or creating a string via
|
I use this method concat to complete my requirements, but the performance may be not better. #6876 (comment) also provide the thoughts about support the cc @watfordkcf |
I have moved all the incomplete items and moved them to #8282 to help track what is remaining. Thanks everyone for the epic work here |
This is followed on the Proposal for Date/Time enhancement #3100
Please edit the list or comment bellow if you find something not listed here.
Date/Time/Timestamp Types & Casting
TIME
literal values #2883 - This is the initial work forTIME
literal (i.e. makeSELECT TIME '00:00:00';
work)TIME
literal values #2883float
arguments toto_timestamp
function #7868date_trunc
always returnsTimestamp(Nanosecond, None)
which might truncate ranges #6653date_trunc(null)
results in a panic #6701TimestampTz Date Types & Casting & Coercion
Cast(UTF-8 AS Timestamp)
apply local time zone? #3080Time With Time Zone
should raise error untilDataType::Time64
support tz #3715[+/-]hhmm
and[+/-]hh
as fixedoffset timezone format arrow-rs#2910date_bin('1 hour',...)
does not work butdate_bin(interval '1 hour', ...
does #4853try_cast_literal_to_type
doesn't respect timestamp precision #5507Intervals
See #5753
Arithmetic (including intervals)
SUM
AVG
,MIN
,MAX
onTime
columns. #3166Timestamp
to aDate32
fails #4644timestamp
- interval results inThe type of Timestamp(Nanosecond, Some("+00:00")) Minus Utf8 of binary physical should be same
#5650Duration
as the result oftimestamp - timestamp
rather thanInterval
#7068Functions
date_part
does't work fornow()
#3096to_timetamp*()
#686from_timestamp
byfrom_timestamp_opt
arrow-rs#2892extract <part>
on the value ofnow()
#3980current_date
Function #3981current_time
Function #3982extract
return types to decimal to align with postgres #3996date_part
return types to f64 #3997NANOSECOND
datafusion-sqlparser-rs#748date_bin
with 2 arguments (rather than requiring three) #5641to_unixtime
function #5568parquet/csv/json
9999
year results in overflow panic arrow-rs#982others
get
/show
timezone #3255The text was updated successfully, but these errors were encountered: