Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zhipengmao-db committed Aug 1, 2024
1 parent 7d8be4b commit 4b849f6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ class DeltaSqlAstBuilder extends DeltaSqlBaseBaseVisitor[AnyRef] {
}

/**
* `ALTER TABLE ... ALTER COLUMN ... SYNC IDENTITY` command.
* `ALTER TABLE ... ALTER (CHANGE) COLUMN ... SYNC IDENTITY` command.
*/
override def visitAlterTableSyncIdentity(
ctx: AlterTableSyncIdentityContext): LogicalPlan = withOrigin(ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ case class SyncIdentity(fieldNames: Array[String]) extends ColumnChange {
require(fieldNames.size == 1, "IDENTITY column cannot be a nested column.")
}

case class AlterColumnSyncIdentity(
table: LogicalPlan,
column: FieldName)
extends AlterTableCommand {
case class AlterColumnSyncIdentity(table: LogicalPlan, column: FieldName)
extends AlterTableCommand {
override def changes: Seq[TableChange] = {
require(column.resolved, "FieldName should be resolved before it's converted to TableChange.")
val colName = column.name.toArray
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ trait IdentityColumnSyncSuiteBase
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"))
assertThrows[ArithmeticException] {
sql(s"ALTER TABLE $tblName ALTER COLUMN id SYNC IDENTITY")
}
}
}

Expand Down

0 comments on commit 4b849f6

Please sign in to comment.