You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "panbingkun (via GitHub)" <gi...@apache.org> on 2023/03/14 12:00:02 UTC

[GitHub] [spark] panbingkun commented on a diff in pull request #40377: [SPARK-42757][CONNECT] Implement textFile for DataFrameReader

panbingkun commented on code in PR #40377:
URL: https://github.com/apache/spark/pull/40377#discussion_r1135433184


##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/DataFrameReader.scala:
##########
@@ -531,10 +531,7 @@ class DataFrameReader private[sql] (sparkSession: SparkSession) extends Logging
    */
   @scala.annotation.varargs
   def textFile(paths: String*): Dataset[String] = {
-    // scalastyle:off throwerror
-    // TODO: this method can be supported and should be included in the client API.
-    throw new NotImplementedError()
-    // scalastyle:on throwerror

Review Comment:
   Done



##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/DataFrameReader.scala:
##########
@@ -531,10 +531,7 @@ class DataFrameReader private[sql] (sparkSession: SparkSession) extends Logging
    */
   @scala.annotation.varargs
   def textFile(paths: String*): Dataset[String] = {
-    // scalastyle:off throwerror
-    // TODO: this method can be supported and should be included in the client API.
-    throw new NotImplementedError()
-    // scalastyle:on throwerror
+    text(paths: _*).select("value").as[String](sparkSession.implicits.newStringEncoder)

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org