abstractdog commented on code in PR #4626:
URL: https://github.com/apache/hive/pull/4626#discussion_r1308347289


##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/QueryCompactor.java:
##########
@@ -97,6 +97,7 @@ void runCompactionQueries(HiveConf conf, String tmpTableName, 
StorageDescriptor
     Util.overrideConfProps(conf, compactionInfo, tblProperties);
     String user = compactionInfo.runAs;
     SessionState sessionState = DriverUtils.setUpSessionState(conf, user, 
true);
+    sessionState.setCompactionSession(true);

Review Comment:
   SemanticAnalyzer is used for all queries (even if Worker is a 
compaction-only class), and SessionState is shared between queries, isn't it?
   so I'm afraid the fact that Worker is a compaction class doesn't make us 
sure that compactionSession is handled properly, it should be confirmed that a 
user cannot hack ranger policies by doing something like:
   1. run a compaction manually -> SessionState.setCompactionSession(true)
   2. run a query that involves ranger filtering -> what is 
SessionState.get().isCompactionSession() here?
   



-- 
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]

Reply via email to