[ https://issues.apache.org/jira/browse/HIVE-25595?focusedWorklogId=662014&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-662014 ]
ASF GitHub Bot logged work on HIVE-25595: ----------------------------------------- Author: ASF GitHub Bot Created on: 07/Oct/21 23:09 Start Date: 07/Oct/21 23:09 Worklog Time Spent: 10m Work Description: deniskuzZ commented on a change in pull request #2702: URL: https://github.com/apache/hive/pull/2702#discussion_r723961927 ########## File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorUtil.java ########## @@ -18,14 +18,19 @@ package org.apache.hadoop.hive.ql.txn.compactor; import com.google.common.util.concurrent.ThreadFactoryBuilder; +import org.apache.hadoop.hive.common.StringableMap; import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.metastore.api.Table; +import org.apache.hadoop.hive.metastore.txn.CompactionInfo; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; public class CompactorUtil { public static final String COMPACTOR = "compactor"; + static final String COMPACTOR_PREFIX = "compactor."; + static final String MAPRED_QUEUE_NAME = "mapred.job.queue.name"; Review comment: should it be MR specific or we can change to some generic name to be reused for query-based compaction? ########## 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: shouldn't we close the session at the end? ########## 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 662014) Time Spent: 1h 10m (was: 1h) > Custom queue settings is not honoured by compaction StatsUpdater > ----------------------------------------------------------------- > > Key: HIVE-25595 > URL: https://issues.apache.org/jira/browse/HIVE-25595 > Project: Hive > Issue Type: Bug > Reporter: László Pintér > Assignee: László Pintér > Priority: Major > Labels: pull-request-available > Time Spent: 1h 10m > Remaining Estimate: 0h > > In case of MR based compaction it is possible configure in which queue to > start the compaction job. This is achieved either by providing one of the > following: > * Setting hive global conf param hive.compactor.job.queue > * Providing a tbl level param with the name compactor.mapred.job.queue.name > * Running a manual compaction with additional properties > {code:sql} > ALTER TABLE acid_table COMPACT 'major' WITH > TBLPROPERTIES('compactor.mapred.job.queue.name'='some_queue') > {code} > When running the stat updater query as part of the compaction process, these > settings are not honoured, and the query is always assigned to the default > queue. -- This message was sent by Atlassian Jira (v8.3.4#803005)