From 6d5f46092a4821d94c901de17add6f0d83faae72 Mon Sep 17 00:00:00 2001 From: "zhipeng.mao" Date: Wed, 31 Jul 2024 13:19:49 +0200 Subject: [PATCH] address comments --- .../main/scala/io/delta/sql/parser/DeltaSqlParser.scala | 2 +- .../apache/spark/sql/delta/IdentityColumnSyncSuite.scala | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spark/src/main/scala/io/delta/sql/parser/DeltaSqlParser.scala b/spark/src/main/scala/io/delta/sql/parser/DeltaSqlParser.scala index b06f7aa7af..b6c3611932 100644 --- a/spark/src/main/scala/io/delta/sql/parser/DeltaSqlParser.scala +++ b/spark/src/main/scala/io/delta/sql/parser/DeltaSqlParser.scala @@ -561,7 +561,7 @@ class DeltaSqlAstBuilder extends DeltaSqlBaseBaseVisitor[AnyRef] { } /** - * `ALTER TABLE ALTER COLUMN SYNC IDENTITY` command. + * `ALTER TABLE ... ALTER COLUMN ... SYNC IDENTITY` command. */ override def visitAlterTableSyncIdentity( ctx: AlterTableSyncIdentityContext): LogicalPlan = withOrigin(ctx) { 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 139615f805..9b8c279661 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 @@ -56,7 +56,7 @@ trait IdentityColumnSyncSuiteBase } } - test("alter table sync identity delta") { + test("alter table sync identity on delta table") { val starts = Seq(-1, 1) val steps = Seq(-3, 3) val alterKeywords = Seq("ALTER", "CHANGE") @@ -202,14 +202,14 @@ trait IdentityColumnSyncSuiteBase } } - test("alter table sync identity overflow") { + test("alter table sync identity overflow error") { withSimpleGeneratedByDefaultTable(startsWith = 1L, incrementBy = 10L) { sql(s"INSERT INTO $tblName VALUES (${Long.MaxValue}, 'a')") intercept[ArithmeticException](sql(s"ALTER TABLE $tblName ALTER COLUMN id SYNC IDENTITY")) } } - test("alter table sync identity non delta") { + test("alter table sync identity on non delta table error") { withTable(tblName) { sql( s""" @@ -226,7 +226,7 @@ trait IdentityColumnSyncSuiteBase } } - test("alter table sync identity non identity column") { + test("alter table sync identity on non identity column error") { withTable(tblName) { createTable( tblName,