Skip to content

[SPARK-31753][SQL][DOCS] Add missing keywords in the SQL docs - #29056

Closed
GuoPhilipse wants to merge 44 commits into
apache:masterfrom
GuoPhilipse:add-missing-keywords
Closed

[SPARK-31753][SQL][DOCS] Add missing keywords in the SQL docs#29056
GuoPhilipse wants to merge 44 commits into
apache:masterfrom
GuoPhilipse:add-missing-keywords

Conversation

@GuoPhilipse

@GuoPhilipseGuoPhilipse commented Jul 9, 2020

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

update sql-ref docs, the following key words will be added in this PR.

CASE/ELSE
WHEN/THEN
MAP KEYS TERMINATED BY
NULL DEFINED AS
LINES TERMINATED BY
ESCAPED BY
COLLECTION ITEMS TERMINATED BY
PIVOT
LATERAL VIEW OUTER?
ROW FORMAT SERDE
ROW FORMAT DELIMITED
FIELDS TERMINATED BY
IGNORE NULLS
FIRST
LAST

Why are the changes needed?

let more users know the sql key words usage

Does this PR introduce any user-facing change?

image
image
image
image

How was this patch tested?

No

@GuoPhilipseGuoPhilipse changed the title [SPARK-31753][SQL][DOCS]Add missing keywords[SPARK-31753][SQL][DOCS][WIP]Add missing keywordsJul 9, 2020
Comment threaddocs/sql-ref-syntax-qry-select-case.md Outdated
@maropu

Copy link
Copy Markdown
Member

cc: @huaxingao

@maropu

Copy link
Copy Markdown
Member

Thanks for the work, @GuoPhilipse ! Please list up the keywords in the PR description that this PR will add.

@GuoPhilipse

Copy link
Copy Markdown
MemberAuthor

Thanks for the work, @GuoPhilipse ! Please list up the keywords in the PR description that this PR will add.
sure, will add it later.

Comment threaddocs/sql-ref-syntax-qry-select-case.md Outdated
@maropu

Copy link
Copy Markdown
Member

btw, could you update the PR description, too? e.g., remove FROM

@GuoPhilipse

Copy link
Copy Markdown
MemberAuthor

btw, could you update the PR description, too? e.g., remove FROM

sure ,wil update soon.

Comment threaddocs/sql-ref-syntax-ddl-create-table-hiveformat.md Outdated
Comment threaddocs/sql-ref-syntax-ddl-create-table-hiveformat.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-case.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-case.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-case.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-groupby.md Outdated
@huaxingao

Copy link
Copy Markdown
Contributor

also edit the menu-sql.yaml to update the sidebar menu?

Comment threaddocs/sql-ref-syntax-qry-select-lateral-view.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-pivot.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-pivot.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-pivot.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-pivot.md Outdated
Comment threaddocs/sql-ref-syntax-ddl-create-table-hiveformat.md Outdated
Comment threaddocs/sql-ref-syntax-ddl-create-table-hiveformat.md Outdated
Comment threaddocs/sql-ref-syntax-ddl-create-table-hiveformat.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-case.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-case.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-case.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-pivot.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-pivot.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-pivot.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select.md Outdated
@huaxingao

Copy link
Copy Markdown
Contributor

@GuoPhilipse Sorry I have more nitpicks on grammar. I know this is very tedious. I went through all these when I did the doc PRs. Thanks a lot for doing this!
I have no more comments :)

@GuoPhilipse

Copy link
Copy Markdown
MemberAuthor

Thanks @maropu@huaxingao, really appreciated by your earnest and carefull review. I have leant a lot from this PR. Thanks for your time.
BTW @maropu do you have any new comments?

Comment threaddocs/sql-ref-syntax-qry-select.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-pivot.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-pivot.md Outdated

```sql
PIVOT ( { aggregate_expression [ AS aggregate_expression_alias ] } [ , ... ]
FOR column_list IN ( expression_list ) )

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment threaddocs/sql-ref-syntax-qry-select-pivot.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-lateral-view.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-case.md Outdated
Comment threaddocs/sql-ref-syntax-ddl-create-table-hiveformat.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-groupby.md Outdated
Comment threaddocs/sql-ref-syntax-qry-select-groupby.md Outdated
Specifies an aggregate function name (MIN, MAX, COUNT, SUM, AVG, etc.).
Note that `FIRST` and `LAST` have an optional `IGNORE NULLS` clause; when the option specified,
it will returns the first or last value that is not null (or null if all values are null).
**Syntax:** `[ FIRST | LAST ] ( [ distinct ] expression [ IGNORE NULLS ] ) [ FILTER ( WHERE boolean_expression ) ]`

@maropumaropuJul 21, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We still need **Syntax:** [ FIRST | LAST ] ( [ distinct ] expression [ IGNORE NULLS ] ) [ FILTER ( WHERE boolean_expression ) ]? It looks verbose to me though.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

now have have aggregate functions above and examples in the end, looks enough,let me move it

@maropu

Copy link
Copy Markdown
Member

Thanks for the work, @GuoPhilipse ! Looks ok except for one comment. Could you check for the final sign-off? @srowen@dongjoon-hyun@huaxingao@dilipbiswal Note: since all the SQL syntaxes in this update has been implemented in 3.0.0, we can merge this into branch-3.0.

@maropu

Copy link
Copy Markdown
Member

@GuoPhilipse Could you generate HTML docs and check if all things are okay for this udpate?
In most PRs for doc updates, the screenshots of HTML docs are often attached in the PR description, e.g., #28672

@maropu

Copy link
Copy Markdown
Member

@GuoPhilipse Btw, we still have more document improvement issues;

  1. Improve the structure of auto-generated built-in function pages in SQL references, https://issues.apache.org/jira/browse/SPARK-31513
  2. Add group tags (ExpressionDescription) to all the built-in functions: (Related JIRA: https://issues.apache.org/jira/browse/SPARK-31429)

As you know, we currently have the two duplicated document pages for built-in functions;

If we finish adding the tags, we might be able to remove the former page. If you're interested in more contributions, feel free to take them over. Its very helpful. cc: @HyukjinKwon@huaxingao

@GuoPhilipse

Copy link
Copy Markdown
MemberAuthor

@GuoPhilipse Btw, we still have more document improvement issues;

  1. Improve the structure of auto-generated built-in function pages in SQL references, https://issues.apache.org/jira/browse/SPARK-31513
  2. Add group tags (ExpressionDescription) to all the built-in functions: (Related JIRA: https://issues.apache.org/jira/browse/SPARK-31429)

As you know, we currently have the two duplicated document pages for built-in functions;

If we finish adding the tags, we might be able to remove the former page. If you're interested in more contributions, feel free to take them over. Its very helpful. cc: @HyukjinKwon@huaxingao

Thanks @maropu , will glad to take more look on this.

@GuoPhilipse

Copy link
Copy Markdown
MemberAuthor

@GuoPhilipse Could you generate HTML docs and check if all things are okay for this udpate?
In most PRs for doc updates, the screenshots of HTML docs are often attached in the PR description, e.g., #28672
will append later

@maropu

Copy link
Copy Markdown
Member

ok to test

@maropu

Copy link
Copy Markdown
Member

Note: If nobody has comments, this is just a doc improvement, so I will merge in a few days.

@SparkQA

Copy link
Copy Markdown

Test build #126368 has finished for PR 29056 at commit ffa0603.

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

maropu pushed a commit that referenced this pull request Jul 28, 2020
### What changes were proposed in this pull request?
update sql-ref docs, the following key words will be added in this PR.
CASE/ELSE
WHEN/THEN
MAP KEYS TERMINATED BY
NULL DEFINED AS
LINES TERMINATED BY
ESCAPED BY
COLLECTION ITEMS TERMINATED BY
PIVOT
LATERAL VIEW OUTER?
ROW FORMAT SERDE
ROW FORMAT DELIMITED
FIELDS TERMINATED BY
IGNORE NULLS
FIRST
LAST
### Why are the changes needed?
let more users know the sql key words usage
### Does this PR introduce _any_ user-facing change?
![image](https://user-images.githubusercontent.com/46367746/88148830-c6dc1f80-cc31-11ea-81ea-13bc9dc34550.png)
![image](https://user-images.githubusercontent.com/46367746/88148968-fb4fdb80-cc31-11ea-8649-e8297cf5813e.png)
![image](https://user-images.githubusercontent.com/46367746/88149000-073b9d80-cc32-11ea-9aa4-f914ecd72663.png)
![image](https://user-images.githubusercontent.com/46367746/88149021-0f93d880-cc32-11ea-86ed-7db8672b5aac.png)
### How was this patch tested?
No
Closes#29056 from GuoPhilipse/add-missing-keywords.
Lead-authored-by: GuoPhilipse <guofei_ok@126.com>
Co-authored-by: GuoPhilipse <46367746+GuoPhilipse@users.noreply.github.com>
Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org>
(cherry picked from commit 8de4333)
Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org>
@maropu

Copy link
Copy Markdown
Member

Merged to master/branch-3.0. Thanks, @GuoPhilipse !

@@ -36,6 +36,14 @@ CREATE [ EXTERNAL ] TABLE [ IF NOT EXISTS ] table_identifier
[ LOCATION path ]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The bucketSpec is still missing in CREATE HIVE FORMAT table, right?

 [ CLUSTERED BY ( col_name3, col_name4, ... ) [ SORTED BY ( col_name [ ASC | DESC ], ... ) ] INTO num_buckets BUCKETS ]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Any reason we did not add it? @huaxingao@GuoPhilipse

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry, we missed that.
@GuoPhilipse Could you please have a follow-up to add bucketSpec? Thanks!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Yes, we need it, will add it soon.

@GuoPhilipse
GuoPhilipse deleted the add-missing-keywords branch September 27, 2020 11:46
Sign up for freeto 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.

7 participants

@GuoPhilipse@maropu@huaxingao@SparkQA@srowen@dongjoon-hyun@gatorsmile