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/02/21 01:42:52 UTC

[1/2] impala git commit: IMPALA-6424: Avoid loading metadata twice when refreshing unloaded tables

Repository: impala
Updated Branches:
  refs/heads/2.x 96991ed8f -> 78a3dd819


IMPALA-6424: Avoid loading metadata twice when refreshing unloaded tables

This commit fixes an issue where table metadata are loaded twice if a
REFRESH statement is executed on an unloaded table. With this fix, we
initially check the state of the table (loaded, unloaded) and we only
refresh metadata if the table is in a loaded state. If table is
unloaded, we load the metadata from scratch.

Testing:
Run exhaustive tests

Change-Id: Ie41a734493dcea0e36d6b051966f1d0302907dee
Reviewed-on: http://gerrit.cloudera.org:8080/9224
Reviewed-by: Dimitris Tsirogiannis <dt...@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/78a3dd81
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/78a3dd81
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/78a3dd81

Branch: refs/heads/2.x
Commit: 78a3dd819d482ed2dc90c12248a8aa0132c61a3a
Parents: aa134cd
Author: Dimitris Tsirogiannis <dt...@cloudera.com>
Authored: Mon Feb 5 10:20:13 2018 -0800
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Tue Feb 20 22:10:17 2018 +0000

----------------------------------------------------------------------
 .../impala/service/CatalogOpExecutor.java       | 28 ++++++++++++++++----
 1 file changed, 23 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/78a3dd81/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java
----------------------------------------------------------------------
diff --git a/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java b/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java
index f1422db..69137ef 100644
--- a/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java
+++ b/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java
@@ -3095,12 +3095,30 @@ public class CatalogOpExecutor {
       TCatalogObject updatedThriftTable = null;
       if (req.isIs_refresh()) {
         TableName tblName = TableName.fromThrift(req.getTable_name());
-        Table tbl = getExistingTable(tblName.getDb(), tblName.getTbl());
+        // Quick check to see if the table exists in the catalog without triggering
+        // a table load.
+        Table tbl = catalog_.getTable(tblName.getDb(), tblName.getTbl());
         if (tbl != null) {
-          if (req.isSetPartition_spec()) {
-            updatedThriftTable = catalog_.reloadPartition(tbl, req.getPartition_spec());
-          } else {
-            updatedThriftTable = catalog_.reloadTable(tbl);
+          // If the table is not loaded, no need to perform refresh after the initial
+          // metadata load.
+          boolean needsRefresh = tbl.isLoaded();
+          tbl = getExistingTable(tblName.getDb(), tblName.getTbl());
+          if (tbl != null) {
+            if (needsRefresh) {
+              if (req.isSetPartition_spec()) {
+                updatedThriftTable = catalog_.reloadPartition(tbl, req.getPartition_spec());
+              } else {
+                updatedThriftTable = catalog_.reloadTable(tbl);
+              }
+            } else {
+              // Table was loaded from scratch, so it's already "refreshed".
+              tbl.getLock().lock();
+              try {
+                updatedThriftTable = tbl.toTCatalogObject();
+              } finally {
+                tbl.getLock().unlock();
+              }
+            }
           }
         }
       } else {


[2/2] impala git commit: IMPALA-6499: [DOCS] Fixed formatting errors in split_part function

Posted by ta...@apache.org.
IMPALA-6499: [DOCS] Fixed formatting errors in split_part function

Change-Id: I7623e32aaf31f21a3be4513f26deb0b789a56b1a
Reviewed-on: http://gerrit.cloudera.org:8080/9275
Reviewed-by: John Russell <jr...@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/aa134cd6
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/aa134cd6
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/aa134cd6

Branch: refs/heads/2.x
Commit: aa134cd6cc00f0ec6750ab509c1190204dffd1af
Parents: 96991ed
Author: Alex Rodoni <ar...@cloudera.com>
Authored: Fri Feb 9 17:17:54 2018 -0800
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Tue Feb 20 22:10:17 2018 +0000

----------------------------------------------------------------------
 docs/topics/impala_string_functions.xml | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/aa134cd6/docs/topics/impala_string_functions.xml
----------------------------------------------------------------------
diff --git a/docs/topics/impala_string_functions.xml b/docs/topics/impala_string_functions.xml
index 4a15167..a424683 100644
--- a/docs/topics/impala_string_functions.xml
+++ b/docs/topics/impala_string_functions.xml
@@ -1061,11 +1061,10 @@ select replace('hello world','xyz','abc');
 
         <dd>
           <indexterm audience="hidden">split_part() function</indexterm>
-          <b>Purpose:</b> Returns the nth field within a delimited string.
-          The fields are numbered starting from 1.
-          The delimiter can consist of multiple characters, not just a
-          single character. All matching of the delimiter is done exactly, not using any
-          regular expression patterns.
+          <b>Purpose:</b> Returns the nth field within a delimited string. The
+          fields are numbered starting from 1. The delimiter can consist of
+          multiple characters, not just a single character. All matching of the
+          delimiter is done exactly, not using any regular expression patterns.
           <p>
             <b>Return type:</b> <codeph>string</codeph>
           </p>
@@ -1074,7 +1073,8 @@ select replace('hello world','xyz','abc');
           <p conref="../shared/impala_common.xml#common/regexp_escapes"/>
           <p conref="../shared/impala_common.xml#common/example_blurb"/>
           <p>
-            These examples show how to retrieve the nth field from a delimited string:
+            These examples show how to retrieve the nth field from a delimited
+            string:
           </p>
 <codeblock><![CDATA[
 select split_part('x,y,z',',',1);
@@ -1097,8 +1097,8 @@ select split_part('x,y,z',',',3);
 +-----------------------------+
 | z                           |
 +-----------------------------+
+]]>
 </codeblock>
-
           <p>
             These examples show what happens for out-of-range field positions.
             Specifying a value less than 1 produces an error. Specifying a value
@@ -1120,8 +1120,8 @@ from t1
 +-------------------+-------------------------------------+---------------------------+
 |                   | []                                  | 0                         |
 +-------------------+-------------------------------------+---------------------------+
+]]>
 </codeblock>
-
           <p>
             These examples show how the delimiter can be a multi-character value:
           </p>
@@ -1158,8 +1158,8 @@ select split_part('one\|/two\|/three','\|/',3);
           <p>
             <b>Return type:</b> <codeph>string</codeph>
           </p>
-        </dd>
 
+        </dd>
       </dlentry>
 
       <dlentry id="strright">