cloud-fan commented on code in PR #43809:
URL: https://github.com/apache/spark/pull/43809#discussion_r1395160860


##########
sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala:
##########
@@ -246,7 +246,15 @@ class DataFrameReader private[sql](sparkSession: 
SparkSession) extends Logging {
     val builder = 
sparkSession.sharedState.dataSourceManager.lookupDataSource(source)
     // Unless the legacy path option behavior is enabled, the extraOptions here
     // should not include "path" or "paths" as keys.
-    val plan = builder(sparkSession, source, paths, userSpecifiedSchema, 
extraOptions)
+    // Add path to the options field. Note currently it only supports a single 
path.
+    val optionsWithPath = if (paths.isEmpty) {
+      extraOptions
+    } else if (paths.length == 1) {
+        extraOptions + ("path" -> paths.head)
+    } else {
+      throw QueryCompilationErrors.multiplePathsUnsupportedError(source, paths)

Review Comment:
   does it help to add a `paths` option using JSON to hold String[]?



-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to