-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-48976][SQL][DOCS] Improve the docs related to variable
#47460
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
|
Additionally, the syntax seems
spark/sql/api/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBaseParser.g4 Lines 68 to 72 in 285489b
spark/sql/api/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBaseParser.g4 Lines 218 to 220 in 285489b
Should we unify it?
|
| If you did not qualify the name with a schema and catalog, verify the current_schema() output, or qualify the name with the correct schema and catalog. | ||
| To tolerate the error on drop use DROP VARIABLE IF EXISTS. SQLSTATE: 42883 | ||
|
|
||
| -- Drop temporart variable if it exists |
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.
typo
temporart -> temporary
| Choose a different name, or drop or replace the existing variable. SQLSTATE: 42723 | ||
|
|
||
| -- Use `DECLARE OR REPLACE` to declare a defined variable | ||
| DECLARE OR REPLACE five = 55; |
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.
The usage of DECLARE OR REPLACE does not exist in the doc
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.
to double check, the doc does mention it but we don't show it in the example, right?
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.
allisonwang-db
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.
cc @srielau
|
Merged to master. |
### What changes were proposed in this pull request? The pr aims to improve the docs related to `variable`, includes: - `docs/sql-ref-syntax-aux-set-var.md`, show the `primitive` error messages. - `docs/sql-ref-syntax-ddl-declare-variable.md`, add usage of `DECLARE OR REPLACE`. - `docs/sql-ref-syntax-ddl-drop-variable.md`, show the `primitive` error messages and fix `typo`. ### Why are the changes needed? Only improve docs. ### Does this PR introduce _any_ user-facing change? Yes, make end-user docs clearer. ### How was this patch tested? Manually test. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#47460 from panbingkun/SPARK-48976. Authored-by: panbingkun <panbingkun@baidu.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>


What changes were proposed in this pull request?
The pr aims to improve the docs related to
variable, includes:docs/sql-ref-syntax-aux-set-var.md, show theprimitiveerror messages.docs/sql-ref-syntax-ddl-declare-variable.md, add usage ofDECLARE OR REPLACE.docs/sql-ref-syntax-ddl-drop-variable.md, show theprimitiveerror messages and fixtypo.Why are the changes needed?
Only improve docs.
Does this PR introduce any user-facing change?
Yes, make end-user docs clearer.
How was this patch tested?
Manually test.
Was this patch authored or co-authored using generative AI tooling?
No.