You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2018/01/23 01:52:25 UTC

impala git commit: IMPALA-3998: Remove refresh_after_connect option from shell

Repository: impala
Updated Branches:
  refs/heads/master 281f7ab01 -> 56464e461


IMPALA-3998: Remove refresh_after_connect option from shell

This removes the deprecated option in time for 3.0.

Testing:
Ran core tests. Manually ran the shell with the argument to confirm that
it reported "no such option".

Cherry-picks: not for 2.x.

Change-Id: I8f430bad0578e150d5e80066b9e7572041af4a15
Reviewed-on: http://gerrit.cloudera.org:8080/9072
Reviewed-by: Tim Armstrong <ta...@cloudera.com>
Tested-by: Impala Public Jenkins


Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/56464e46
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/56464e46
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/56464e46

Branch: refs/heads/master
Commit: 56464e4616ca624bc88faca9218ba75cb1ff582b
Parents: 281f7ab
Author: Tim Armstrong <ta...@cloudera.com>
Authored: Thu Jan 18 16:24:32 2018 -0800
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Tue Jan 23 01:48:50 2018 +0000

----------------------------------------------------------------------
 shell/impala_shell.py                 | 14 --------------
 shell/impala_shell_config_defaults.py |  1 -
 shell/option_parser.py                |  4 ----
 tests/shell/bad_impalarc              |  3 +--
 tests/shell/good_impalarc             |  1 -
 tests/shell/test_shell_commandline.py |  8 --------
 6 files changed, 1 insertion(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/56464e46/shell/impala_shell.py
----------------------------------------------------------------------
diff --git a/shell/impala_shell.py b/shell/impala_shell.py
index 93e10fc..a671f2a 100755
--- a/shell/impala_shell.py
+++ b/shell/impala_shell.py
@@ -151,7 +151,6 @@ class ImpalaShell(object, cmd.Cmd):
     self.server_version = ImpalaShell.UNKNOWN_SERVER_VERSION
     self.webserver_address = ImpalaShell.UNKNOWN_WEBSERVER
 
-    self.refresh_after_connect = options.refresh_after_connect
     self.current_db = options.default_db
     self.history_file = os.path.expanduser("~/.impalahistory")
     # Stores the state of user input until a delimiter is seen.
@@ -763,9 +762,6 @@ class ImpalaShell(object, cmd.Cmd):
       self._print_if_verbose('Connected to %s:%s' % self.impalad)
       self._print_if_verbose('Server version: %s' % self.server_version)
       self.prompt = "[%s:%s] > " % self.impalad
-      if self.refresh_after_connect:
-        self.cmdqueue.append('invalidate metadata' + ImpalaShell.CMD_DELIM)
-        print_to_stderr("Invalidating Metadata")
       self._validate_database()
     try:
       self.imp_client.build_default_query_options_dict()
@@ -1364,13 +1360,6 @@ Welcome to the Impala shell.
 """ \
   % (VERSION_STRING, _format_tip(random.choice(TIPS)))
 
-REFRESH_AFTER_CONNECT_DEPRECATION_WARNING = """
-+==========================================================================+
-| DEPRECATION WARNING:                                                     |
-| -r/--refresh_after_connect is deprecated and will be removed in a future |
-| version of Impala shell.                                                 |
-+==========================================================================+"""
-
 def print_to_stderr(message):
   print >> sys.stderr, message
 
@@ -1445,9 +1434,6 @@ def get_intro(options):
   if not options.ssl and options.creds_ok_in_clear and options.use_ldap:
     intro += ("\n\nLDAP authentication is enabled, but the connection to Impala is "
               "not secured by TLS.\nALL PASSWORDS WILL BE SENT IN THE CLEAR TO IMPALA.")
-
-  if options.refresh_after_connect:
-    intro += '\n'.join(REFRESH_AFTER_CONNECT_DEPRECATION_WARNING)
   return intro
 
 if __name__ == "__main__":

http://git-wip-us.apache.org/repos/asf/impala/blob/56464e46/shell/impala_shell_config_defaults.py
----------------------------------------------------------------------
diff --git a/shell/impala_shell_config_defaults.py b/shell/impala_shell_config_defaults.py
index c50ad87..c951477 100644
--- a/shell/impala_shell_config_defaults.py
+++ b/shell/impala_shell_config_defaults.py
@@ -38,7 +38,6 @@ impala_shell_defaults = {
             'print_summary' : False,
             'query': None,
             'query_file': None,
-            'refresh_after_connect': False,
             'show_profiles': False,
             'ssl': False,
             'use_kerberos': False,

http://git-wip-us.apache.org/repos/asf/impala/blob/56464e46/shell/option_parser.py
----------------------------------------------------------------------
diff --git a/shell/option_parser.py b/shell/option_parser.py
index a1c37d2..f39e0ce 100755
--- a/shell/option_parser.py
+++ b/shell/option_parser.py
@@ -22,7 +22,6 @@
 # [impala]
 # impalad=localhost:21002
 # verbose=false
-# refresh_after_connect=true
 #
 # [impala.query_options]
 # EXPLAIN_LEVEL=2
@@ -164,9 +163,6 @@ def get_option_parser(defaults):
                     help="Print version information")
   parser.add_option("-c", "--ignore_query_failure", dest="ignore_query_failure",
                     action="store_true", help="Continue on query failure")
-  parser.add_option("-r", "--refresh_after_connect", dest="refresh_after_connect",
-                    action="store_true",
-                    help="Refresh Impala catalog after connecting \t")
   parser.add_option("-d", "--database", dest="default_db",
                     help="Issues a use database command on startup \t")
   parser.add_option("-l", "--ldap", dest="use_ldap",

http://git-wip-us.apache.org/repos/asf/impala/blob/56464e46/tests/shell/bad_impalarc
----------------------------------------------------------------------
diff --git a/tests/shell/bad_impalarc b/tests/shell/bad_impalarc
index fa9ffe2..7fc331c 100644
--- a/tests/shell/bad_impalarc
+++ b/tests/shell/bad_impalarc
@@ -1,3 +1,2 @@
 version=true
-refresh_after_connect=true
-asdf
\ No newline at end of file
+asdf

http://git-wip-us.apache.org/repos/asf/impala/blob/56464e46/tests/shell/good_impalarc
----------------------------------------------------------------------
diff --git a/tests/shell/good_impalarc b/tests/shell/good_impalarc
index 7bc8cff..ea6a276 100644
--- a/tests/shell/good_impalarc
+++ b/tests/shell/good_impalarc
@@ -1,3 +1,2 @@
 [impala]
 query=select 1
-refresh_after_connect=true

http://git-wip-us.apache.org/repos/asf/impala/blob/56464e46/tests/shell/test_shell_commandline.py
----------------------------------------------------------------------
diff --git a/tests/shell/test_shell_commandline.py b/tests/shell/test_shell_commandline.py
index 513abdc..c2e7509 100644
--- a/tests/shell/test_shell_commandline.py
+++ b/tests/shell/test_shell_commandline.py
@@ -121,13 +121,6 @@ class TestImpalaShell(ImpalaTestSuite):
     result = run_impala_shell_cmd(args)
     assert "Query: use `parquet`" in result.stderr, result.stderr
 
-  @pytest.mark.execute_serially  # This tests invalidates metadata, and must run serially
-  def test_refresh_on_connect(self):
-    """Confirm that the -r option refreshes the catalog."""
-    args = '-r -q "%s"' % DEFAULT_QUERY
-    result = run_impala_shell_cmd(args)
-    assert 'Invalidating Metadata' in result.stderr, result.stderr
-
   def test_unsecure_message(self):
     results = run_impala_shell_cmd("")
     assert "Starting Impala Shell without Kerberos authentication" in results.stderr
@@ -420,7 +413,6 @@ class TestImpalaShell(ImpalaTestSuite):
     args = '--config_file=%s/good_impalarc' % QUERY_FILE_PATH
     result = run_impala_shell_cmd(args)
     assert 'Query: select 1' in result.stderr
-    assert 'Invalidating Metadata' in result.stderr
 
     # override option in config file through command line
     args = '--config_file=%s/good_impalarc --query="select 2"' % QUERY_FILE_PATH