Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
924060929 committed Nov 28, 2024
1 parent 5ddf50b commit 57c1039
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -720,4 +720,17 @@ suite("test_date_function") {


qt_sql_time_value """ select cast(4562632 as time), hour(cast(4562632 as time)) , minute(cast(4562632 as time)) , second(cast(4562632 as time)); """

def test_simplify = {
sql "drop table if exists test_int_date"
sql "create table test_int_date(dt int) distributed by hash(dt) properties('replication_num'='1');"
test {
sql "select months_add(dt, 1) = date '2024-02-29' from (select date '2024-01-31' as dt)a"
result([[true]])
}
test {
sql "select years_add(dt, 1) = date '2025-02-28' from (select date '2024-02-29' as dt)a"
result([[true]])
}
}()
}
Original file line number Diff line number Diff line change
Expand Up @@ -818,19 +818,4 @@ suite("test_date_function") {
qt_sql_varchar1 """ select dt, fmt, unix_timestamp(dt, fmt) as k1 from date_varchar order by k1,dt,fmt; """
qt_sql_varchar1 """ select dt, unix_timestamp(dt, "%Y-%m-%d") as k1 from date_varchar order by k1,dt,fmt; """
qt_sql_varchar1 """ select fmt, unix_timestamp("1990-12-12", fmt) as k1 from date_varchar order by k1,dt,fmt; """



def test_simplify = {
sql "drop table if exists test_int_date"
sql "create table test_int_date(dt int) distributed by hash(dt) properties('replication_num'='1');"
test {
sql "select months_add(dt, 1) = date '2024-02-29' from (select date '2024-01-31' as dt)a"
result([[true]])
}
test {
sql "select years_add(dt, 1) = date '2025-02-28' from (select date '2024-02-29' as dt)a"
result([[true]])
}
}()
}

0 comments on commit 57c1039

Please sign in to comment.