cloud-fan commented on a change in pull request #24025: [SPARK-27106][SQL]
merge CaseInsensitiveStringMap and DataSourceOptions
URL: https://github.com/apache/spark/pull/24025#discussion_r263985603
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FileTable.scala
##########
@@ -22,23 +22,27 @@ import org.apache.hadoop.fs.FileStatus
import org.apache.spark.sql.{AnalysisException, SparkSession}
import org.apache.spark.sql.execution.datasources._
-import org.apache.spark.sql.sources.v2.{DataSourceOptions, SupportsBatchRead,
SupportsBatchWrite, Table}
+import org.apache.spark.sql.sources.v2.{SupportsBatchRead, SupportsBatchWrite,
Table}
import org.apache.spark.sql.types.StructType
+import org.apache.spark.sql.util.CaseInsensitiveStringMap
abstract class FileTable(
sparkSession: SparkSession,
- options: DataSourceOptions,
+ options: CaseInsensitiveStringMap,
+ paths: Seq[String],
userSpecifiedSchema: Option[StructType])
extends Table with SupportsBatchRead with SupportsBatchWrite {
+
lazy val fileIndex: PartitioningAwareFileIndex = {
- val filePaths = options.paths()
- val hadoopConf =
-
sparkSession.sessionState.newHadoopConfWithOptions(options.asMap().asScala.toMap)
- val rootPathsSpecified = DataSource.checkAndGlobPathIfNecessary(filePaths,
hadoopConf,
- checkEmptyGlobPath = true, checkFilesExist = options.checkFilesExist())
+ val scalaMap = options.asScala.toMap
+ val hadoopConf =
sparkSession.sessionState.newHadoopConfWithOptions(scalaMap)
+ // This is an internal config so must be present.
+ val checkFilesExist = options.get("check_files_exist").toBoolean
Review comment:
yea please refer to the discussion
[here](https://github.com/apache/spark/pull/23383#discussion_r248717465)
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]