From cd9f3f578ef1bceeb5c48354fb9d2d6292ff5155 Mon Sep 17 00:00:00 2001 From: Peter Rozsa Date: Fri, 31 Mar 2023 16:26:49 +0200 Subject: [PATCH] IMPALA-11435: Suppress logging for 'thrift' in impala-shell This change removes the "No handlers could be found for logger "thrift.transport.sslcompat" notification from impala-shell when SSL is enabled, by adding a NullHandler to logger 'thrift'. Change-Id: Idaa0871751969ec3a3aa8b44fe35f0743c03c547 Reviewed-on: http://gerrit.cloudera.org:8080/19671 Reviewed-by: Daniel Becker Reviewed-by: Joe McDonnell Tested-by: Impala Public Jenkins --- shell/impala_shell.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shell/impala_shell.py b/shell/impala_shell.py index 066dcb0ad..6e6d38c44 100755 --- a/shell/impala_shell.py +++ b/shell/impala_shell.py @@ -25,6 +25,7 @@ from compatibility import _xrange as xrange import cmd import errno import getpass +import logging import os import prettytable import random @@ -2173,6 +2174,9 @@ def impala_shell_main(): intro = get_intro(options) + # Suppressing unwanted notifications from Thrift + logging.getLogger('thrift').addHandler(logging.NullHandler()) + with ImpalaShell(options, query_options) as shell: while shell.is_alive: try: