-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-31612][SQL][DOCS][FOLLOW-UP] SQL Reference clean up #28428
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,7 @@ license: | | |
|
|
||
| ### Description | ||
|
|
||
| Lists the databases that match an optionally supplied string pattern. If no | ||
| Lists the databases that match an optionally supplied regular expression pattern. If no | ||
| pattern is supplied then the command lists all the databases in the system. | ||
| Please note that the usage of `SCHEMAS` and `DATABASES` are interchangeable | ||
| and mean the same thing. | ||
|
|
@@ -39,11 +39,12 @@ SHOW { DATABASES | SCHEMAS } [ LIKE regex_pattern ] | |
| <dd> | ||
| Specifies a regular expression pattern that is used to filter the results of the | ||
| statement. | ||
| <ul> | ||
| <li>Only <code>*</code> and <code>|</code> are allowed as wildcard pattern.</li> | ||
| <li>Excluding <code>*</code> and <code>|</code>, the remaining pattern follows the regular expression semantics.</li> | ||
| <li>The leading and trailing blanks are trimmed in the input pattern before processing. The pattern match is case-insensitive.</li> | ||
| </ul> | ||
| <ul> | ||
| <li>Except for <code>*</code> and <code>|</code> character, the pattern works like a regular expression.</li> | ||
| <li><code>*</code> alone matches 0 or more characters and <code>|</code> is used to separate multiple different regular expressions, | ||
| any of which can match. </li> | ||
| <li>The leading and trailing blanks are trimmed in the input pattern before processing. The pattern match is case-insensitive.</li> | ||
| </ul> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change to the same description of |
||
| </dd> | ||
| </dl> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ clause is optional and supported only for compatibility with other systems. | |
| ### Syntax | ||
|
|
||
| {% highlight sql %} | ||
| SHOW [ function_kind ] FUNCTIONS ( [ LIKE ] function_name | regex_pattern ) | ||
| SHOW [ function_kind ] FUNCTIONS { [ LIKE ] function_name | regex_pattern } | ||
| {% endhighlight %} | ||
|
|
||
| ### Parameters | ||
|
|
@@ -60,11 +60,12 @@ SHOW [ function_kind ] FUNCTIONS ( [ LIKE ] function_name | regex_pattern ) | |
| <dd> | ||
| Specifies a regular expression pattern that is used to filter the results of the | ||
| statement. | ||
| <ul> | ||
| <li>Only <code>*</code> and <code>|</code> are allowed as wildcard pattern.</li> | ||
| <li>Excluding <code>*</code> and <code>|</code>, the remaining pattern follows the regular expression semantics.</li> | ||
| <li>The leading and trailing blanks are trimmed in the input pattern before processing. The pattern match is case-insensitive.</li> | ||
| </ul> | ||
| <ul> | ||
| <li>Except for <code>*</code> and <code>|</code> character, the pattern works like a regular expression.</li> | ||
| <li><code>*</code> alone matches 0 or more characters and <code>|</code> is used to separate multiple different regular expressions, | ||
| any of which can match. </li> | ||
| <li>The leading and trailing blanks are trimmed in the input pattern before processing. The pattern match is case-insensitive.</li> | ||
| </ul> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change to the same description of |
||
| </dd> | ||
| </dl> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,12 @@ license: | | |
|
|
||
| Join Hints allow users to suggest the join strategy that Spark should use. Prior to Spark 3.0, only the `BROADCAST` Join Hint was supported. `MERGE`, `SHUFFLE_HASH` and `SHUFFLE_REPLICATE_NL` Joint Hints support was added in 3.0. When different join strategy hints are specified on both sides of a join, Spark prioritizes hints in the following order: `BROADCAST` over `MERGE` over `SHUFFLE_HASH` over `SHUFFLE_REPLICATE_NL`. When both sides are specified with the `BROADCAST` hint or the `SHUFFLE_HASH` hint, Spark will pick the build side based on the join type and the sizes of the relations. Since a given strategy may not support all join types, Spark is not guaranteed to use the join strategy suggested by the hint. | ||
|
|
||
| ### Syntax | ||
|
|
||
| {% highlight sql %} | ||
| /*+ join_hint [ , ... ] */ | ||
| {% endhighlight %} | ||
|
|
||
| ### Join Hints Types | ||
|
|
||
| <dl> | ||
|
|
@@ -78,7 +84,7 @@ SELECT /*+ SHUFFLE_REPLICATE_NL(t1) */ * FROM t1 INNER JOIN t2 ON t1.key = t2.ke | |
| -- Spark will issue Warning in the following example | ||
| -- org.apache.spark.sql.catalyst.analysis.HintErrorLogger: Hint (strategy=merge) | ||
| -- is overridden by another hint and will not take effect. | ||
| SELECT /*+ BROADCAST(t1) */ /*+ MERGE(t1, t2) */ * FROM t1 INNER JOIN t2 ON t1.key = t2.key; | ||
| SELECT /*+ BROADCAST(t1), MERGE(t1, t2) */ * FROM t1 INNER JOIN t2 ON t1.key = t2.key; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| {% endhighlight %} | ||
|
|
||
| ### Related Statements | ||
|
|
||
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.
This comment looks fine, but I think we need the same comment in the other error output.
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.
Maybe have the same format as ansi compliance page?

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.
I think adding
-- outputthere looks okay, WDYT?Could you check documents in the other DBMS-like systems? As the others suggested, I think its better to follow the other document formats.
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.
I googled, but didn't have much luck. Only found this one at https://docs.snowflake.com/en/sql-reference/functions/validate.html
I personally like to either put
-- outputor indent 2 spaces for the error message, or both (the way you suggested)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: @HyukjinKwon @dongjoon-hyun