[KYUUBI #6932] Test ALTER TBLPROPERTIES for Paimon

### Why are the changes needed?

AUTHZ Test Add/Change Table properties for PAIMON, check that has support the command
https://github.com/apache/kyuubi/issues/6932

### How was this patch tested?

Test Add/Change properties SQL

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

No

Closes #6933 from davidyuan1223/test_alter_tableproperties_for_paimin.

Closes #6932

4d64fbf23 [Cheng Pan] Update extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/PaimonCatalogRangerSparkExtensionSuite.scala
c861a778b [davidyuan] support add/change table properties for paimon

Lead-authored-by: davidyuan <yuanfuyuan@mafengwo.com>
Co-authored-by: Cheng Pan <pan3793@gmail.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
davidyuan 2025-02-24 14:31:49 +08:00 committed by Cheng Pan
parent 0f4906d1b0
commit ff3da59f63
No known key found for this signature in database
GPG Key ID: 8001952629BCC75D

View File

@ -121,6 +121,34 @@ class PaimonCatalogRangerSparkExtensionSuite extends RangerSparkExtensionSuite {
}
}
test("ALTER TBLPROPERTIES") {
withCleanTmpResources(Seq(
(s"$catalogV2.$namespace1.$table1", "table"))) {
val createTable = createTableSql(namespace1, table1)
doAs(admin, sql(createTable))
val addTblPropertiesSql =
s"""
|ALTER TABLE $catalogV2.$namespace1.$table1 SET TBLPROPERTIES(
| 'write-buffer-size' = '256 MB'
|)
|""".stripMargin
interceptEndsWith[AccessControlException] {
doAs(someone, sql(addTblPropertiesSql))
}(s"does not have [alter] privilege on [$namespace1/$table1]")
doAs(admin, sql(addTblPropertiesSql))
val changeTblPropertiesSql =
s"""
|ALTER TABLE $catalogV2.$namespace1.$table1 SET TBLPROPERTIES(
| 'write-buffer-size' = '128 MB'
|)
|""".stripMargin
interceptEndsWith[AccessControlException] {
doAs(someone, sql(changeTblPropertiesSql))
}(s"does not have [alter] privilege on [$namespace1/$table1]")
doAs(admin, sql(changeTblPropertiesSql))
}
}
def createTableSql(namespace: String, table: String): String =
s"""
|CREATE TABLE IF NOT EXISTS $catalogV2.$namespace.$table