You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/04/06 00:25:18 UTC

[GitHub] [spark] maropu commented on a change in pull request #28130: [SPARK-31355][SQL][DOCS] Document TABLESAMPLE in SQL Reference

maropu 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_r403779769
 
 

 ##########
 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:
   We need a link to this section from the `SELECT` document?
   https://github.com/apache/spark/blame/master/docs/sql-ref-syntax-qry-select.md#L78-L85
   
   In the PostgreSQL doc, the `SELECT` document includes the `TABLESAMPLE` clause: https://www.postgresql.org/docs/current/sql-select.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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org