Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/18625 )
Change subject: IMPALA-11337: Flush row output before writing "Fetched X row(s)" ...................................................................... IMPALA-11337: Flush row output before writing "Fetched X row(s)" When redirecting stdout and stderr to a file, the existing code can sometimes output the "Fetched X row(s)" line before finishing the row output. e.g. impala-shell -B -q "select 1" >> outfile.txt 2>> outfile.txt The rows output goes to stdout while the control messages like "Fetched X row(s)" go to stderr. Since stdout can buffer output, that can delay the output. This adds a flush for stdout before writing the "Fetched X row(s)" message. Testing: - Added a shell test that redirects stdout and stderr to a file and verifies the contents. This consistently fails without the flush. - Other shell tests pass Change-Id: I83f89c110fd90d2d54331c7121e407d9de99146c Reviewed-on: http://gerrit.cloudera.org:8080/18625 Reviewed-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com> --- M shell/impala_shell.py M shell/shell_output.py M tests/shell/test_shell_commandline.py M tests/shell/util.py 4 files changed, 54 insertions(+), 10 deletions(-) Approvals: Impala Public Jenkins: Looks good to me, approved; Verified -- To view, visit http://gerrit.cloudera.org:8080/18625 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I83f89c110fd90d2d54331c7121e407d9de99146c Gerrit-Change-Number: 18625 Gerrit-PatchSet: 5 Gerrit-Owner: Joe McDonnell <joemcdonn...@cloudera.com> Gerrit-Reviewer: Abhishek Rawat <ara...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Joe McDonnell <joemcdonn...@cloudera.com> Gerrit-Reviewer: Michael Smith <michael.sm...@cloudera.com> Gerrit-Reviewer: Quanlong Huang <huangquanl...@gmail.com>