Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change TimeAdd/Sub subquery tests to use min/max #8405

Merged
merged 1 commit into from
May 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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