Skip to content

Commit

Permalink
[KYUUBI #5512] [AuthZ] Remove the non-existent query specs in Deletes…
Browse files Browse the repository at this point in the history
… and Updates

### _Why are the changes needed?_

This PR removes the non-existent query specs in DeleteFromTable and UpdateTable, and all its derives, such as iceberg and hudi.

Timely stop abuse.

### _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

- [ ] [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 #5512 from yaooqinn/du.

Closes #5512

6277686 [Kent Yao] [AuthZ] Remove the non-existent query spec in Deletes and Updates

Authored-by: Kent Yao <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
  • Loading branch information
yaooqinn authored and pan3793 committed Oct 24, 2023
1 parent 71a4529 commit aecef5c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,7 @@
"setCurrentDatabaseIfMissing" : false
} ],
"opType" : "QUERY",
"queryDescs" : [ {
"fieldName" : "query",
"fieldExtractor" : "LogicalPlanQueryExtractor"
} ]
"queryDescs" : [ ]
}, {
"classname" : "org.apache.spark.sql.catalyst.plans.logical.DeleteFromTable",
"tableDescs" : [ {
Expand All @@ -247,10 +244,7 @@
"setCurrentDatabaseIfMissing" : false
} ],
"opType" : "QUERY",
"queryDescs" : [ {
"fieldName" : "query",
"fieldExtractor" : "LogicalPlanQueryExtractor"
} ]
"queryDescs" : [ ]
}, {
"classname" : "org.apache.spark.sql.catalyst.plans.logical.DescribeRelation",
"tableDescs" : [ {
Expand Down Expand Up @@ -658,10 +652,7 @@
"setCurrentDatabaseIfMissing" : false
} ],
"opType" : "QUERY",
"queryDescs" : [ {
"fieldName" : "query",
"fieldExtractor" : "LogicalPlanQueryExtractor"
} ]
"queryDescs" : [ ]
}, {
"classname" : "org.apache.spark.sql.catalyst.plans.logical.UpdateTable",
"tableDescs" : [ {
Expand All @@ -679,10 +670,7 @@
"setCurrentDatabaseIfMissing" : false
} ],
"opType" : "QUERY",
"queryDescs" : [ {
"fieldName" : "query",
"fieldExtractor" : "LogicalPlanQueryExtractor"
} ]
"queryDescs" : [ ]
}, {
"classname" : "org.apache.spark.sql.execution.command.AlterTableAddColumnsCommand",
"tableDescs" : [ {
Expand Down Expand Up @@ -1652,10 +1640,7 @@
"setCurrentDatabaseIfMissing" : false
} ],
"opType" : "QUERY",
"queryDescs" : [ {
"fieldName" : "query",
"fieldExtractor" : "LogicalPlanQueryExtractor"
} ]
"queryDescs" : [ ]
}, {
"classname" : "org.apache.spark.sql.hudi.command.DropHoodieTableCommand",
"tableDescs" : [ {
Expand Down Expand Up @@ -1795,8 +1780,5 @@
"setCurrentDatabaseIfMissing" : false
} ],
"opType" : "QUERY",
"queryDescs" : [ {
"fieldName" : "query",
"fieldExtractor" : "LogicalPlanQueryExtractor"
} ]
"queryDescs" : [ ]
} ]
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ object HudiCommands {
"dft",
classOf[HudiDataSourceV2RelationTableExtractor],
actionTypeDesc = Some(actionTypeDesc))
TableCommandSpec(cmd, Seq(tableDesc), queryDescs = Seq(QueryDesc("query")))
TableCommandSpec(cmd, Seq(tableDesc))
}

val UpdateHoodieTableCommand = {
Expand All @@ -185,7 +185,7 @@ object HudiCommands {
"ut",
classOf[HudiDataSourceV2RelationTableExtractor],
actionTypeDesc = Some(actionTypeDesc))
TableCommandSpec(cmd, Seq(tableDesc), queryDescs = Seq(QueryDesc("query")))
TableCommandSpec(cmd, Seq(tableDesc))
}

val MergeIntoHoodieTableCommand = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object IcebergCommands {
"table",
classOf[DataSourceV2RelationTableExtractor],
actionTypeDesc = Some(actionTypeDesc))
TableCommandSpec(cmd, Seq(tableDesc), queryDescs = Seq(QueryDesc("query")))
TableCommandSpec(cmd, Seq(tableDesc))
}

val UpdateIcebergTable = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ object TableCommands {
"table",
classOf[DataSourceV2RelationTableExtractor],
actionTypeDesc = Some(actionTypeDesc))
TableCommandSpec(cmd, Seq(tableDesc), queryDescs = Seq(queryQueryDesc))
TableCommandSpec(cmd, Seq(tableDesc))
}

val DeleteFromTable = {
Expand Down

0 comments on commit aecef5c

Please sign in to comment.