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

[SPARK-29108][SQL][TESTS][FOLLOWUP] Comment out no use test case and add 'insert into' statement of window.sql (Part 2) #27439

Closed
wants to merge 5 commits into from

Conversation

beliefer
Copy link
Contributor

@beliefer beliefer commented Feb 3, 2020

What changes were proposed in this pull request?

When I running the window_part2.sql tests find it lack insert sql. Therefore, the output is empty.
I checked the postgresql and reference https://github.com/postgres/postgres/blob/master/src/test/regress/sql/window.sql
Although window_part1.sql and window_part3.sql exists the insert sql, I think should also add it into window_part2.sql.
Because only one case reference the table empsalary and it throws AnalysisException.

-- !query
select last(salary) over(order by salary range between 1000 preceding and 1000 following),
lag(salary) over(order by salary range between 1000 preceding and 1000 following),
salary from empsalary
-- !query schema
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Window Frame specifiedwindowframe(RangeFrame, -1000, 1000) must match the required frame specifiedwindowframe(RowFrame, -1, -1);

So we should do four work:

  1. comment out the only one case and create a new ticket.
  2. Add INSERT INTO empsalary.

Note: window_part4.sql not use the table empsalary.

Why are the changes needed?

Supplementary test data.

Does this PR introduce any user-facing change?

No

How was this patch tested?

New test case

@SparkQA
Copy link

SparkQA commented Feb 3, 2020

Test build #117756 has finished for PR 27439 at commit b792307.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@beliefer
Copy link
Contributor Author

beliefer commented Feb 4, 2020

cc @dongjoon-hyun @maropu

@HyukjinKwon
Copy link
Member

BTW, @beliefer, don't forget to update PR description and title accordingly.

@beliefer
Copy link
Contributor Author

beliefer commented Feb 5, 2020

BTW, @beliefer, don't forget to update PR description and title accordingly.

Thanks for your reminder.

@beliefer beliefer changed the title [SPARK-29108][SQL][TESTS][FOLLOWUP] Add insert sql to window.sql (Part 2) [SPARK-29108][SQL][TESTS][FOLLOWUP] Update coment to window.sql (Part 2) Feb 5, 2020
@beliefer beliefer changed the title [SPARK-29108][SQL][TESTS][FOLLOWUP] Update coment to window.sql (Part 2) [SPARK-29108][SQL][TESTS][FOLLOWUP] Comment out no use and insert into statement of window.sql (Part 2) Feb 5, 2020
@SparkQA
Copy link

SparkQA commented Feb 5, 2020

Test build #117876 has finished for PR 27439 at commit 50d713e.

  • This patch fails SparkR unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@maropu
Copy link
Member

maropu commented Feb 5, 2020

retest this please

@SparkQA
Copy link

SparkQA commented Feb 5, 2020

Test build #117908 has finished for PR 27439 at commit 5929571.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Feb 5, 2020

Test build #117883 has finished for PR 27439 at commit 5929571.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@beliefer
Copy link
Contributor Author

beliefer commented Feb 5, 2020

retest this please

@SparkQA
Copy link

SparkQA commented Feb 5, 2020

Test build #117921 has finished for PR 27439 at commit 5929571.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@beliefer
Copy link
Contributor Author

beliefer commented Feb 5, 2020

retest this please

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but I'm -1 for this change, @beliefer , @HyukjinKwon , and @HyukjinKwon .
If we start to support more queries in this file, we need to bring them back.
Let's not decide what is not required at this stage.

@SparkQA
Copy link

SparkQA commented Feb 5, 2020

Test build #117935 has finished for PR 27439 at commit 5929571.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

HyukjinKwon commented Feb 6, 2020

If we start to support more queries in this file, we need to bring them back.
Let's not decide what is not required at this stage.

@dongjoon-hyun, the flip side also works. For the time we don't support, we can save one INSERT and CREATE operation in test base until that point. I don't think keeping unused data or codes in test cases is right. We should bring it back only when it's used. (e.g., we should remove unused codes rather then keeping it just in case it's used in the future).

Just to be clear, is this inconsistent with other ported tests in PostgreSQL? If that's the case, let's just revert back to revive CREATE and INSERT - I don't mind just keeping it simple and consistent.; otherwise, I think we can just go ahead.

@dongjoon-hyun
Copy link
Member

@HyukjinKwon .
The same author (@beliefer ) are actively working this area.

@dongjoon-hyun
Copy link
Member

I'm expecting more PRs on master. However, for branch-3.0, I agree with you. You can optimize that from branch-3.0 because we will not backport new feature~

@HyukjinKwon
Copy link
Member

Thanks @dongjoon-hyun. @beliefer, do you plan to support these soon? If that's the case let's bring CREATE and INSERT back here.

@beliefer
Copy link
Contributor Author

beliefer commented Feb 6, 2020

Thanks @dongjoon-hyun. @beliefer, do you plan to support these soon? If that's the case let's bring CREATE and INSERT back here.

I think some feature will be supported, the other ones will not.

@HyukjinKwon
Copy link
Member

If you plan to create a PRs to support them in this file, let's just don't comment CREATE and INSERT out here.

@HyukjinKwon
Copy link
Member

LGTM otherwise. Sorry for a bit of back and forth @beliefer but mind updating PR description back as well?

@beliefer
Copy link
Contributor Author

beliefer commented Feb 6, 2020

LGTM otherwise. Sorry for a bit of back and forth @beliefer but mind updating PR description back as well?

OK.

@beliefer beliefer changed the title [SPARK-29108][SQL][TESTS][FOLLOWUP] Comment out no use and insert into statement of window.sql (Part 2) [SPARK-29108][SQL][TESTS][FOLLOWUP] Comment out no use test case and add 'insert into' statement of window.sql (Part 2) Feb 6, 2020
@SparkQA
Copy link

SparkQA commented Feb 6, 2020

Test build #117959 has finished for PR 27439 at commit 4e27e98.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

HyukjinKwon commented Feb 6, 2020

Merged to master, and branch-3.0 to match it with JIRA's

HyukjinKwon pushed a commit that referenced this pull request Feb 6, 2020
…add 'insert into' statement of window.sql (Part 2)

### What changes were proposed in this pull request?
When I running the `window_part2.sql` tests find it lack insert sql. Therefore, the output is empty.
I checked the postgresql and reference https://github.com/postgres/postgres/blob/master/src/test/regress/sql/window.sql
Although `window_part1.sql` and `window_part3.sql` exists the insert sql, I think should also add it into `window_part2.sql`.
Because only one case reference the table `empsalary` and it throws `AnalysisException`.
```
-- !query
select last(salary) over(order by salary range between 1000 preceding and 1000 following),
lag(salary) over(order by salary range between 1000 preceding and 1000 following),
salary from empsalary
-- !query schema
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Window Frame specifiedwindowframe(RangeFrame, -1000, 1000) must match the required frame specifiedwindowframe(RowFrame, -1, -1);
```

So we should do four work:
1. comment out the only one case and create a new ticket.
2. Add `INSERT INTO empsalary`.

Note: window_part4.sql not use the table `empsalary`.

### Why are the changes needed?
Supplementary test data.

### Does this PR introduce any user-facing change?
No

### How was this patch tested?
New test case

Closes #27439 from beliefer/add-insert-to-window.

Authored-by: beliefer <beliefer@163.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
@beliefer
Copy link
Contributor Author

beliefer commented Feb 6, 2020

@HyukjinKwon @dongjoon-hyun Thanks for your work.

@SparkQA
Copy link

SparkQA commented Feb 6, 2020

Test build #117963 has finished for PR 27439 at commit 025c328.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

sjincho pushed a commit to sjincho/spark that referenced this pull request Apr 15, 2020
…add 'insert into' statement of window.sql (Part 2)

### What changes were proposed in this pull request?
When I running the `window_part2.sql` tests find it lack insert sql. Therefore, the output is empty.
I checked the postgresql and reference https://github.com/postgres/postgres/blob/master/src/test/regress/sql/window.sql
Although `window_part1.sql` and `window_part3.sql` exists the insert sql, I think should also add it into `window_part2.sql`.
Because only one case reference the table `empsalary` and it throws `AnalysisException`.
```
-- !query
select last(salary) over(order by salary range between 1000 preceding and 1000 following),
lag(salary) over(order by salary range between 1000 preceding and 1000 following),
salary from empsalary
-- !query schema
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Window Frame specifiedwindowframe(RangeFrame, -1000, 1000) must match the required frame specifiedwindowframe(RowFrame, -1, -1);
```

So we should do four work:
1. comment out the only one case and create a new ticket.
2. Add `INSERT INTO empsalary`.

Note: window_part4.sql not use the table `empsalary`.

### Why are the changes needed?
Supplementary test data.

### Does this PR introduce any user-facing change?
No

### How was this patch tested?
New test case

Closes apache#27439 from beliefer/add-insert-to-window.

Authored-by: beliefer <beliefer@163.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
@beliefer beliefer deleted the add-insert-to-window branch May 12, 2020 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants