impala-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mjac...@apache.org
Subject [2/3] incubator-impala git commit: IMPALA-4499: Table name missing from exec summary
Date Thu, 11 May 2017 00:04:30 GMT
IMPALA-4499: Table name missing from exec summary

For scan nodes, previously only HDFS tables showed the name
of the table in the 'Detail' section for the scan node. This
change adds the table name for all scan node types (Kudu,
HBase, and DataSource).

Testing:
- Added an e2e test in test_observability.

Change-Id: If4fd13f893aea4e7df8a2474d7136770660e4324
Reviewed-on: http://gerrit.cloudera.org:8080/6832
Reviewed-by: Thomas Tauber-Marshall <tmarshall@cloudera.com>
Reviewed-by: Alex Behm <alex.behm@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/49b6af54
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/49b6af54
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/49b6af54

Branch: refs/heads/master
Commit: 49b6af54c8194af34eacd5322dd6e2ea831f27f8
Parents: b8c8fb1
Author: Thomas Tauber-Marshall <tmarshall@cloudera.com>
Authored: Tue May 9 13:12:38 2017 -0700
Committer: Impala Public Jenkins <impala-public-jenkins@gerrit.cloudera.org>
Committed: Wed May 10 22:56:38 2017 +0000

----------------------------------------------------------------------
 .../org/apache/impala/planner/HdfsScanNode.java | 14 ------------
 .../org/apache/impala/planner/ScanNode.java     | 15 +++++++++++++
 tests/query_test/test_observability.py          | 23 ++++++++++++++++++++
 3 files changed, 38 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/49b6af54/fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
----------------------------------------------------------------------
diff --git a/fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java b/fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
index 40d750b..296dfb4 100644
--- a/fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
+++ b/fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
@@ -781,20 +781,6 @@ public class HdfsScanNode extends ScanNode {
   }
 
   @Override
-  protected String getDisplayLabelDetail() {
-    HdfsTable table = (HdfsTable) desc_.getTable();
-    List<String> path = Lists.newArrayList();
-    path.add(table.getDb().getName());
-    path.add(table.getName());
-    Preconditions.checkNotNull(desc_.getPath());
-    if (desc_.hasExplicitAlias()) {
-      return desc_.getPath().toString() + " " + desc_.getAlias();
-    } else {
-      return desc_.getPath().toString();
-    }
-  }
-
-  @Override
   protected String getNodeExplainString(String prefix, String detailPrefix,
       TExplainLevel detailLevel) {
     StringBuilder output = new StringBuilder();

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/49b6af54/fe/src/main/java/org/apache/impala/planner/ScanNode.java
----------------------------------------------------------------------
diff --git a/fe/src/main/java/org/apache/impala/planner/ScanNode.java b/fe/src/main/java/org/apache/impala/planner/ScanNode.java
index 985a03a..c1b6858 100644
--- a/fe/src/main/java/org/apache/impala/planner/ScanNode.java
+++ b/fe/src/main/java/org/apache/impala/planner/ScanNode.java
@@ -22,6 +22,7 @@ import java.util.List;
 import org.apache.impala.analysis.SlotDescriptor;
 import org.apache.impala.analysis.TupleDescriptor;
 import org.apache.impala.catalog.HdfsFileFormat;
+import org.apache.impala.catalog.Table;
 import org.apache.impala.catalog.Type;
 import org.apache.impala.common.NotImplementedException;
 import org.apache.impala.thrift.TExplainLevel;
@@ -188,4 +189,18 @@ abstract public class ScanNode extends PlanNode {
     if (getConjuncts().isEmpty() && hasLimit()) return getLimit();
     return inputCardinality_;
   }
+
+  @Override
+  protected String getDisplayLabelDetail() {
+    Table table = desc_.getTable();
+    List<String> path = Lists.newArrayList();
+    path.add(table.getDb().getName());
+    path.add(table.getName());
+    Preconditions.checkNotNull(desc_.getPath());
+    if (desc_.hasExplicitAlias()) {
+      return desc_.getPath().toString() + " " + desc_.getAlias();
+    } else {
+      return desc_.getPath().toString();
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/49b6af54/tests/query_test/test_observability.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_observability.py b/tests/query_test/test_observability.py
index 59e6a73..d2b27c3 100644
--- a/tests/query_test/test_observability.py
+++ b/tests/query_test/test_observability.py
@@ -50,3 +50,26 @@ class TestObservability(ImpalaTestSuite):
     assert result.exec_summary[5]['operator'] == '04:EXCHANGE'
     assert result.exec_summary[5]['num_rows'] == 25
     assert result.exec_summary[5]['est_num_rows'] == 25
+
+  def test_scan_summary(self):
+    """IMPALA-4499: Checks that the exec summary for scans show the table name."""
+    # HDFS table
+    query = "select count(*) from functional.alltypestiny"
+    result = self.execute_query(query)
+    scan_idx = len(result.exec_summary) - 1
+    assert result.exec_summary[scan_idx]['operator'] == '00:SCAN HDFS'
+    assert result.exec_summary[scan_idx]['detail'] == 'functional.alltypestiny'
+
+    # KUDU table
+    query = "select count(*) from functional_kudu.alltypestiny"
+    result = self.execute_query(query)
+    scan_idx = len(result.exec_summary) - 1
+    assert result.exec_summary[scan_idx]['operator'] == '00:SCAN KUDU'
+    assert result.exec_summary[scan_idx]['detail'] == 'functional_kudu.alltypestiny'
+
+    # HBASE table
+    query = "select count(*) from functional_hbase.alltypestiny"
+    result = self.execute_query(query)
+    scan_idx = len(result.exec_summary) - 1
+    assert result.exec_summary[scan_idx]['operator'] == '00:SCAN HBASE'
+    assert result.exec_summary[scan_idx]['detail'] == 'functional_hbase.alltypestiny'


Mime
View raw message