[
https://issues.apache.org/jira/browse/IMPALA-14087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17953809#comment-17953809
]
ASF subversion and git services commented on IMPALA-14087:
----------------------------------------------------------
Commit f4e75510948bdb72f2d5206161fee12e5b6d0888 in impala's branch
refs/heads/master from Joe McDonnell
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=f4e755109 ]
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]>
> impala-shell's progress output can overwrite terminal results on Python 3
> -------------------------------------------------------------------------
>
> Key: IMPALA-14087
> URL: https://issues.apache.org/jira/browse/IMPALA-14087
> Project: IMPALA
> Issue Type: Bug
> Components: Clients
> Affects Versions: Impala 5.0.0
> Reporter: Joe McDonnell
> Priority: Major
>
> When running impala-shell with Python 3 from a terminal, I see the last
> couple lines of output get overwritten when the live_progress is true. For
> example:
> {noformat}
> [localhost:21050] default> select count(*) from functional.alltypes a where
> id = sleep(5);
> Query: select count(*) from functional.alltypes a where id = sleep(5)
> Query submitted at: 2025-05-21 20:21:40 (Coordinator:
> http://joemcdonnell-22743:25000)
> Query state can be monitored at:
> http://joemcdonnell-22743:25000/query_plan?query_id=a84f988db62ef056:2f02ee4400000000
>
>
>
>
> +----------+
> | count(*) |
> +----------+
> Fetched 1 row(s) in 5.20s{noformat}
> It's not displaying the actual value for count(*). This doesn't happen when
> using live_progress=false. If I send the query output to a file via
> output_file, the file has the appropriate result.
> This has been around a while. It reproduces on 4.3.0 and maybe earlier (I
> didn't try earlier versions).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]