[ 
https://issues.apache.org/jira/browse/HIVE-11710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14739314#comment-14739314
 ] 

Aihua Xu commented on HIVE-11710:
---------------------------------

Thanks Xuefu for reviewing the code.

Actually it's following magic line which sets sessionState.err to System.err 
while we didn't set sessionState.info. 

{noformat}
      // TODO: for hadoop jobs, progress is printed out to session.err,         
74            // we should find a way to feed back job progress to client       
        
75            sessionState.err = new PrintStream(System.err, true, "UTF-8");
{noformat}

In SessionState class, it will redirect to System.err for info stream when 
SessionState.info is null.

{noformat}
    public static PrintStream getInfoStream() {
      SessionState ss = SessionState.get();
      return ((ss != null) && (ss.info != null)) ? ss.info : getErrStream();
    }
{noformat}

After taking a close look, the patch may not be a perfect fix. Actually 
SessionState.err was closed after set command (in HiveCommandOperation.java), 
but the object itself is left there. So when info is null and err is not null 
(but invalid), nothing is printed. Maybe we should recover SessionState.err 
after the set command is done.



> Beeline embedded mode doesn't output query progress after setting any session 
> property
> --------------------------------------------------------------------------------------
>
>                 Key: HIVE-11710
>                 URL: https://issues.apache.org/jira/browse/HIVE-11710
>             Project: Hive
>          Issue Type: Bug
>          Components: Beeline
>    Affects Versions: 2.0.0
>            Reporter: Aihua Xu
>            Assignee: Aihua Xu
>         Attachments: HIVE-11710.patch
>
>
> Connect to beeline embedded mode {{beeline -u jdbc:hive2://}}. Then set 
> anything in the session like {{set aa=true;}}.
> After that, any query like {{select count(*) from src;}} will only output 
> result but no query progress.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to