YannByron commented on code in PR #2512:
URL: https://github.com/apache/incubator-paimon/pull/2512#discussion_r1429565203
##########
paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/sql/DeleteFromTableTest.scala:
##########
@@ -180,4 +180,24 @@ class DeleteFromTableTest extends PaimonSparkTestBase {
val rows4 = spark.sql("SELECT * FROM T ORDER BY id").collectAsList()
assertThat(rows4.toString).isEqualTo("[]")
}
+
+ test(s"test delete with sequence field") {
+ spark.sql(
+ s"""
+ |CREATE TABLE T (id INT, name STRING, ts TIMESTAMP)
+ |TBLPROPERTIES ('primary-key' = 'id', 'sequence.field' = 'ts',
'sequence.auto-padding' = 'inc-seq')
+ |""".stripMargin)
+
+ spark.sql("INSERT INTO T VALUES (1, 'a', CAST('2023-12-15 10:00:00' AS
TIMESTAMP))")
+
+ spark.sql("INSERT INTO T VALUES (2, 'b', CAST('2023-12-15 10:00:01' AS
TIMESTAMP))")
+
+ spark.sql("INSERT INTO T VALUES (3, 'c', CAST('2023-12-15 10:00:02' AS
TIMESTAMP))")
+
+ spark.sql("DELETE FROM T WHERE id = 1")
+
+ val rows1 = spark.sql("SELECT * FROM T").collectAsList()
Review Comment:
please use `checkDataset` or `checkAnswer` to replace `collectAsList +
assertThat`.
--
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]