Skip to content
Closed
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 @@ -20,6 +20,7 @@ package org.apache.spark.sql.hive
import org.apache.spark.sql.{QueryTest, Row}
import org.apache.spark.sql.execution.datasources.parquet.ParquetTest
import org.apache.spark.sql.hive.test.TestHiveSingleton
import org.apache.spark.sql.internal.SQLConf

case class Cases(lower: String, UPPER: String)

Expand Down Expand Up @@ -76,4 +77,19 @@ class HiveParquetSuite extends QueryTest with ParquetTest with TestHiveSingleton
}
}
}

test("SPARK-25206: wrong records are returned by filter pushdown " +
"when Hive metastore schema and parquet schema are in different letter cases") {
withSQLConf(SQLConf.PARQUET_FILTER_PUSHDOWN_ENABLED.key -> true.toString) {
withTempPath { path =>
val data = spark.range(1, 10).toDF("id")
data.write.parquet(path.getCanonicalPath)
withTable("SPARK_25206") {
sql("CREATE TABLE SPARK_25206 (ID LONG) USING parquet LOCATION " +
s"'${path.getCanonicalPath}'")
checkAnswer(sql("select id from SPARK_25206 where id > 0"), data)
}
}
}
}
}