Skip to content

Commit 41ad8ac

Browse files
yanboliangrxin
authored andcommitted
[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 <[email protected]> Closes #10349 from yanboliang/text-value. (cherry picked from commit 6e07716) Signed-off-by: Reynold Xin <[email protected]>
1 parent 1ebedb2 commit 41ad8ac

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

python/pyspark/sql/readwriter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def parquet(self, *paths):
207207
@ignore_unicode_prefix
208208
@since(1.6)
209209
def text(self, paths):
210-
"""Loads a text file and returns a [[DataFrame]] with a single string column named "text".
210+
"""Loads a text file and returns a [[DataFrame]] with a single string column named "value".
211211
212212
Each line in the text file is a new row in the resulting DataFrame.
213213

sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ class DataFrameReader private[sql](sqlContext: SQLContext) extends Logging {
339339
}
340340

341341
/**
342-
* Loads a text file and returns a [[DataFrame]] with a single string column named "text".
342+
* Loads a text file and returns a [[DataFrame]] with a single string column named "value".
343343
* Each line in the text file is a new row in the resulting DataFrame. For example:
344344
* {{{
345345
* // Scala:

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/DefaultSource.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private[sql] class TextRelation(
7676
(@transient val sqlContext: SQLContext)
7777
extends HadoopFsRelation(maybePartitionSpec, parameters) {
7878

79-
/** Data schema is always a single column, named "text". */
79+
/** Data schema is always a single column, named "value". */
8080
override def dataSchema: StructType = new StructType().add("value", StringType)
8181

8282
/** This is an internal data source that outputs internal row format. */

0 commit comments

Comments
 (0)