You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/09/07 09:18:41 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #29659: [SPARK-32810][SQL] CSV/JSON data sources should avoid globbing paths when inferring schema

HyukjinKwon commented on a change in pull request #29659:
URL: https://github.com/apache/spark/pull/29659#discussion_r484304012



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FileTable.scala
##########
@@ -139,6 +139,14 @@ abstract class FileTable(
    * 2. Catalog support is required, which is still under development for data source V2.
    */
   def fallbackFileFormat: Class[_ <: FileFormat]
+
+  /**
+   * Whether or not paths should be globbed before being used to access files.
+   */
+  private def globPaths: Boolean = {
+    val entry = options.get(DataSource.GLOB_PATHS_KEY)
+    Option(entry).getOrElse("true") == "true"

Review comment:
       Maybe:
   
   ```scala
   Option(entry).map(_ == "true").getOrElse(true)
   ```
   
   just to be consistent with above:
   
   ```scala
       options.get(DataSource.GLOB_PATHS_KEY)
         .map(_ == "true")
         .getOrElse(true)
   ```
   




----------------------------------------------------------------
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.

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