Skip to content
Snippets Groups Projects
Commit 6e077166 authored by Yanbo Liang's avatar Yanbo Liang Committed by Reynold Xin
Browse files

[SQL] Update SQLContext.read.text doc

Since we rename the column name from ```text``` to ```value``` for DataFrame load by ```SQLContext.read.text```, we need to update doc.

Author: Yanbo Liang <ybliang8@gmail.com>

Closes #10349 from yanboliang/text-value.
parent a170d34a
No related branches found
No related tags found
No related merge requests found
...@@ -207,7 +207,7 @@ class DataFrameReader(object): ...@@ -207,7 +207,7 @@ class DataFrameReader(object):
@ignore_unicode_prefix @ignore_unicode_prefix
@since(1.6) @since(1.6)
def text(self, paths): def text(self, paths):
"""Loads a text file and returns a [[DataFrame]] with a single string column named "text". """Loads a text file and returns a [[DataFrame]] with a single string column named "value".
Each line in the text file is a new row in the resulting DataFrame. Each line in the text file is a new row in the resulting DataFrame.
......
...@@ -339,7 +339,7 @@ class DataFrameReader private[sql](sqlContext: SQLContext) extends Logging { ...@@ -339,7 +339,7 @@ class DataFrameReader private[sql](sqlContext: SQLContext) extends Logging {
} }
/** /**
* Loads a text file and returns a [[DataFrame]] with a single string column named "text". * Loads a text file and returns a [[DataFrame]] with a single string column named "value".
* Each line in the text file is a new row in the resulting DataFrame. For example: * Each line in the text file is a new row in the resulting DataFrame. For example:
* {{{ * {{{
* // Scala: * // Scala:
......
...@@ -76,7 +76,7 @@ private[sql] class TextRelation( ...@@ -76,7 +76,7 @@ private[sql] class TextRelation(
(@transient val sqlContext: SQLContext) (@transient val sqlContext: SQLContext)
extends HadoopFsRelation(maybePartitionSpec, parameters) { extends HadoopFsRelation(maybePartitionSpec, parameters) {
/** Data schema is always a single column, named "text". */ /** Data schema is always a single column, named "value". */
override def dataSchema: StructType = new StructType().add("value", StringType) override def dataSchema: StructType = new StructType().add("value", StringType)
/** This is an internal data source that outputs internal row format. */ /** This is an internal data source that outputs internal row format. */
......
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