-
Notifications
You must be signed in to change notification settings - Fork 913
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KYUUBI #5565][AUTHZ] Support Delete/Insert/Update table command for …
…Delta Lake ### _Why are the changes needed?_ To close #5565. - Support Delete from table command for Delta Lake in Authz. - Support Insert table command for Delta Lake in Authz. - Support Update table command for Delta Lake in Authz. - Reduce the fields of `createTableSql`. ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request ### _Was this patch authored or co-authored using generative AI tooling?_ No. Closes #5596 from zml1206/KYUUBI-5565-2. Closes #5565 452d7d8 [zml1206] ut add do as with admin 2572005 [zml1206] improve SubqueryAliasTableExtractor e2a3fe0 [zml1206] Support Delete/Insert/Update table command for Delta Lake Authored-by: zml1206 <zhuml1206@gmail.com> Signed-off-by: Kent Yao <yao@apache.org>
- Loading branch information
Showing
6 changed files
with
205 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...i-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/gen/DeltaCommands.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.kyuubi.plugin.spark.authz.gen | ||
|
||
import org.apache.kyuubi.plugin.spark.authz.PrivilegeObjectActionType._ | ||
import org.apache.kyuubi.plugin.spark.authz.serde._ | ||
|
||
object DeltaCommands extends CommandSpecs[TableCommandSpec] { | ||
|
||
val DeleteCommand = { | ||
val cmd = "org.apache.spark.sql.delta.commands.DeleteCommand" | ||
val actionTypeDesc = ActionTypeDesc(actionType = Some(UPDATE)) | ||
val tableDesc = TableDesc( | ||
"catalogTable", | ||
classOf[CatalogTableOptionTableExtractor], | ||
actionTypeDesc = Some(actionTypeDesc)) | ||
TableCommandSpec(cmd, Seq(tableDesc)) | ||
val targetDesc = TableDesc( | ||
"target", | ||
classOf[SubqueryAliasTableExtractor], | ||
actionTypeDesc = Some(actionTypeDesc)) | ||
TableCommandSpec(cmd, Seq(tableDesc, targetDesc)) | ||
} | ||
|
||
val UpdateCommand = { | ||
val cmd = "org.apache.spark.sql.delta.commands.UpdateCommand" | ||
DeleteCommand.copy(classname = cmd) | ||
} | ||
|
||
override def specs: Seq[TableCommandSpec] = Seq( | ||
DeleteCommand, | ||
UpdateCommand) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters