Github user tdas commented on a diff in the pull request: https://github.com/apache/spark/pull/12616#discussion_r61498063 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSource.scala --- @@ -175,25 +175,11 @@ case class DataSource( s.createSource(sparkSession.wrapped, metadataPath, userSpecifiedSchema, className, options) case format: FileFormat => - val caseInsensitiveOptions = new CaseInsensitiveMap(options) - val path = caseInsensitiveOptions.getOrElse("path", { + val path = new CaseInsensitiveMap(options).getOrElse("path", { throw new IllegalArgumentException("'path' is not specified") }) - - def dataFrameBuilder(files: Array[String]): DataFrame = { - val newOptions = options.filterKeys(_ != "path") + ("basePath" -> path) - val newDataSource = - DataSource( - sparkSession, - paths = files, - userSpecifiedSchema = Some(sourceInfo.schema), - className = className, - options = new CaseInsensitiveMap(newOptions)) - Dataset.ofRows(sparkSession, LogicalRelation(newDataSource.resolveRelation())) - } - new FileStreamSource( - sparkSession, metadataPath, path, sourceInfo.schema, dataFrameBuilder) --- End diff -- All this code has been moved into the FileStreamSource. It does not make sense that all this file stream specific code should be in the Datasource file.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org