Skip to content

Commit

Permalink
[SQL] Minor doc update: Add an example in DataFrameReader.schema
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?
This patch adds a small example to the schema string definition of schema function. It isn't obvious how to use it, so an example would be useful.

## How was this patch tested?
N/A - doc only.

Author: Reynold Xin <[email protected]>

Closes #20491 from rxin/schema-doc.
  • Loading branch information
rxin authored and gatorsmile committed Feb 3, 2018
1 parent eaf35de commit 3ff83ad
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ class DataFrameReader private[sql](sparkSession: SparkSession) extends Logging {
* infer the input schema automatically from data. By specifying the schema here, the underlying
* data source can skip the schema inference step, and thus speed up data loading.
*
* {{{
* spark.read.schema("a INT, b STRING, c DOUBLE").csv("test.csv")
* }}}
*
* @since 2.3.0
*/
def schema(schemaString: String): DataFrameReader = {
Expand Down

0 comments on commit 3ff83ad

Please sign in to comment.