huaxingao commented on a change in pull request #28130:
[SPARK-31355][SQL][DOCS] Document TABLESAMPLE in SQL Reference
URL: https://github.com/apache/spark/pull/28130#discussion_r403827026
##########
File path: docs/sql-ref-syntax-qry-sampling.md
##########
@@ -19,4 +19,72 @@ license: |
limitations under the License.
---
-**This page is under construction**
+### Description
+
+The `TABLESAMPLE` statement is used to sample the table. It supports the
following sampling methods:
+- `TABLESAMPLE`(x `ROWS`): Sample the table down to the given number of rows.
+- `TABLESAMPLE`(x `PERCENT`): Sample the table down to the given percentage.
Note that percentages are defined as a number between 0 and 100.
+- `TABLESAMPLE`(`BUCKET` x `OUT OF` y): Sample the table down to a `x` out of
`y` fraction.
+
+Note: `TABLESAMPLE` returns the approximate number of rows or fraction
requested.
Review comment:
Thanks for your comments.
In the related statement, I will cross link ```select``` and
```tablesample```. I am a little hesitate to add tablesample to the ```from
item```. Seems to me, Tablesample is not parallel to Table relation or
InlineTable, the structure is more like this:
```
SELECT ... FROM
Table relation
Tablesample
......
Inlined table
Tablesample
```
Here is how snowflake document this
https://docs.snowflake.com/en/sql-reference/constructs/from.html
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]