Repository navigation
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
(This section helps Arrow developers understand the context and why for this feature, in addition to the what)
This is a follow up from the discussion in this PR:
apache/arrow#10005
Namely for first class casting to non nanosecond timestamp types and functions supporting those.
There was also a email thread on the list about this.
Describe the solution you'd like
A clear and concise description of what you want to happen.
The proposal is as follows:
- A function
to_timestamp_millis()which converts from the following types:- String - converts timestamp strings, just like
to_timestamp()except to a TimestampArray with Milliseconds - Other TimestampArray's - casts them with truncation as necessary to Millisecond resolution
- Int64 - assumes the values are already millisecond resolution and just does a cast to TimestampArray with Millis
- String - converts timestamp strings, just like
- Similar functions
to_timestamp_micros()andto_timestamp_seconds()
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
We considered in the above threads to reuse datetime_trunc() for this purpose.
The issues with using datetime_trunc() are as follows:
- Datetime trunc is primarily used for truncating an existing timestamp to say millis, seconds, hours, minutes, etc., and not for changing the type of the date time.
- Without modifying the existing signature it would not be possible to disambiguate between, for example, using
datetime_truncto truncate to seconds but keeping nanosecond resolution, or actually casting to Timestamp type with Seconds resolution - Additional infrastructure is needed in the function evaluation code to support evaluating text/constant arguments in function type output determination, right now the output type is determined based on the input types alone
Additional context
Add any other context or screenshots about the feature request here.
Activity
velvia commentedon May 17, 2021
/cc @alamb
alamb commentedon May 17, 2021
Mailing list link: https://lists.apache.org/thread.html/r8df8e698e5d408f8584ada8da7ed59b5357c96895400d80d016f9e6c%40%3Cdev.arrow.apache.org%3E
msathis commentedon May 21, 2021
I can pick this if no one else is working on 👍
velvia commentedon May 21, 2021
msathis commentedon May 22, 2021
@velvia It makes sense for you to do it since you're already familiar with it. 👍 💯
velvia commentedon Jun 10, 2021
Quick update: starting on the implementation, hopefully should be done in a few days
fix: SortMergeJoin with unsupported key type should fall back to Spark (
Add benchmark derived from TPC-H (apache#355)