1. [SPARK-26307][SQL] Fix CTAS when INSERT a partitioned table using Hive (commit: 3772d9322cc751c0f7c1703b95023dd4527a0fac) (details)
Commit 3772d9322cc751c0f7c1703b95023dd4527a0fac by wenchen
[SPARK-26307][SQL] Fix CTAS when INSERT a partitioned table using Hive
This is a  Spark 2.3 regression introduced in We should add the partition
info for InsertIntoHiveTable in CreateHiveTableAsSelectCommand.
Otherwise, we will hit the following error by running the newly added
test case:
[info] - CTAS: INSERT a partitioned table using Hive serde *** FAILED
*** (829 milliseconds)
[info]   org.apache.spark.SparkException: Requested partitioning does
not match the tab1 table:
[info] Requested partitions:
[info] Table partitions: part
[info]   at
[info]   at
Added a test case.
Closes #23255 from gatorsmile/fixCTAS.
Authored-by: gatorsmile <> Signed-off-by: Wenchen
Fan <>
(cherry picked from commit 3bc83de3cce86a06c275c86b547a99afd781761f)
Signed-off-by: Wenchen Fan <>
(commit: 3772d9322cc751c0f7c1703b95023dd4527a0fac)
The file was modifiedsql/hive/src/test/scala/org/apache/spark/sql/hive/InsertSuite.scala (diff)
The file was modifiedsql/hive/src/main/scala/org/apache/spark/sql/hive/execution/CreateHiveTableAsSelectCommand.scala (diff)