Skip to content

Commit

Permalink
[KYUUBI #6948] Test Changing Column Comment
Browse files Browse the repository at this point in the history
### Why are the changes needed?

Range check Test case missing paimon changing column comment, add the test case
#6948

### How was this patch tested?

Test Ranger check with paimon changing column comment command

### Was this patch authored or co-authored using generative AI tooling?

No

This patch had conflicts when merged, resolved by
Committer: Cheng Pan <[email protected]>

Closes #6953 from davidyuan1223/test_changing_column_comment.

Closes #6948

983720e [davidyuan] test changing column comment

Authored-by: davidyuan <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
  • Loading branch information
davidyuan1223 authored and pan3793 committed Mar 6, 2025
1 parent 1b3de28 commit 65d4b33
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,23 @@ class PaimonCatalogRangerSparkExtensionSuite extends RangerSparkExtensionSuite {
}
}

test("Changing Column Comment") {
withCleanTmpResources(Seq(
(s"$catalogV2.$namespace1.$table1", "table"))) {
val createTable = createTableSql(namespace1, table1)
doAs(admin, sql(createTable))
val changingColumnCommentSql =
s"""
|ALTER TABLE $catalogV2.$namespace1.$table1
|ALTER COLUMN name COMMENT "test comment"
|""".stripMargin
interceptEndsWith[AccessControlException] {
doAs(someone, sql(changingColumnCommentSql))
}(s"does not have [alter] privilege on [$namespace1/$table1]")
doAs(admin, sql(changingColumnCommentSql))
}
}

def createTableSql(namespace: String, table: String): String =
s"""
|CREATE TABLE IF NOT EXISTS $catalogV2.$namespace.$table
Expand Down

0 comments on commit 65d4b33

Please sign in to comment.