Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Move to HiveParquetSuite
  • Loading branch information
wangyum committed Aug 30, 2018
commit cdbf81a6212651fa6d2bf49ca4fba3a385029ba7
Original file line number Diff line number Diff line change
Expand Up @@ -1021,18 +1021,6 @@ class ParquetFilterSuite extends QueryTest with ParquetTest with SharedSQLContex
}
}
}

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

class NumRowGroupsAcc extends AccumulatorV2[Integer, Integer] {
Expand Down
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)
}
}
}
}
}