Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/scala/dev/mauch/spark/excel/DefaultSource.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DefaultSource extends RelationProvider with SchemaRelationProvider with Cr
parameters: Map[String, String],
schema: StructType
): ExcelRelation = {
val conf = sqlContext.sparkSession.sessionState.newHadoopConf()
val conf = sqlContext.sparkSession.sessionState.newHadoopConfWithOptions(parameters)
val wbReader = WorkbookReader(parameters, conf)
val dataLocator = DataLocator(parameters)
ExcelRelation(
Expand Down Expand Up @@ -63,7 +63,7 @@ class DefaultSource extends RelationProvider with SchemaRelationProvider with Cr
val path = checkParameter(parameters, "path")
val header = checkParameter(parameters, "header").toBoolean
val filesystemPath = new Path(path)
val conf = sqlContext.sparkSession.sessionState.newHadoopConf()
val conf = sqlContext.sparkSession.sessionState.newHadoopConfWithOptions(parameters)
val fs = filesystemPath.getFileSystem(conf)
new ExcelFileSaver(
fs,
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/dev/mauch/spark/excel/v2/ExcelTable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ case class ExcelTable(
/* Actual doing schema inferring */
private def infer(sparkSession: SparkSession, inputPaths: Seq[FileStatus], options: ExcelOptions): StructType = {
val excelHelper = ExcelHelper(options)
val conf = sparkSession.sessionState.newHadoopConf()
/* Hadoop Configurations are case sensitive. */
val caseSensitiveMap = map.asCaseSensitiveMap.asScala.toMap
val conf = sparkSession.sessionState.newHadoopConfWithOptions(caseSensitiveMap)

/** Sampling ratio on file level (not row level as in CSV) */
val paths = {
Expand Down
Loading