Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/17938#discussion_r115923548
--- Diff: docs/sql-programming-guide.md ---
@@ -581,6 +581,46 @@ Starting from Spark 2.1, persistent datasource tables
have per-partition metadat
Note that partition information is not gathered by default when creating
external datasource tables (those with a `path` option). To sync the partition
information in the metastore, you can invoke `MSCK REPAIR TABLE`.
+### Bucketing, Sorting and Partitioning
+
+For file-based data source it is also possible to bucket and and sort or
partition the output.
+Bucketing and sorting is applicable only to persistent tables:
+
+<div class="codetabs">
+
+<div data-lang="scala" markdown="1">
+{% include_example write_sorting_and_bucketing
scala/org/apache/spark/examples/sql/SQLDataSourceExample.scala %}
+</div>
+
+<div data-lang="java" markdown="1">
+{% include_example write_sorting_and_bucketing
java/org/apache/spark/examples/sql/JavaSQLDataSourceExample.java %}
+</div>
+
+<div data-lang="python" markdown="1">
+{% include_example write_sorting_and_bucketing python/sql/datasource.py %}
+</div>
+
+</div>
+
+while partitioning can be used with both `save` and `saveAsTable`:
--- End diff --
like @tejasapatil suggested, we should give one more example about
partitioned and bucketed table, so that users know they can use bucketing and
partitioning at the same time
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]