lvyanquan commented on code in PR #8967:
URL: https://github.com/apache/hudi/pull/8967#discussion_r1230351267
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/TestDeleteFromTable.scala:
##########
@@ -80,4 +82,36 @@ class TestDeleteFromTable extends HoodieSparkSqlTestBase {
}
})
}
+
+ test("Test deleting from empty table") {
+ withRecordType()(withTempDir { tmp =>
+ Seq("cow", "mor").foreach { tableType =>
+ val tableName = generateTableName
+ spark.sql(
+ s"""
+ |CREATE TABLE $tableName (
+ | id int,
+ | dt string,
+ | name string,
+ | price double,
+ | ts long
+ |) USING hudi
+ | tblproperties (
+ | primaryKey = 'id',
+ | tableType = '$tableType'
+ | )
+ | PARTITIONED BY (dt)
+ | LOCATION '${tmp.getCanonicalPath}'
+ """.stripMargin)
+
+
+ // Delete single row
+ spark.sql(s"DELETE FROM $tableName WHERE id = 1")
Review Comment:
Thanks for your suggestion😊. The code has been readjusted to address this
issue.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]