Skip to content

Commit 0bbe7fa

Browse files
baishuokayousterhout
authored andcommitted
[SPARK-3007][SQL]Add Dynamic Partition support to Spark Sql hive
a new PR base on new master. changes are the same as apache#1919 Author: baishuo(白硕) <[email protected]> Author: baishuo <[email protected]> Author: Cheng Lian <[email protected]> Closes apache#2226 from baishuo/patch-3007 and squashes the following commits: e69ce88 [Cheng Lian] Adds tests to verify dynamic partitioning folder layout b20a3dc [Cheng Lian] Addresses @yhuai's comments 096bbbc [baishuo(白硕)] Merge pull request #1 from liancheng/refactor-dp 1093c20 [Cheng Lian] Adds more tests 5004542 [Cheng Lian] Minor refactoring fae9eff [Cheng Lian] Refactors InsertIntoHiveTable to a Command 528e84c [Cheng Lian] Fixes typo in test name, regenerated golden answer files c464b26 [Cheng Lian] Refactors dynamic partitioning support 5033928 [baishuo] pass check style 2201c75 [baishuo] use HiveConf.DEFAULTPARTITIONNAME to replace hive.exec.default.partition.name b47c9bf [baishuo] modify according micheal's advice c3ab36d [baishuo] modify for some bad indentation 7ce2d9f [baishuo] modify code to pass scala style checks 37c1c43 [baishuo] delete a empty else branch 66e33fc [baishuo] do a little modify 88d0110 [baishuo] update file after test a3961d9 [baishuo(白硕)] Update Cast.scala f7467d0 [baishuo(白硕)] Update InsertIntoHiveTable.scala c1a59dd [baishuo(白硕)] Update Cast.scala 0e18496 [baishuo(白硕)] Update HiveQuerySuite.scala 60f70aa [baishuo(白硕)] Update InsertIntoHiveTable.scala 0a50db9 [baishuo(白硕)] Update HiveCompatibilitySuite.scala 491c7d0 [baishuo(白硕)] Update InsertIntoHiveTable.scala a2374a8 [baishuo(白硕)] Update InsertIntoHiveTable.scala 701a814 [baishuo(白硕)] Update SparkHadoopWriter.scala dc24c41 [baishuo(白硕)] Update HiveQl.scala
1 parent e43c72f commit 0bbe7fa

14 files changed

+443
-299
lines changed

sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,23 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter {
220220
*/
221221
override def whiteList = Seq(
222222
"add_part_exist",
223+
"dynamic_partition_skip_default",
224+
"infer_bucket_sort_dyn_part",
225+
"load_dyn_part1",
226+
"load_dyn_part2",
227+
"load_dyn_part3",
228+
"load_dyn_part4",
229+
"load_dyn_part5",
230+
"load_dyn_part6",
231+
"load_dyn_part7",
232+
"load_dyn_part8",
233+
"load_dyn_part9",
234+
"load_dyn_part10",
235+
"load_dyn_part11",
236+
"load_dyn_part12",
237+
"load_dyn_part13",
238+
"load_dyn_part14",
239+
"load_dyn_part14_win",
223240
"add_part_multiple",
224241
"add_partition_no_whitelist",
225242
"add_partition_with_whitelist",

sql/hive/src/main/scala/org/apache/spark/SparkHadoopWriter.scala

Lines changed: 0 additions & 195 deletions
This file was deleted.

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -837,11 +837,6 @@ private[hive] object HiveQl {
837837
cleanIdentifier(key.toLowerCase) -> None
838838
}.toMap).getOrElse(Map.empty)
839839

840-
if (partitionKeys.values.exists(p => p.isEmpty)) {
841-
throw new NotImplementedError(s"Do not support INSERT INTO/OVERWRITE with" +
842-
s"dynamic partitioning.")
843-
}
844-
845840
InsertIntoTable(UnresolvedRelation(db, tableName, None), partitionKeys, query, overwrite)
846841

847842
case a: ASTNode =>

0 commit comments

Comments
 (0)