maropu commented on a change in pull request #24903: [SPARK-28084][SQL]
Resolving the partition column name based on the resolver in sql load command
URL: https://github.com/apache/spark/pull/24903#discussion_r306594213
##########
File path:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveCommandSuite.scala
##########
@@ -289,7 +290,46 @@ class HiveCommandSuite extends QueryTest with
SQLTestUtils with TestHiveSingleto
}
checkAnswer(
sql("SELECT employeeID, employeeName FROM part_table WHERE c = '2' AND
d = '1'"),
- sql("SELECT * FROM non_part_table").collect())
+ sql("SELECT * FROM non_part_table"))
+
+ // check for case insensitive property of partition column name in load
command.
+ withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") {
+ withInputFile { f =>
+ sql(s"""$loadQuery INPATH "${f.toURI}" INTO TABLE part_table
PARTITION(C="1", D="2")""")
+ }
+ checkAnswer(
+ sql("SELECT employeeID, employeeName FROM part_table WHERE c = '2'
AND d = '1'"),
+ sql("SELECT * FROM non_part_table").collect())
+ }
+ }
+ }
+
+ test("SPARK-28084 case insensitive names of static partitioning in INSERT
commands") {
+ // check for case insensitive property of partition column name in insert
command.
+ withTable("part_table") {
+ withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") {
+ sql("CREATE TABLE part_table (price int, qty int) partitioned by (year
int, month int)")
+ sql("INSERT INTO part_table PARTITION(YEar = 2015, month = 1) SELECT
1, 1")
+ checkAnswer(
Review comment:
nit: ` checkAnswer(sql("SELECT * FROM part_table"), Row(1, 1, 2015,
1))`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]