Skip to content

[SPARK-31390][SQL][DOCS] Document Window Function #28157

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

Closed
wants to merge 5 commits into from

Conversation

huaxingao
Copy link
Contributor

@huaxingao huaxingao commented Apr 9, 2020

What changes were proposed in this pull request?

Document Window Function

Why are the changes needed?

To make SQL reference complete

Does this PR introduce any user-facing change?

Yes

Screen Shot 2020-04-12 at 8 33 49 PM

Screen Shot 2020-04-08 at 6 33 18 PM

Screen Shot 2020-04-08 at 6 33 52 PM

Screen Shot 2020-04-08 at 6 34 17 PM

Screen Shot 2020-04-08 at 6 34 31 PM

How was this patch tested?

Manually build and check

@huaxingao
Copy link
Contributor Author

cc @maropu Could you please review? Thanks a lot!

@SparkQA
Copy link

SparkQA commented Apr 9, 2020

Test build #120990 has finished for PR 28157 at commit 19c87ee.

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

// |Chloe|Engineering| 23000|
// +-----+-----------+------+

val windowSpec = Window.partitionBy("dept").orderBy("salary")
Copy link
Member

Choose a reason for hiding this comment

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

We don't need to write this document in the same SQL way with #28120?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will make it consistent with Kevin's PR. I really want to keep the function tables simple, though, because the user can refer to API docs for details. Are you OK with the functions tables, or you want me to change those too?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see. I personally think its better to follow the SQL format here, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

We are talking about this table, right? :)

Copy link
Member

Choose a reason for hiding this comment

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

oh, my bad. Yea, the consistent format is better, so I personally think its better to follow the Kevin's format.

Copy link
Member

@maropu maropu Apr 9, 2020

Choose a reason for hiding this comment

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

I really want to keep the function tables simple, though, because the user can refer to API docs for details.

Probably, users who wanna see simpler built-in function docs can check
https://spark.apache.org/docs/3.0.0-preview/api/sql/index.html. So, I think it is better to write this page as detailed as possible.

* [Aggregate Functions](sql-ref-functions-builtin-aggregate.html)
* [Array Functions](sql-ref-functions-builtin-array.html)
* [Date and Time Functions](sql-ref-functions-builtin-date-time.html)
Spark SQL defines built-in functions to use, a complete list of which can be found [here](api/sql/). Among them, Spark SQL has several special categories of built-in functions: [Aggregate Functions](sql-ref-functions-builtin-aggregate.html) to operate on a group of rows and return a single value, and [Window Functions](sql-ref-functions-builtin-window.html) to operate on a group of rows but return values for each row in the group.
Copy link
Member

Choose a reason for hiding this comment

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

nit: add a blank line here.

@SparkQA
Copy link

SparkQA commented Apr 10, 2020

Test build #121060 has finished for PR 28157 at commit 36cbcb7.

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

@huaxingao
Copy link
Contributor Author

Discussed with @HyukjinKwon offline. I will remove the Types of Window Function section because it is mainly listing the function names and descriptions, which should be automatically documented by ExpressionDescription, we don't want to duplicate the work here. Thanks Hyukjin!

@huaxingao
Copy link
Contributor Author

Also cc @gatorsmile

@SparkQA
Copy link

SparkQA commented Apr 13, 2020

Test build #121164 has finished for PR 28157 at commit 5a4c79c.

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

@SparkQA
Copy link

SparkQA commented Apr 13, 2020

Test build #121163 has finished for PR 28157 at commit d05cb5f.

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

@huaxingao
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Apr 13, 2020

Test build #121180 has finished for PR 28157 at commit 5a4c79c.

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

@huaxingao huaxingao closed this Apr 15, 2020
@maropu
Copy link
Member

maropu commented Apr 15, 2020

@huaxingao I think its better to say something about why this closed for the others reviewers.

@maropu
Copy link
Member

maropu commented Apr 15, 2020

We've opened the new PR for this jira based on the discussion: #28203 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants