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
[SPARK-29648][SQL][TESTS] Port limit.sql #26311
Conversation
-- Test null limit and offset. The planner would discard a simple null | ||
-- constant, so to ensure executor is exercised, do this: | ||
-- [SPARK-29650] Discard a NULL constant in LIMIT | ||
select * from int8_tbl limit (case when random() < 0.5 then bigint(null) end); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test build #112892 has finished for PR 26311 at commit
|
retest this please |
Test build #112898 has finished for PR 26311 at commit
|
Test build #112894 has finished for PR 26311 at commit
|
-- select sum(tenthous) as s1, sum(tenthous) + random()*0 as s2 | ||
-- from tenk1 group by thousand order by thousand limit 3; | ||
|
||
select sum(tenthous) as s1, sum(tenthous) + random()*0 as s2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I believe Apache Spark
behavior random()*0
== 0.0
is more natural, do we have a JIRA issue for this difference from PostgreSQL where random()*0
== 0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I missed your point and the result seems to be the same;
select sum(tenthous) as s1, sum(tenthous) + random()*0 as s2
from tenk1 group by thousand order by thousand limit 3;
s1 | s2
-------+-------
45000 | 45000
45010 | 45010
45020 | 45020
(3 rows)
Also, I tried below;
postgres=# select * from (values (1)) t(v) where random() * 0.0 = 0.0;
v
---
1
(1 row)
scala> sql("""select * from (values (1)) t(v) where random() * 0.0 = 0.0""").show()
+---+
| v|
+---+
| 1|
+---+
What's the difference here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generated result is not the same in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM (except one minor request to add a JIRA ID comment for the difference).
Then, merged to master! Thank you, @maropu ! |
What changes were proposed in this pull request?
This PR ports limit.sql from PostgreSQL regression tests https://github.com/postgres/postgres/blob/REL_12_STABLE/src/test/regress/sql/limit.sql
The expected results can be found in the link: https://github.com/postgres/postgres/blob/REL_12_STABLE/src/test/regress/expected/limit.out
Why are the changes needed?
To check behaviour differences between Spark and PostgreSQL
Does this PR introduce any user-facing change?
No
How was this patch tested?
Pass the Jenkins. And, Comparison with PgSQL results