You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilder.scala
+10-3Lines changed: 10 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -101,9 +101,9 @@ object PrivilegesBuilder {
101
101
102
102
case p =>
103
103
for (child <- p.children) {
104
-
// If current plan's references don't have relation to it's input, have two case
105
-
// 1. Such as `MapInPandas`, `ScriptTransformation`
106
-
// 2. Project output only have constant value
104
+
// If current plan's references don't have relation to it's input, have two cases
105
+
// 1. `MapInPandas`, `ScriptTransformation`
106
+
// 2. `Project` output only have constant value
107
107
if (columnPrune(p.references.toSeq ++ p.output, p.inputSet).isEmpty) {
108
108
buildQuery(
109
109
child,
@@ -115,6 +115,13 @@ object PrivilegesBuilder {
115
115
buildQuery(
116
116
child,
117
117
privilegeObjects,
118
+
// Here we use `projectList ++ p.reference` do column prune since:
119
+
// For `Project`, project's output is contained by plan's referenced
120
+
// For `Aggregate`, aggregation's output also in it's reference.
121
+
// For `Filter`, `Sort` etc... it rely on upper `Project` node,
122
+
// so we wrap a `Project` before call `buildQuery()`.
123
+
// So here we use upper node's projectionList and current's references
124
+
// to do column pruning can get the correct column.
0 commit comments