-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-50309][DOCS] Document SQL Pipe Syntax
#48852
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
Conversation
|
cc @cloud-fan @gengliangwang here is documentation support for the new SQL pipe syntax, which is nearly completed. |
|
@dtenedor The doc looks good to me overall. |
|
@gengliangwang thanks for your review! I updated the docs with more examples and information per recommendation, please take another look. |
docs/sql-pipe-syntax.md
Outdated
| #### LIMIT | ||
|
|
||
| ```sql | ||
| |> LIMIT <n> [OFFSET <m>] |
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.
is OFFSET m LIMIT n allowed?
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.
and OFFSET only?
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.
@cloud-fan I checked, and OFFSET is allowed without LIMIT, and vice versa. But if both are present, LIMIT must come before OFFSET. Updated this part accordingly.
cloud-fan
left a comment
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.
nice doc!
gengliangwang
left a comment
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.
Nice
SQL Pipe Syntax
dongjoon-hyun
left a comment
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.
|
Thanks, merging to master |
…x.md` ### What changes were proposed in this pull request? This PR aims to fix invalid `CREATE TABLE` syntax in `sql-pipe-syntax.md`. It seems that we missed during documentation. It causes `ParseException: Operation not allowed` . - #48852 ### Why are the changes needed? The current documentation is here. - https://apache.github.io/spark/sql-pipe-syntax.html#from-or-table **BEFORE** ``` spark-sql (default)> CREATE TABLE t(col INT) AS VALUES (0), (1); Operation not allowed: Schema may not be specified in a Create Table As Select (CTAS) statement. == SQL (line 1, position 1) == CREATE TABLE t(col INT) AS VALUES (0), (1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` **AFTER** ``` spark-sql (default)> CREATE TABLE t AS VALUES (0), (1); Time taken: 0.142 seconds spark-sql (default)> TABLE t; 1 0 Time taken: 0.287 seconds, Fetched 2 row(s) ``` ### Does this PR introduce _any_ user-facing change? No, this is a documentation-only change of the unreleased SQL Pipe syntax. ### How was this patch tested? Manual review. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #49096 from dongjoon-hyun/SPARK-50512. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
What changes were proposed in this pull request?
This PR adds documentation for SQL pipe syntax.
Why are the changes needed?
It provides a reference table of available operators and describes how the syntax works in each of the supported circumstances.
Does this PR introduce any user-facing change?
No, this is a documentation-only change.
How was this patch tested?
N/A
Was this patch authored or co-authored using generative AI tooling?
No