Skip to content

Commit 3940e36

Browse files
Support for non-u64 types for Window Bound (apache#3916)
* Support for non u64 values inside window frames * timestamp handling is added * get_rank removed * Tidy up datetime arithmetic, get rid of unwraps * new test for validity, during window frame creation is added * window_bound is changed to Expr (#6) * give fixed commit hash as dependency * remove locked flag * Simplify some frame bound conversion functions * Make things work the new sqlparser * Upgrade sqlparser version to 0.26 * Minor changes * type coercion for window frames moved to the optimizer. Co-authored-by: Mehmet Ozan Kabak <ozankabak@gmail.com>
1 parent 4e29835 commit 3940e36

File tree

29 files changed

+926
-695
lines changed

29 files changed

+926
-695
lines changed

datafusion-cli/Cargo.lock

Lines changed: 102 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion/common/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ pyarrow = ["pyo3", "arrow/pyarrow"]
4141
[dependencies]
4242
apache-avro = { version = "0.14", default-features = false, features = ["snappy"], optional = true }
4343
arrow = { version = "25.0.0", default-features = false }
44+
chrono = { version = "0.4", default-features = false }
4445
cranelift-module = { version = "0.89.0", optional = true }
4546
object_store = { version = "0.5.0", default-features = false, optional = true }
4647
ordered-float = "3.0"
4748
parquet = { version = "25.0.0", default-features = false, optional = true }
4849
pyo3 = { version = "0.17.1", optional = true }
49-
sqlparser = "0.25"
50+
sqlparser = "0.26"

datafusion/physical-expr/src/expressions/delta.rs renamed to datafusion/common/src/delta.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use chrono::Datelike;
2727

2828
/// Returns true if the year is a leap-year, as naively defined in the Gregorian calendar.
2929
#[inline]
30-
pub(crate) fn is_leap_year(year: i32) -> bool {
30+
fn is_leap_year(year: i32) -> bool {
3131
year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)
3232
}
3333

@@ -49,7 +49,7 @@ fn normalise_day(year: i32, month: u32, day: u32) -> u32 {
4949

5050
/// Shift a date by the given number of months.
5151
/// Ambiguous month-ends are shifted backwards as necessary.
52-
pub(crate) fn shift_months<D: Datelike>(date: D, months: i32) -> D {
52+
pub fn shift_months<D: Datelike>(date: D, months: i32) -> D {
5353
let mut year = date.year() + (date.month() as i32 + months) / 12;
5454
let mut month = (date.month() as i32 + months) % 12;
5555
let mut day = date.day();

0 commit comments

Comments
 (0)