You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "shengsiwei (JIRA)" <ji...@apache.org> on 2018/04/18 07:51:00 UTC

[jira] [Resolved] (HIVE-19220) perfLogger = SessionState.getPerfLogger() in Driver.java need to combine

     [ https://issues.apache.org/jira/browse/HIVE-19220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

shengsiwei resolved HIVE-19220.
-------------------------------
    Resolution: Invalid

> perfLogger = SessionState.getPerfLogger() in Driver.java need to combine
> ------------------------------------------------------------------------
>
>                 Key: HIVE-19220
>                 URL: https://issues.apache.org/jira/browse/HIVE-19220
>             Project: Hive
>          Issue Type: Improvement
>    Affects Versions: 3.1.0
>            Reporter: shengsiwei
>            Assignee: shengsiwei
>            Priority: Minor
>
> I find  duplicate code in Driver.java. We need to eliminate duplicate code to improve the simplicity of the code
>  
> Before modification
> {code:java}
> PerfLogger perfLogger = null;
> if (!alreadyCompiled) {
>  // compile internal will automatically reset the perf logger
>  compileInternal(command, true);
>  // then we continue to use this perf logger
>  perfLogger = SessionState.getPerfLogger();
> } else {
>  // reuse existing perf logger.
>  perfLogger = SessionState.getPerfLogger();
>  // Since we're reusing the compiled plan, we need to update its start time for current run
>  plan.setQueryStartTime(perfLogger.getStartTime(PerfLogger.DRIVER_RUN));
> }
> {code}
>  
> After  modification 
>  
> {code:java}
> PerfLogger perfLogger = SessionState.getPerfLogger();
>       if (!alreadyCompiled) {
>         // compile internal will automatically reset the perf logger
>         compileInternal(command, true);
>       } else {
>         // Since we're reusing the compiled plan, we need to update its start time for current run
>         plan.setQueryStartTime(perfLogger.getStartTime(PerfLogger.DRIVER_RUN));
>       }
> {code}
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)