AngersZhuuuu commented on code in PR #5504:
URL: https://github.com/apache/kyuubi/pull/5504#discussion_r1371495893
##########
extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilder.scala:
##########
@@ -65,49 +65,65 @@ object PrivilegesBuilder {
def mergeProjection(table: Table, plan: LogicalPlan): Unit = {
if (projectionList.isEmpty) {
- privilegeObjects += PrivilegeObject(table, plan.output.map(_.name))
+ plan match {
+ case pvm: PermanentViewMarker if pvm.output.isEmpty =>
+ privilegeObjects += PrivilegeObject(table,
pvm.catalogTable.schema.map(_.name))
+ case _ =>
+ privilegeObjects += PrivilegeObject(table, plan.output.map(_.name))
+ }
} else {
val cols = (projectionList ++ conditionList).flatMap(collectLeaves)
.filter(plan.outputSet.contains).map(_.name).distinct
privilegeObjects += PrivilegeObject(table, cols)
}
}
+ // Should execute this for all plan and skip PermanentViewMaker
Review Comment:
> Maybe we should move it to the end of this method? The final project list
should be calculated first.
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]