Riza Suminto has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/22941 )

Change subject: IMPALA-14087: Fix shell live_progress output display issue on 
Python 3
......................................................................

IMPALA-14087: Fix shell live_progress output display issue on Python 3

When running the shell in a terminal with live_progress=true, live
progress overwrites its output by using the ANSI up character to
rewrite lines with updated on the query progress. On Python 3,
we found that the updates to clear the live progress were overwriting
the actual output in the terminal. e.g.

+----------+
| count(*) |
+----------+
Fetched 1 row(s) in 5.20s

To avoid this, the live progress lines need to be fully flushed to stderr
before starting to output the result to stdout. This adds a flush call
in OverwritingStdErrOutputStream::clear() to force this.

Testing:
 - Hand tested queries with live progress
 - Added test that redirects stdout and stderr to the same file and
   verifies that no ANSI up character comes after the query output

Change-Id: Id2e21224253f76b2a04767a57b3ade49ce2c914f
Reviewed-on: http://gerrit.cloudera.org:8080/22941
Tested-by: Impala Public Jenkins <[email protected]>
Reviewed-by: Riza Suminto <[email protected]>
---
M shell/impala_shell/shell_output.py
M tests/shell/test_shell_interactive.py
2 files changed, 25 insertions(+), 0 deletions(-)

Approvals:
  Impala Public Jenkins: Verified
  Riza Suminto: Looks good to me, approved

--
To view, visit http://gerrit.cloudera.org:8080/22941
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id2e21224253f76b2a04767a57b3ade49ce2c914f
Gerrit-Change-Number: 22941
Gerrit-PatchSet: 3
Gerrit-Owner: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Riza Suminto <[email protected]>

Reply via email to