Uh oh!
There was an error while loading. Please reload this page.
ARROW-11055: [Rust] [DataFusion] Support date_trunc function - #9040
ARROW-11055: [Rust] [DataFusion] Support date_trunc function#9040paveltiunov wants to merge 7 commits into
Conversation
jhorstmann
commented
Dec 30, 2020
Cool! A few small comments:
|
alamb
commented
Dec 31, 2020
The full set of Rust CI tests did not run on this PR :( Can you please rebase this PR against apache/master to pick up the changes in #9056 so that they do? I apologize for the inconvenience. |
paveltiunov
commented
Jan 2, 2021
Hey @jhorstmann ! Thanks for the review!
I've swapped arguments order. It's 50/50 among databases however agree Postgres order is a little bit more common.
I've added some tests at the beginning of the year. Is it something you were looking for?
Yep. Agree it's out of scope for this PR. @alamb I rebased it against the latest master. |
Codecov Report
@@ Coverage Diff @@## master #9040 +/- ##
========================================
Coverage 82.56% 82.56% ========================================
Files 203 203 Lines 50042 50236 +194 ========================================
+ Hits 41315 41476 +161 - Misses 8727 8760 +33
Continue to review full report at Codecov.
|
| if array.is_null(i) { | ||
| Ok(0_i64) | ||
| } else { | ||
| let date_time = match granularity_array.value(i) { |
There was a problem hiding this comment.
This list seems consistent with https://www.postgresql.org/docs/9.1/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC 👍 I think it is fine that we don't yeet support some of the more esoteric stuff (like milleniumm')
| string_builder.append_value("week")?; | ||
| ts_builder.append_value("2020-01-01T13:42:29.190855Z")?; | ||
| truncated_builder.append_value("2019-12-30T00:00:00.000000Z")?; |
| Int64(i64), | ||
| Utf8(Box<String>), | ||
| TimeMicrosecond(i64), | ||
| TimeNanosecond(i64), |
alamb
left a comment
There was a problem hiding this comment.
Thanks @paveltiunov -- this looks like a great initial addition.
The only thing I think might be worthwhile (as a follow on PR) would be a sql level test in https://github.com/apache/arrow/blob/master/rust/datafusion/tests/sql.rs (to ensure everything was hooked up correctly)
Again, thanks again
paveltiunov
commented
Jan 2, 2021
@alamb Gotcha. I actually added SQL test however it went to |
date_truncSQL function implementation and GROUP BY timestamp support.