Skip to content

Commit

Permalink
add regression
Browse files Browse the repository at this point in the history
  • Loading branch information
feiniaofeiafei committed Dec 19, 2024
1 parent 013e989 commit 29e6ca9
Showing 1 changed file with 64 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,74 @@ suite("always_mono_func") {
sql """ select * from always_mono_func where to_monday(dt) >= "2019-01-01" """
contains("partitions=2/5 (p4,p5)")
}

// year
explain {
sql """ select * from always_mono_func where year(dt) >= 2019 """
contains("partitions=3/5 (p3,p4,p5)")
}
explain {
sql """select * from always_mono_func where year(dt) < 2019 and year(dt) > 2017"""
contains("partitions=2/5 (p2,p3)")
}
explain {
sql """select * from always_mono_func where year(dt) <2023"""
contains("partitions=5/5 (p1,p2,p3,p4,p5)")
}
// to_monday
explain {
sql """select * from always_mono_func where to_monday(dt) <'2019-01-01' """
contains("partitions=4/5 (p1,p2,p3,p4)")
}
explain {
sql """select * from always_mono_func where to_monday(dt) ='2019-01-01' """
contains("partitions=1/5 (p4)")
}
explain {
sql """select * from always_mono_func where to_monday(dt) >='2018-01-01' and to_monday(dt) <'2019-01-01' """
contains("partitions=3/5 (p2,p3,p4)")
}
// to_date
explain {
sql """select * from always_mono_func where to_date(dt) <'2019-02-01' """
contains("partitions=4/5 (p1,p2,p3,p4)")
}
explain {
sql """select * from always_mono_func where to_date(dt) <='2023-02-01' """
contains("partitions=5/5 (p1,p2,p3,p4,p5)")
}
explain {
sql """select * from always_mono_func where to_date(dt) is null """
contains("partitions=5/5 (p1,p2,p3,p4,p5)")
}
explain {
sql """select * from always_mono_func where to_date(dt) is not null """
contains("partitions=5/5 (p1,p2,p3,p4,p5)")
}
explain {
sql """select * from always_mono_func where to_date(dt) >='2018-01-01' and to_date(dt) <'2019-01-01' """
contains("partitions=2/5 (p2,p3)")
}
// last_day
explain {
sql """select * from always_mono_func where last_day(dt) <='2019-02-01' """
contains("partitions=4/5 (p1,p2,p3,p4)")
}
explain {
sql """select * from always_mono_func where last_day(dt) <='2023-02-01' """
contains("partitions=5/5 (p1,p2,p3,p4,p5)")
}
explain {
sql """select * from always_mono_func where last_day(dt) is null """
contains("partitions=1/5 (p1)")
}
explain {
sql """select * from always_mono_func where last_day(dt) is not null """
contains("partitions=5/5 (p1,p2,p3,p4,p5)")
}
explain {
sql """select * from always_mono_func where last_day(dt) >='2018-01-01' and last_day(dt) <'2019-01-01' """
contains("partitions=2/5 (p2,p3)")
}

explain {
sql """select * from always_mono_func where date_format(to_monday(dt), 'yyyyMMdd') >= "20190101" """
Expand Down

0 comments on commit 29e6ca9

Please sign in to comment.