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
[SPARK-31636][SQL][DOCS] Remove HTML syntax in SQL reference #28451
Conversation
Test build #122290 has finished for PR 28451 at commit
|
Test build #122287 has finished for PR 28451 at commit
|
docs/sql-ref-identifier.md
Outdated
-- This CREATE TABLE fails with ParseException because of the illegal identifier name a.b | ||
CREATE TABLE test (a.b int); | ||
org.apache.spark.sql.catalyst.parser.ParseException: | ||
no viable alternative at input 'CREATE TABLE test (a.'(line 1, pos 20) | ||
org.apache.spark.sql.catalyst.parser.ParseException: |
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.
Since we indent 2 spaces for error messages in other place, I will do the same here.
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.
Rather, we should remove indents in the other places for following the result format?
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.
Fixed.
Test build #122292 has finished for PR 28451 at commit
|
@@ -66,7 +66,7 @@ This means that in case an operation causes overflows, the result is the same wi | |||
On the other hand, Spark SQL returns null for decimal overflows. | |||
When `spark.sql.ansi.enabled` is set to `true` and an overflow occurs in numeric and interval arithmetic operations, it throws an arithmetic exception at runtime. | |||
|
|||
{% highlight sql %} | |||
```sql | |||
-- `spark.sql.ansi.enabled=true` |
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.
@huaxingao I know that it's not related to the format change that you r doing in this PR. But shouldn't we have a SET statement here, so users can cut-paste the command in their shell to see the behavior ? Perhaps we discussed it in the pr that added this clause. Just a question :-)
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 don't have a strong opinion on this. seems to me comment is OK too.
- text: JOIN | ||
url: sql-ref-syntax-qry-select-join.html | ||
- text: Join Hints | ||
url: sql-ref-syntax-qry-select-hints.html | ||
- text: LIKE Predicate | ||
url: sql-ref-syntax-qry-select-like.html | ||
- text: Set Operators |
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.
Why do we need the changes in this file?
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.
+--------------+ | ||
| 3750.0| | ||
+--------------+ | ||
``` | ||
</div> |
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.
We cannot avoid this tag, too?
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 will take a look at this.
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 is for examples <div class="codetabs">
. I prefer to keep this since we use this format for all the examples.
docs/sql-ref-identifier.md
Outdated
-- This CREATE TABLE fails with ParseException because of the illegal identifier name a.b | ||
CREATE TABLE test (a.b int); | ||
org.apache.spark.sql.catalyst.parser.ParseException: | ||
no viable alternative at input 'CREATE TABLE test (a.'(line 1, pos 20) | ||
org.apache.spark.sql.catalyst.parser.ParseException: |
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.
Rather, we should remove indents in the other places for following the result format?
It's better to remove indents. Will spend some time to find all the error messages. |
Test build #122296 has finished for PR 28451 at commit
|
docs/sql-ref-literals.md
Outdated
@@ -35,22 +35,19 @@ A string literal is used to specify a character string value. | |||
|
|||
#### Syntax | |||
|
|||
{% highlight sql %} | |||
```sql | |||
'c [ ... ]' | "c [ ... ]" |
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.
@huaxingao the parameter c
kind of looks weird especially in new format ? What do you think of character or any_char or something like that ?
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.
changed to char
docs/sql-ref-literals.md
Outdated
|
||
<dl> | ||
<dt><code><em>c</em></code></dt> | ||
<dd> | ||
One character from the character set. |
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 believe there is limitation on the chars that are allowed in the binary literal ?
for example, i tried :
SELECT X'zzzzzz' AS col and got an exception ?
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.
seems to be hexadecimal. Changed to the following:
#### Syntax
X { 'num [ ... ]' | "num [ ... ]" }
#### Parameters
* **num**
Any hexadecimal number from 0 to F.
cc @yaooqinn
docs/sql-ref-identifier.md
Outdated
{ letter | digit | '_' } [ , ... ] | ||
{% endhighlight %} | ||
``` | ||
Note: If `spark.sql.ansi.enabled` is set to true, ANSI SQL reserved keywords cannot be used as identifiers. For more details, please refer to [ANSI Compliance](sql-ref-ansi-compliance.html). |
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.
@huaxingao Should we bold "Note" ? I see that in other places we do bold it.
Test build #122301 has finished for PR 28451 at commit
|
</code> | ||
</dd> | ||
</dl> | ||
for partitions. When specified, the partitions that match the partition spec are returned. |
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.
@huaxingao just for consistency lets change "partition spec" to "partition specification" ?
Test build #122303 has finished for PR 28451 at commit
|
Nice @huaxingao . LGTM - had some very minor comments. |
Test build #122308 has finished for PR 28451 at commit
|
cc @srowen |
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 generally like the HTML simplification to markdown. I can't think of a reason we need to keep the HTML form; maybe an early markdown renderer didn't support it. This still render OK as expected when built currently?
@@ -64,15 +64,15 @@ On the other hand, `INSERT INTO` syntax throws an analysis exception when the AN | |||
Currently, the ANSI mode affects explicit casting and assignment casting only. | |||
In future releases, the behaviour of type coercion might change along with the other two type conversion rules. | |||
|
|||
{% highlight sql %} | |||
```sql |
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.
Seems OK, is there any behavior difference?
I'm on the fence about whether it's worth changing across all files.
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.
docs/sql-ref-literals.md
Outdated
|
||
* **L** | ||
|
||
Case insensitive, indicates `BIGINT`, which is a 8-byte signed integer number. |
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.
nit: an 8-byte
docs/sql-ref-literals.md
Outdated
#### Examples | ||
* **D** | ||
|
||
Case insensitive, indicates `DOUBLE`, which is a 8-byte double-precision floating point number. |
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.
ditto
|
||
<dt><code><em>database_comment</em></code></dt> | ||
<dd>Specifies the description for the database.</dd> | ||
Creates a database with the given name if it doesn't exists. If a database with the same name already exists, nothing will happen. |
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.
nit: doesn't exists
-> doesn't exist
|
||
* **STORED AS** | ||
|
||
File format for table storage, could be TEXTFILE, ORC, PARQUET,etc. |
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.
nit: ,etc. ->
, etc.
|
||
* **STORED AS** | ||
|
||
File format for table storage, could be TEXTFILE, ORC, PARQUET,etc. |
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.
ditto
</dl> | ||
* **IF EXISTS** | ||
|
||
If specified, no exception is thrown when the table does not 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.
nit: exists
-> exist
docs/sql-ref-syntax-ddl-drop-view.md
Outdated
</dl> | ||
* **IF EXISTS** | ||
|
||
If specified, no exception is thrown when the view does not 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.
ditto
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.
Fixed. Thanks for checking. @kiszk
Yes. This still works OK as expected. @srowen |
Test build #122319 has finished for PR 28451 at commit
|
If there are no more comments, I'll merge tomorrow. This is for 3.1 only? |
@srowen this is for 3.0. |
### What changes were proposed in this pull request? Remove the unneeded embedded inline HTML markup by using the basic markdown syntax. Please see #28414 ### Why are the changes needed? Make the doc cleaner and easily editable by MD editors. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Manually build and check Closes #28451 from huaxingao/html_cleanup. Authored-by: Huaxin Gao <huaxing@us.ibm.com> Signed-off-by: Sean Owen <srowen@gmail.com> (cherry picked from commit a75dc80) Signed-off-by: Sean Owen <srowen@gmail.com>
Merged to master/3.0 |
Thanks all! |
All the document works for 3.0 have been done? https://issues.apache.org/jira/browse/SPARK-28588 |
@gatorsmile @dilipbiswal Anything else you want to add in 3.0? |
What changes were proposed in this pull request?
Remove the unneeded embedded inline HTML markup by using the basic markdown syntax.
Please see #28414
Why are the changes needed?
Make the doc cleaner and easily editable by MD editors.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Manually build and check