Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

[NSE-979] fix data source #993

Merged
merged 3 commits into from
Jun 27, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class ArrowFileFormat extends FileFormat with DataSourceRegister with Serializab
// todo predicate validation / pushdown
val parquetFileFields = factory.inspect().getFields.asScala
val caseInsensitiveFieldMap = mutable.Map[String, String]()
val requiredFields = if (sqlConf.caseSensitiveAnalysis) {
val requiredFields = if (caseSensitive) {
new Schema(requiredSchema.map { field =>
parquetFileFields.find(_.getName.equals(field.name))
.getOrElse(ArrowUtils.toArrowField(field))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ case class ArrowPartitionReaderFactory(

private val batchSize = sqlConf.parquetVectorizedReaderBatchSize
private val enableFilterPushDown: Boolean = sqlConf.arrowFilterPushDown
private val caseSensitive: Boolean = sqlConf.caseSensitiveAnalysis

override def supportColumnarReads(partition: InputPartition): Boolean = true

Expand All @@ -63,7 +64,7 @@ case class ArrowPartitionReaderFactory(
partitionedFile.start, partitionedFile.length, options)
val parquetFileFields = factory.inspect().getFields.asScala
val caseInsensitiveFieldMap = mutable.Map[String, String]()
val requiredFields = if (sqlConf.caseSensitiveAnalysis) {
val requiredFields = if (caseSensitive) {
new Schema(readDataSchema.map { field =>
parquetFileFields.find(_.getName.equals(field.name))
.getOrElse(ArrowUtils.toArrowField(field))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ class ArrowDataSourceTest extends QueryTest with SharedSparkSession {
"id"
}
val df = spark.read
.schema(s"$selectColName long")
.arrow(tempPath.getPath)
.filter(s"$selectColName <= 2")
checkAnswer(df, Row(0) :: Row(1) :: Row(2) :: Nil)
Expand Down