[
https://issues.apache.org/jira/browse/HIVE-11710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14959103#comment-14959103
]
Aihua Xu commented on HIVE-11710:
---------------------------------
Seems HIVE-11579 fixed one related issue, but the current incorrect behavior
still exists. 1. There could be temp file handler leaking from
HIveCommandOption class if somehow there are exception. 2. We still need to
reset SessionState.out/info/err to System.out/err in SQLOperation, otherwise
for embedded mode, the beeline client output will be redirected to the files,
not to the console.
[~Ferd] You worked on HIVE-11579 recently and probably know that code well.
There is a possibility that the temp file handlers are not closed if there is
an exception during the following code, correct? And also we need to flush the
output rather than closing the stream if the stream points to System.out/.err.
right?
{noformat}
sessionState.out =
new PrintStream(new
FileOutputStream(sessionState.getTmpOutputFile()), true, CharEncoding.UTF_8);
sessionState.err =
new PrintStream(new
FileOutputStream(sessionState.getTmpErrOutputFile()), true,CharEncoding.UTF_8);
{noformat}
[~xuefuz] Sorry. Didn't get time to work on that. MyPrintStream class will be
cleaner, but it's not easy to differentiate if it's file based or not from the
stream itself since System.out or System.err can also point to file based
stream as well. So it's tight to the class HiveCommandOperation class
themselves and we may need to pass a flag "flushOnClose" to the MyPrintStream
class. Let me look into that.
> 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.2.patch, HIVE-11710.3.patch, 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)