deniskuzZ commented on a change in pull request #2702:
URL: https://github.com/apache/hive/pull/2702#discussion_r723977965
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -215,29 +216,11 @@ void gatherStats() {
sb.setLength(sb.length() - 1); //remove trailing ,
LOG.info(ci + ": running '" + sb.toString() + "'");
conf.setVar(HiveConf.ConfVars.METASTOREURIS,"");
-
- //todo: use DriverUtils.runOnDriver() here
- QueryState queryState = new
QueryState.Builder().withGenerateNewQueryId(true).withHiveConf(conf).build();
- SessionState localSession = null;
- try (Driver d = new Driver(queryState)) {
- if (SessionState.get() == null) {
- localSession = new SessionState(conf);
- SessionState.start(localSession);
- }
- try {
- d.run(sb.toString());
- } catch (CommandProcessorException e) {
- LOG.warn(ci + ": " + sb.toString() + " failed due to: " + e);
- }
- } finally {
- if (localSession != null) {
- try {
- localSession.close();
- } catch (IOException ex) {
- LOG.warn(ci + ": localSession.close() failed due to: " +
ex.getMessage(), ex);
- }
- }
+ if (compactionQueueName != null && compactionQueueName.length() > 0) {
+ conf.set(TezConfiguration.TEZ_QUEUE_NAME, compactionQueueName);
}
+ SessionState sessionState = DriverUtils.setUpSessionState(conf,
userName, true);
Review comment:
oh, I can see it's closed inside of runOnDriver
--
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]