Skip to content
Snippets Groups Projects
Commit 68693519 authored by Yin Huai's avatar Yin Huai Committed by Michael Armbrust
Browse files

[SQL][Docs] Update the output of printSchema and fix a typo in SQL programming guide.


We have changed the output format of `printSchema`. This PR will update our SQL programming guide to show the updated format. Also, it fixes a typo (the value type of `StructType` in Java API).

Author: Yin Huai <huai@cse.ohio-state.edu>

Closes #2630 from yhuai/sqlDoc and squashes the following commits:

267d63e [Yin Huai] Update the output of printSchema and fix a typo.

(cherry picked from commit 82a6a083)
Signed-off-by: default avatarMichael Armbrust <michael@databricks.com>
parent c52c231c
No related branches found
No related tags found
No related merge requests found
......@@ -620,8 +620,8 @@ val people = sqlContext.jsonFile(path)
// The inferred schema can be visualized using the printSchema() method.
people.printSchema()
// root
// |-- age: IntegerType
// |-- name: StringType
// |-- age: integer (nullable = true)
// |-- name: string (nullable = true)
// Register this SchemaRDD as a table.
people.registerTempTable("people")
......@@ -658,8 +658,8 @@ JavaSchemaRDD people = sqlContext.jsonFile(path);
// The inferred schema can be visualized using the printSchema() method.
people.printSchema();
// root
// |-- age: IntegerType
// |-- name: StringType
// |-- age: integer (nullable = true)
// |-- name: string (nullable = true)
// Register this JavaSchemaRDD as a table.
people.registerTempTable("people");
......@@ -697,8 +697,8 @@ people = sqlContext.jsonFile(path)
# The inferred schema can be visualized using the printSchema() method.
people.printSchema()
# root
# |-- age: IntegerType
# |-- name: StringType
# |-- age: integer (nullable = true)
# |-- name: string (nullable = true)
# Register this SchemaRDD as a table.
people.registerTempTable("people")
......@@ -1394,7 +1394,7 @@ please use factory methods provided in
</tr>
<tr>
<td> <b>StructType</b> </td>
<td> org.apache.spark.sql.api.java </td>
<td> org.apache.spark.sql.api.java.Row </td>
<td>
DataType.createStructType(<i>fields</i>)<br />
<b>Note:</b> <i>fields</i> is a List or an array of StructFields.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment