You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by st...@apache.org on 2022/08/08 23:37:02 UTC

[impala] 05/27: IMPALA-11305: Fix TypeError in impala-shell summary progress

This is an automated email from the ASF dual-hosted git repository.

stigahuang pushed a commit to branch branch-4.1.1
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 41a2352a79509a94c19d3d6a1388c52512465f50
Author: Riza Suminto <ri...@cloudera.com>
AuthorDate: Thu May 19 21:12:32 2022 -0700

    IMPALA-11305: Fix TypeError in impala-shell summary progress
    
    impala-shell fail with TypeError when installed with python3. This is
    due to behavior change of division operator ('/') between python2 vs
    python3. This patch fix the issue by changing the operator with floor
    division ('//') that result in integer type as described in
    https://peps.python.org/pep-0238/.
    
    Testing:
    - Manually install impala-shell with from pip with python3 and verify
      the fix works.
    
    Change-Id: Ifbe4df6a7a4136e590f383fc6475e2283e35eadc
    Reviewed-on: http://gerrit.cloudera.org:8080/18546
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Reviewed-by: Michael Smith <mi...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 shell/impala_shell.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shell/impala_shell.py b/shell/impala_shell.py
index 55387b602..7bf891d56 100755
--- a/shell/impala_shell.py
+++ b/shell/impala_shell.py
@@ -1246,7 +1246,7 @@ class ImpalaShell(cmd.Cmd, object):
           return
 
         if self.live_progress and progress.total_scan_ranges > 0:
-          val = ((summary.progress.num_completed_scan_ranges * 100) /
+          val = ((summary.progress.num_completed_scan_ranges * 100) //
                  summary.progress.total_scan_ranges)
           fragment_text = "[%s%s] %s%%\n" % ("#" * val, " " * (100 - val), val)
           data += fragment_text