Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AUTHZ] Support CreateTableAs command for Paimon #5590

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,37 @@ class PaimonCatalogRangerSparkExtensionSuite extends RangerSparkExtensionSuite {
interceptContains[AccessControlException] {
doAs(someone, sql(createTable))
}(s"does not have [create] privilege on [$namespace1/$table1]")
doAs(admin, createTable)
doAs(admin, sql(createTable))
}
}

test("CreateTableAs") {
val table2 = "table2"
withCleanTmpResources(Seq(
(s"$catalogV2.$namespace1.$table1", "table"),
(s"$catalogV2.$namespace1.$table2", "table"))) {
doAs(
admin,
sql(
s"""
|CREATE TABLE IF NOT EXISTS $catalogV2.$namespace1.$table1
|(id int, name string, city string)
|USING paimon
|OPTIONS (
| primaryKey = 'id'
|)
|""".stripMargin))
val createTableAs =
s"""
|CREATE TABLE IF NOT EXISTS $catalogV2.$namespace1.$table2
|USING PAIMON
|AS
|SELECT * FROM $catalogV2.$namespace1.$table1
|""".stripMargin
interceptContains[AccessControlException] {
doAs(someone, sql(createTableAs))
}(s"does not have [select] privilege on [$table1/id]")
doAs(admin, sql(createTableAs))
}
}
}
Loading