Skip to content

Commit

Permalink
Change TimeAdd/Sub subquery tests to use min/max (NVIDIA#8405)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Graves <[email protected]>
  • Loading branch information
tgravescs authored May 26, 2023
1 parent d9a113e commit 4493753
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions integration_tests/src/main/python/date_time_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_timeadd_from_subquery(data_gen):
def fun(spark):
df = unary_op_df(spark, TimestampGen(start=datetime(5, 1, 1, tzinfo=timezone.utc), end=datetime(15, 1, 1, tzinfo=timezone.utc)), seed=1)
df.createOrReplaceTempView("testTime")
spark.sql("select a, ((select last(a) from testTime) + interval 1 day) as datePlus from testTime").createOrReplaceTempView("testTime2")
spark.sql("select a, ((select max(a) from testTime) + interval 1 day) as datePlus from testTime").createOrReplaceTempView("testTime2")
return spark.sql("select * from testTime2 where datePlus > current_timestamp")

assert_gpu_and_cpu_are_equal_collect(fun)
Expand All @@ -68,7 +68,7 @@ def test_timesub_from_subquery(data_gen):
def fun(spark):
df = unary_op_df(spark, TimestampGen(start=datetime(5, 1, 1, tzinfo=timezone.utc), end=datetime(15, 1, 1, tzinfo=timezone.utc)), seed=1)
df.createOrReplaceTempView("testTime")
spark.sql("select a, ((select last(a) from testTime) - interval 1 day) as dateMinus from testTime").createOrReplaceTempView("testTime2")
spark.sql("select a, ((select min(a) from testTime) - interval 1 day) as dateMinus from testTime").createOrReplaceTempView("testTime2")
return spark.sql("select * from testTime2 where dateMinus < current_timestamp")

assert_gpu_and_cpu_are_equal_collect(fun)
Expand Down

0 comments on commit 4493753

Please sign in to comment.