Skip to content

Commit

Permalink
Support v2 Reading & Writing with Spark Session Properties (#729)
Browse files Browse the repository at this point in the history
* Support spark session properties

* Add spark session property support for writing

* Support reading/writing using spark session properties for v2

---------

Co-authored-by: William Phillips <[email protected]>
  • Loading branch information
williamdphillips and wphillips-d authored Apr 4, 2023
1 parent e9012c3 commit ba6c487
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class ExcelDataSourceReader(
/* Actual doing schema inferring */
private def infer(inputPaths: Seq[FileStatus]): StructType = {
val excelHelper = ExcelHelper(options)
val conf = sparkSession.sqlContext.sparkContext.hadoopConfiguration
val conf = sparkSession.sessionState.newHadoopConf()

/** Sampling ratio on file level (not row level as in CSV) */
val paths = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ 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.sqlContext.sparkContext.hadoopConfiguration
val conf = sparkSession.sessionState.newHadoopConf()

/** Sampling ratio on file level (not row level as in CSV) */
val paths = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ 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.sqlContext.sparkContext.hadoopConfiguration
val conf = sparkSession.sessionState.newHadoopConf()

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

0 comments on commit ba6c487

Please sign in to comment.