From 7b73cb1d0a4819627e4758b49fcae06ccc62d8e0 Mon Sep 17 00:00:00 2001 From: "zhipeng.mao" Date: Tue, 30 Jul 2024 15:48:09 +0200 Subject: [PATCH] update --- .../apache/spark/sql/delta/IdentityColumnSyncSuite.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spark/src/test/scala/org/apache/spark/sql/delta/IdentityColumnSyncSuite.scala b/spark/src/test/scala/org/apache/spark/sql/delta/IdentityColumnSyncSuite.scala index 83c891930a..bc7f1e657e 100644 --- a/spark/src/test/scala/org/apache/spark/sql/delta/IdentityColumnSyncSuite.scala +++ b/spark/src/test/scala/org/apache/spark/sql/delta/IdentityColumnSyncSuite.scala @@ -59,17 +59,18 @@ trait IdentityColumnSyncSuiteBase test("alter table sync identity delta") { val starts = Seq(-1, 1) val steps = Seq(-3, 3) - for (start <- starts; step <- steps) { + val alterKeywords = Seq("ALTER", "CHANGE") + for (start <- starts; step <- steps; alterKeyword <- alterKeywords) { withSimpleGeneratedByDefaultTable(start, step) { // Test empty table. val oldSchema = DeltaLog.forTable(spark, TableIdentifier(tblName)).snapshot.schema - sql(s"ALTER TABLE $tblName ALTER COLUMN id SYNC IDENTITY") + sql(s"ALTER TABLE $tblName $alterKeyword COLUMN id SYNC IDENTITY") assert(DeltaLog.forTable(spark, TableIdentifier(tblName)).snapshot.schema == oldSchema) // Test a series of values that are not all following start and step configurations. for (i <- start to (start + step * 10)) { sql(s"INSERT INTO $tblName VALUES($i, 'v')") - sql(s"ALTER TABLE $tblName ALTER COLUMN id SYNC IDENTITY") + sql(s"ALTER TABLE $tblName $alterKeyword COLUMN id SYNC IDENTITY") val expected = start + (((i - start) + (step - 1)) / step) * step val schema = DeltaLog.forTable(spark, TableIdentifier(tblName)).snapshot.schema assert(schema("id").metadata.getLong(DeltaSourceUtils.IDENTITY_INFO_HIGHWATERMARK) ==