kgyrtkirk commented on a change in pull request #848: HIVE-22486
URL: https://github.com/apache/hive/pull/848#discussion_r349891602
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveRelFieldTrimmer.java
 ##########
 @@ -674,10 +677,14 @@ public TrimResult trimFields(Project project, 
ImmutableBitSet fieldsUsed,
     // set columnAccessInfo for ViewColumnAuthorization
     for (Ord<RexNode> ord : Ord.zip(project.getProjects())) {
       if (fieldsUsed.get(ord.i)) {
-        if (this.columnAccessInfo != null && this.viewProjectToTableSchema != 
null
-            && this.viewProjectToTableSchema.containsKey(project)) {
+        if (this.viewProjectToTableSchema != null && 
this.viewProjectToTableSchema.containsKey(project)) {
           Table tab = this.viewProjectToTableSchema.get(project);
-          this.columnAccessInfo.add(tab.getCompleteName(), 
tab.getAllCols().get(ord.i).getName());
+          if (this.directColumnAccessInfo != null) {
+            this.directColumnAccessInfo.add(tab.getCompleteName(), 
tab.getAllCols().get(ord.i).getName());
+          }
+          if (this.allColumnAccessInfo != null) {
+            this.allColumnAccessInfo.add(tab.getCompleteName(), 
tab.getAllCols().get(ord.i).getName());
+          }
 
 Review comment:
   Cool!

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to