diff --git a/src/main/2.4/scala/com/crealytics/spark/excel/v2/ExcelParserBase.scala b/src/main/2.4/scala/com/crealytics/spark/excel/v2/ExcelParserBase.scala index 5b386198..ef72d4ec 100644 --- a/src/main/2.4/scala/com/crealytics/spark/excel/v2/ExcelParserBase.scala +++ b/src/main/2.4/scala/com/crealytics/spark/excel/v2/ExcelParserBase.scala @@ -24,5 +24,5 @@ trait ExcelParserBase { protected def getCurrentInput: UTF8String def badRecord(partialResults: Array[InternalRow], baseException: Throwable): BadRecordException = - BadRecordException(() => getCurrentInput, () => partialResults.headOption, baseException) + BadRecordException(() => getCurrentInput, () => partialResults.headOption, baseException) } diff --git a/src/main/3.0_to_3.4/scala/com/crealytics/spark/excel/v2/ExcelParserBase.scala b/src/main/3.0_to_3.4/scala/com/crealytics/spark/excel/v2/ExcelParserBase.scala index 5b386198..ef72d4ec 100644 --- a/src/main/3.0_to_3.4/scala/com/crealytics/spark/excel/v2/ExcelParserBase.scala +++ b/src/main/3.0_to_3.4/scala/com/crealytics/spark/excel/v2/ExcelParserBase.scala @@ -24,5 +24,5 @@ trait ExcelParserBase { protected def getCurrentInput: UTF8String def badRecord(partialResults: Array[InternalRow], baseException: Throwable): BadRecordException = - BadRecordException(() => getCurrentInput, () => partialResults.headOption, baseException) + BadRecordException(() => getCurrentInput, () => partialResults.headOption, baseException) } diff --git a/src/main/3.5_and_up/scala/com/crealytics/spark/excel/v2/ExcelParserBase.scala b/src/main/3.5_and_up/scala/com/crealytics/spark/excel/v2/ExcelParserBase.scala index ab7ebc87..d4f9d99f 100644 --- a/src/main/3.5_and_up/scala/com/crealytics/spark/excel/v2/ExcelParserBase.scala +++ b/src/main/3.5_and_up/scala/com/crealytics/spark/excel/v2/ExcelParserBase.scala @@ -24,5 +24,5 @@ trait ExcelParserBase { protected def getCurrentInput: UTF8String def badRecord(partialResults: Array[InternalRow], baseException: Throwable): BadRecordException = - BadRecordException(() => getCurrentInput, () => partialResults, baseException) + BadRecordException(() => getCurrentInput, () => partialResults, baseException) } diff --git a/src/main/3.5_and_up/scala/com/crealytics/spark/excel/v2/ExcelPartitionReaderFactory.scala b/src/main/3.5_and_up/scala/com/crealytics/spark/excel/v2/ExcelPartitionReaderFactory.scala index 3f70b0cf..b04f2dd3 100644 --- a/src/main/3.5_and_up/scala/com/crealytics/spark/excel/v2/ExcelPartitionReaderFactory.scala +++ b/src/main/3.5_and_up/scala/com/crealytics/spark/excel/v2/ExcelPartitionReaderFactory.scala @@ -18,7 +18,7 @@ package com.crealytics.spark.excel.v2 import org.apache.hadoop.conf.Configuration import org.apache.spark.broadcast.Broadcast -import org.apache.spark.sql.catalyst.{InternalRow, FileSourceOptions} +import org.apache.spark.sql.catalyst.{FileSourceOptions, InternalRow} import org.apache.spark.sql.connector.read.PartitionReader import org.apache.spark.sql.execution.datasources.PartitionedFile import org.apache.spark.sql.execution.datasources.v2._ @@ -54,10 +54,9 @@ case class ExcelPartitionReaderFactory( parsedOptions: ExcelOptions, filters: Seq[Filter] ) extends FilePartitionReaderFactory { - protected def options: FileSourceOptions = new FileSourceOptions(Map( - FileSourceOptions.IGNORE_CORRUPT_FILES -> "true", - FileSourceOptions.IGNORE_MISSING_FILES -> "true" - )) + protected def options: FileSourceOptions = new FileSourceOptions( + Map(FileSourceOptions.IGNORE_CORRUPT_FILES -> "true", FileSourceOptions.IGNORE_MISSING_FILES -> "true") + ) override def buildReader(file: PartitionedFile): PartitionReader[InternalRow] = { val conf = broadcastedConf.value.value val actualDataSchema = diff --git a/src/main/scala/com/crealytics/spark/excel/v2/ExcelParser.scala b/src/main/scala/com/crealytics/spark/excel/v2/ExcelParser.scala index 26ad81cf..ed8239c4 100644 --- a/src/main/scala/com/crealytics/spark/excel/v2/ExcelParser.scala +++ b/src/main/scala/com/crealytics/spark/excel/v2/ExcelParser.scala @@ -42,7 +42,8 @@ import org.apache.poi.ss.usermodel.DateUtil * The pushdown filters that should be applied to converted values. */ class ExcelParser(dataSchema: StructType, requiredSchema: StructType, val options: ExcelOptions, filters: Seq[Filter]) - extends Logging with ExcelParserBase { + extends Logging + with ExcelParserBase { require( requiredSchema.toSet.subsetOf(dataSchema.toSet), s"requiredSchema (${requiredSchema.catalogString}) should be the subset of " +