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 2017/08/24 02:48:11 UTC

[6/6] incubator-impala git commit: IMPALA-5784: Separate planner and user set query options in profile

IMPALA-5784: Separate planner and user set query options in profile

This separation will help the user better understand the query
runtime profile.

Testing:
Modified an existing test case.

Change-Id: Ibfc7832963fa0bd278a45c06a5a54e1bf40d8876
Reviewed-on: http://gerrit.cloudera.org:8080/7721
Reviewed-by: Matthew Jacobs <mj...@cloudera.com>
Reviewed-by: Dan Hecht <dh...@cloudera.com>
Tested-by: Impala Public Jenkins


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

Branch: refs/heads/master
Commit: c67b198a19eda12c99905c2b9db30cc86f6e332d
Parents: ff5e9b6
Author: Bikramjeet Vig <bi...@cloudera.com>
Authored: Thu Aug 17 18:28:27 2017 -0700
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Thu Aug 24 02:42:01 2017 +0000

----------------------------------------------------------------------
 be/src/service/client-request-state.cc            |  4 +++-
 tests/custom_cluster/test_admission_controller.py |  4 ++--
 tests/query_test/test_observability.py            | 16 ++++++++--------
 3 files changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/c67b198a/be/src/service/client-request-state.cc
----------------------------------------------------------------------
diff --git a/be/src/service/client-request-state.cc b/be/src/service/client-request-state.cc
index 013e552..60f799c 100644
--- a/be/src/service/client-request-state.cc
+++ b/be/src/service/client-request-state.cc
@@ -146,7 +146,9 @@ Status ClientRequestState::Exec(TExecRequest* exec_request) {
 
   profile_.AddChild(&server_profile_);
   summary_profile_.AddInfoString("Query Type", PrintTStmtType(stmt_type()));
-  summary_profile_.AddInfoString("Query Options (non default)",
+  summary_profile_.AddInfoString("Query Options (set by configuration)",
+      DebugQueryOptions(query_ctx_.client_request.query_options));
+  summary_profile_.AddInfoString("Query Options (set by configuration and planner)",
       DebugQueryOptions(exec_request_.query_options));
 
   switch (exec_request->stmt_type) {

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/c67b198a/tests/custom_cluster/test_admission_controller.py
----------------------------------------------------------------------
diff --git a/tests/custom_cluster/test_admission_controller.py b/tests/custom_cluster/test_admission_controller.py
index ff4f4c6..cf072b9 100644
--- a/tests/custom_cluster/test_admission_controller.py
+++ b/tests/custom_cluster/test_admission_controller.py
@@ -84,7 +84,7 @@ _STATESTORED_ARGS = "-statestore_heartbeat_frequency_ms=%s "\
                     (STATESTORE_RPC_FREQUENCY_MS, STATESTORE_RPC_FREQUENCY_MS)
 
 # Key in the query profile for the query options.
-PROFILE_QUERY_OPTIONS_KEY = "Query Options (non default): "
+PROFILE_QUERY_OPTIONS_KEY = "Query Options (set by configuration): "
 
 def impalad_admission_ctrl_flags(max_requests, max_queued, pool_max_mem,
     proc_mem_limit = None):
@@ -153,7 +153,7 @@ class TestAdmissionController(TestAdmissionControllerBase, HS2TestSuite):
         rhs = re.split(": ", line)[1]
         confs = re.split(",", rhs)
         break
-    assert len(confs) >= len(expected_query_options)
+    assert len(confs) == len(expected_query_options)
     confs = map(str.lower, confs)
     for expected in expected_query_options:
       assert expected.lower() in confs,\

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/c67b198a/tests/query_test/test_observability.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_observability.py b/tests/query_test/test_observability.py
index 5a82a25..cf0527b 100644
--- a/tests/query_test/test_observability.py
+++ b/tests/query_test/test_observability.py
@@ -98,13 +98,13 @@ class TestObservability(ImpalaTestSuite):
     """Test that the query profile shows expected non-default query options, both set
     explicitly through client and those set by planner"""
     # Set a query option explicitly through client
-    self.execute_query("set mem_limit = 8589934592")
-    # For this query, the planner sets NUM_NODES=1, NUM_SCANNER_THREADS=1 and
-    # RUNTIME_FILTER_MODE=0
-    expected_string = "Query Options (non default): MEM_LIMIT=8589934592,NUM_NODES=1," \
-        "NUM_SCANNER_THREADS=1,RUNTIME_FILTER_MODE=0,MT_DOP=0\n"
-    assert expected_string in self.execute_query("select 1").runtime_profile
-
+    self.execute_query("set MEM_LIMIT = 8589934592")
     # Make sure explicitly set default values are not shown in the profile
     self.execute_query("set MAX_IO_BUFFERS = 0")
-    assert expected_string in self.execute_query("select 1").runtime_profile
+    runtime_profile = self.execute_query("select 1").runtime_profile
+    assert "Query Options (set by configuration): MEM_LIMIT=8589934592" in runtime_profile
+    # For this query, the planner sets NUM_NODES=1, NUM_SCANNER_THREADS=1,
+    # RUNTIME_FILTER_MODE=0 and MT_DOP=0
+    assert "Query Options (set by configuration and planner): MEM_LIMIT=8589934592," \
+        "NUM_NODES=1,NUM_SCANNER_THREADS=1,RUNTIME_FILTER_MODE=0,MT_DOP=0\n" \
+        in runtime_profile