cloud-fan commented on a change in pull request #25979: [SPARK-29295][SQL]
Insert overwrite to Hive external table partition should delete old data
URL: https://github.com/apache/spark/pull/25979#discussion_r331887829
##########
File path:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
##########
@@ -2412,4 +2412,29 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils
with TestHiveSingleton {
}
}
}
+
+ test("SPARK-29295: insert overwrite external partition should not have old
data") {
+ withTable("test") {
+ withTempDir { f =>
+ sql("CREATE EXTERNAL TABLE test(id int) PARTITIONED BY (name string)
STORED AS " +
+ s"PARQUET LOCATION '${f.getAbsolutePath}'")
+
+ withSQLConf(HiveUtils.CONVERT_METASTORE_PARQUET.key -> "false") {
+ sql("INSERT OVERWRITE TABLE test PARTITION(name='n1') SELECT 1")
Review comment:
shall we fix the problem for dynamic partition as well? e.g. `INSERT TABLE
... PARTITION(p1=1,p2) ...`
----------------------------------------------------------------
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]