Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/22148#discussion_r211783541
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/FileBasedDataSourceSuite.scala ---
@@ -430,6 +430,48 @@ class FileBasedDataSourceSuite extends QueryTest with
SharedSQLContext with Befo
}
}
}
+
+ test(s"SPARK-25132: case-insensitive field resolution when reading from
Parquet") {
+ withTempDir { dir =>
+ val format = "parquet"
+ val tableDir = dir.getCanonicalPath + s"/$format"
+ val tableName = s"spark_25132_${format}"
+ withTable(tableName) {
+ val end = 5
+ val data = spark.range(end).selectExpr("id as A", "id * 2 as b",
"id * 3 as B")
+ withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") {
+ data.write.format(format).mode("overwrite").save(tableDir)
+ }
+ sql(s"CREATE TABLE $tableName (a LONG, b LONG) USING $format
LOCATION '$tableDir'")
--- End diff --
table-level conf is reasonable. Let us do it in 3.0?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]