[ https://issues.apache.org/jira/browse/HIVE-23814?focusedWorklogId=457516&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-457516 ]
ASF GitHub Bot logged work on HIVE-23814: ----------------------------------------- Author: ASF GitHub Bot Created on: 11/Jul/20 04:53 Start Date: 11/Jul/20 04:53 Worklog Time Spent: 10m Work Description: pvary commented on a change in pull request #1222: URL: https://github.com/apache/hive/pull/1222#discussion_r453155585 ########## File path: ql/src/java/org/apache/hadoop/hive/ql/Driver.java ########## @@ -139,205 +119,215 @@ public Driver(QueryState queryState, QueryInfo queryInfo, HiveTxnManager txnMana driverTxnHandler = new DriverTxnHandler(this, driverContext, driverState); } - /** - * Compile a new query, but potentially reset taskID counter. Not resetting task counter - * is useful for generating re-entrant QL queries. - * @param command The HiveQL query to compile - * @param resetTaskIds Resets taskID counter if true. - * @return 0 for ok - */ - public int compile(String command, boolean resetTaskIds) { - try { - compile(command, resetTaskIds, false); - return 0; - } catch (CommandProcessorException cpr) { - return cpr.getErrorCode(); - } + @Override + public Context getContext() { + return context; } - // deferClose indicates if the close/destroy should be deferred when the process has been - // interrupted, it should be set to true if the compile is called within another method like - // runInternal, which defers the close to the called in that method. - @VisibleForTesting - public void compile(String command, boolean resetTaskIds, boolean deferClose) throws CommandProcessorException { - preparForCompile(resetTaskIds); - - Compiler compiler = new Compiler(context, driverContext, driverState); - QueryPlan plan = compiler.compile(command, deferClose); - driverContext.setPlan(plan); - - compileFinished(deferClose); + @Override + public HiveConf getConf() { + return driverContext.getConf(); } - private void compileFinished(boolean deferClose) { - if (DriverState.getDriverState().isAborted() && !deferClose) { - closeInProcess(true); - } + @Override + public CommandProcessorResponse run() throws CommandProcessorException { + return run(null, true); } - private void preparForCompile(boolean resetTaskIds) throws CommandProcessorException { - driverTxnHandler.createTxnManager(); - DriverState.setDriverState(driverState); - prepareContext(); - setQueryId(); + @Override + public CommandProcessorResponse run(String command) throws CommandProcessorException { Review comment: Javadoc maybe here too, but at least it is easier to understand :) ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 457516) Time Spent: 1h 40m (was: 1.5h) > Clean up Driver > --------------- > > Key: HIVE-23814 > URL: https://issues.apache.org/jira/browse/HIVE-23814 > Project: Hive > Issue Type: Sub-task > Components: Hive > Reporter: Miklos Gergely > Assignee: Miklos Gergely > Priority: Major > Labels: pull-request-available > Time Spent: 1h 40m > Remaining Estimate: 0h > > Driver is now cut down to it's minimal size by extracting all of it's sub > tasks to separate classes. The rest should be cleaned up by > * moving out some smaller parts of the code to sub task and utility classes > wherever it is still possible > * cut large functions to meaningful and manageable parts > * re-order the functions to follow the order of processing > * fix checkstyle issues > -- This message was sent by Atlassian Jira (v8.3.4#803005)