Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
imback82 committed Aug 19, 2020
1 parent 6d5b2d3 commit 6f147ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ trait FileDataSourceV2 extends TableProvider with DataSourceRegister {
}

protected def getOptionsWithoutPaths(map: CaseInsensitiveStringMap): CaseInsensitiveStringMap = {
val caseInsensitiveMap = CaseInsensitiveMap(map.asCaseSensitiveMap.asScala.toMap)
val caseInsensitiveMapWithoutPaths = caseInsensitiveMap - "paths" - "path"
new CaseInsensitiveStringMap(
caseInsensitiveMapWithoutPaths.asInstanceOf[CaseInsensitiveMap[String]].originalMap.asJava)
val withoutPath = map.asCaseSensitiveMap().asScala.filterKeys { k =>
!k.equalsIgnoreCase("path") && !k.equalsIgnoreCase("paths")
}
new CaseInsensitiveStringMap(withoutPath.asJava)
}

protected def getTableName(map: CaseInsensitiveStringMap, paths: Seq[String]): String = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import org.apache.spark.sql.util.CaseInsensitiveStringMap
case class TextTable(
name: String,
sparkSession: SparkSession,
originalOptions: CaseInsensitiveStringMap,
options: CaseInsensitiveStringMap,
paths: Seq[String],
userSpecifiedSchema: Option[StructType],
fallbackFileFormat: Class[_ <: FileFormat])
extends FileTable(sparkSession, originalOptions, paths, userSpecifiedSchema) {
extends FileTable(sparkSession, options, paths, userSpecifiedSchema) {
override def newScanBuilder(options: CaseInsensitiveStringMap): TextScanBuilder =
TextScanBuilder(sparkSession, fileIndex, schema, dataSchema, options)

Expand Down

0 comments on commit 6f147ee

Please sign in to comment.