-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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-29107][SQL][TESTS] Port window.sql (Part 1) #25816
Conversation
ok to test |
Test build #110785 has started for PR 25816 at commit |
test this please |
Test build #110801 has finished for PR 25816 at commit
|
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.
LGTM except for some minor comments. @wangyum @HyukjinKwon
-- Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group | ||
-- | ||
-- Window Functions Testing | ||
-- https://github.com/postgres/postgres/blob/REL_12_BETA3/src/test/regress/sql/window.sql |
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.
Can you add line numbers?:
-- https://github.com/postgres/postgres/blob/REL_12_BETA2/src/test/regress/sql/aggregates.sql#L1-L143 |
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.
Unfortunately,REL_12_BETA4
is released.
https://github.com/postgres/postgres/blob/REL_12_BETA4/src/test/regress/sql/window.sql
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.
I can update to match Beta4, but:
- If the PgSQL version is that relevant, then we will add a new JIRA for every new PgSQL release for every .sql migration (i.e: strings.sql, union.sql, date.sql, aggregates.sql, etc). But we didn't.
- If the PgSQL is not that relevant, then there's no need to change PRs to match the latest release candidate version (although it matches a stable version).
What you think?
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.
Have you checked the last discussion? #24850 (comment)
I think we don't need to stick to the single snapshot, so its ok to update it to REL_12_BETA4
in this port. Actually, no difference between BETA2
and BETA4
in window.sql
?
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.
No, I didn't get noticed that you guys were already discussing about updating other tests.
I checked last week and there are some major differences between BETA2 and BETA4 for window.sql
, I just can't remember if lines L1-L319 are impacted by them. So, it's ok to keep at REL2 or should I updated to REL3?
SELECT sum(salary) OVER w, rank() OVER w FROM empsalary WINDOW w AS (PARTITION BY depname ORDER BY salary DESC); | ||
|
||
-- strict aggs | ||
-- Temporarily turns off the ANSI mode because of compatibility issues between keywords |
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.
Can you describe which keyword?
FROM tenk1 WHERE unique1 < 10; | ||
|
||
-- [SPARK-28428] Spark `exclude` always expecting `()` | ||
SELECT sum(unique1) over (w range between current row and unbounded following), |
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.
Why didn't you comment out this statement? You did the other statements, though?
ping @DylanGuedes to update |
@HyukjinKwon I updated with the changes suggested, but still not clear: should I update to REL4? |
Test build #111564 has finished for PR 25816 at commit
|
Yea, we should update it. |
Test build #111567 has finished for PR 25816 at commit
|
3 9 25 9 | ||
|
||
|
||
-- !query 43 |
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.
This test seems failing when it's ran via the thrift server. Can you check the cause and exclude this in the test? cc @wangyum
Test build #111571 has finished for PR 25816 at commit
|
-- SELECT four, ten/4 as two, | ||
-- sum(ten/4) over (partition by four order by ten/4 range between unbounded preceding and current row), | ||
-- last(ten/4) over (partition by four order by ten/4 range between unbounded preceding and current row) | ||
-- FROM (select distinct ten, four from tenk1) ss; |
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.
Ur, did you regenerate the golden files after this removal?
Test build #111575 has finished for PR 25816 at commit
|
Test build #111661 has finished for PR 25816 at commit
|
Hmm. Still
@DylanGuedes . Could you post the query result in both |
Signed-off-by: DylanGuedes <djmgguedes@gmail.com>
Signed-off-by: DylanGuedes <djmgguedes@gmail.com>
Signed-off-by: DylanGuedes <djmgguedes@gmail.com>
Signed-off-by: DylanGuedes <djmgguedes@gmail.com>
Signed-off-by: DylanGuedes <djmgguedes@gmail.com>
Signed-off-by: DylanGuedes <djmgguedes@gmail.com>
It works fine locally. And, to be fair, I have no idea why this is not working: in my older PR It also always passed. I'll remote both queries that are failing. |
Signed-off-by: DylanGuedes <djmgguedes@gmail.com>
178bbfe
to
3a5825c
Compare
Test build #111862 has finished for PR 25816 at commit
|
Retest this please. |
last(ten) over (partition by four order by ten range between unbounded preceding and unbounded following) | ||
FROM (select distinct ten, four from tenk1) ss; | ||
|
||
-- Failing on thrift server |
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.
We need a JIRA issue if we are not going to cover this query.
-- last(ten/4) over (partition by four order by ten/4 range between unbounded preceding and current row) | ||
-- FROM (select distinct ten, four from tenk1) ss; | ||
|
||
-- Failing on thrift server |
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.
We need a JIRA issue if we are not going to cover this query, too.
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.
I know this consumed your time your time, @DylanGuedes .
I believe the followings are the final pieces.
- A new JIRA for the newly excluded query 1: [SPARK-29107][SQL][TESTS] Port window.sql (Part 1) #25816 (comment)
- A new JIRA for the newly excluded query 2: [SPARK-29107][SQL][TESTS] Port window.sql (Part 1) #25816 (comment)
- Fix the PR inconsistency. (1) PR description has a link to
REL_12_BETA2
. (2) Code has a link toREL_12_BETA4
. (3) The latest one is alreadyREL_12_STABLE
. The best option is to sync withREL_12_STABLE
. Could you check the diff? I believe there is no diff on this file. Then, we can useREL_12_STABLE
.
cc @maropu , too.
I checked the diff. There is additional addition from line 1257, but that is irrelevant to this PR because this PR is only for line 1 to line 319.
Please simply update the link with |
Test build #111988 has finished for PR 25816 at commit
|
Signed-off-by: DylanGuedes <djmgguedes@gmail.com>
Test build #111995 has finished for PR 25816 at commit
|
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. Thank you, @DylanGuedes , @maropu , @HyukjinKwon !
Merged to master for this.
I have created a followup to correct the file location: #26116 |
Oops. Yes. We moved the location and this PR is very old. |
I missed the location, @DylanGuedes . And, thank you again, @gengliangwang ! |
@dongjoon-hyun I made a new PR with the new location. |
What changes were proposed in this pull request?
This PR ports window.sql from PostgreSQL regression tests https://github.com/postgres/postgres/blob/REL_12_BETA2/src/test/regress/sql/window.sql from lines 1~319
The expected results can be found in the link: https://github.com/postgres/postgres/blob/REL_12_BETA2/src/test/regress/expected/window.out
How was this patch tested?
Pass the Jenkins.
Why are the changes needed?
To ensure compatibility with PGSQL
Does this PR introduce any user-facing change?
No
How was this patch tested?
Comparison with PgSQL results.