hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From khorg...@apache.org
Subject hive git commit: HIVE-11988 : security issue with hive & ranger for import table command (Sushanth Sowmyan, reviewed by Thejas Nair)
Date Thu, 29 Oct 2015 18:51:54 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-1 fdfd2cea6 -> c1d0d5013


HIVE-11988 : security issue with hive & ranger for import table command (Sushanth Sowmyan,
reviewed by Thejas Nair)


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

Branch: refs/heads/branch-1
Commit: c1d0d50134e625960de7f2f934acd5a0ad78a953
Parents: fdfd2ce
Author: Sushanth Sowmyan <khorgath@gmail.com>
Authored: Thu Oct 29 11:27:38 2015 -0700
Committer: Sushanth Sowmyan <khorgath@gmail.com>
Committed: Thu Oct 29 11:51:48 2015 -0700

----------------------------------------------------------------------
 ...SQLStdHiveAuthorizationValidatorForTest.java | 47 ++++++++++++++++++-
 .../java/org/apache/hadoop/hive/ql/Driver.java  |  8 +++-
 .../hive/ql/parse/ImportSemanticAnalyzer.java   |  4 ++
 .../plugin/sqlstd/Operation2Privilege.java      | 12 ++++-
 .../clientnegative/authorization_import.q       | 39 ++++++++++++++++
 .../clientnegative/authorization_import.q.out   | 48 ++++++++++++++++++++
 .../authorization_uri_import.q.out              | 29 ++++++++++++
 .../clientpositive/exim_00_nonpart_empty.q.out  |  2 +
 .../clientpositive/exim_01_nonpart.q.out        |  2 +
 .../clientpositive/exim_02_00_part_empty.q.out  |  2 +
 .../results/clientpositive/exim_02_part.q.out   |  2 +
 .../clientpositive/exim_04_all_part.q.out       |  2 +
 .../clientpositive/exim_04_evolved_parts.q.out  |  2 +
 .../clientpositive/exim_05_some_part.q.out      |  2 +
 .../clientpositive/exim_06_one_part.q.out       |  2 +
 .../clientpositive/exim_08_nonpart_rename.q.out |  2 +
 .../exim_10_external_managed.q.out              |  2 +
 .../exim_11_managed_external.q.out              |  2 +
 .../exim_12_external_location.q.out             |  2 +
 .../exim_13_managed_location.q.out              |  2 +
 .../clientpositive/exim_18_part_external.q.out  |  2 +
 .../exim_19_00_part_external_location.q.out     |  2 +
 .../exim_19_part_external_location.q.out        |  2 +
 .../exim_20_part_managed_location.q.out         |  2 +
 .../exim_24_import_nonexist_authsuccess.q.out   |  2 +
 .../clientpositive/exim_hidden_files.q.out      |  2 +
 .../clientpositive/import_exported_table.q.out  |  3 ++
 .../clientpositive/repl_2_exim_basic.q.out      |  4 ++
 .../spark/import_exported_table.q.out           |  3 ++
 29 files changed, 230 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/itests/util/src/main/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLStdHiveAuthorizationValidatorForTest.java
----------------------------------------------------------------------
diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLStdHiveAuthorizationValidatorForTest.java
b/itests/util/src/main/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLStdHiveAuthorizationValidatorForTest.java
index ecd3d80..fd39c67 100644
--- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLStdHiveAuthorizationValidatorForTest.java
+++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLStdHiveAuthorizationValidatorForTest.java
@@ -18,6 +18,10 @@
 package org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd;
 
 import java.util.List;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.annotation.Nullable;
 
 import org.apache.hadoop.classification.InterfaceAudience.Private;
 import org.apache.hadoop.hive.conf.HiveConf;
@@ -30,18 +34,59 @@ import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveMetastoreClie
 import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType;
 import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject;
 
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+
 /**
  * Extends SQLStdHiveAuthorizationValidator to relax the restriction of not
  * being able to run dfs,set commands. To be used for testing purposes only!
+ *
+ * In addition, it parses a setting test.hive.authz.sstd.validator.bypassObjTypes
+ * as a comma-separated list of object types, which, if present, it will bypass
+ * validations of all input and output objects of those types.
  */
+
 @Private
 public class SQLStdHiveAuthorizationValidatorForTest extends SQLStdHiveAuthorizationValidator
{
 
+  final String BYPASS_OBJTYPES_KEY = "test.hive.authz.sstd.validator.bypassObjTypes";
+  Set<HivePrivilegeObject.HivePrivilegeObjectType> bypassObjectTypes;
+
   public SQLStdHiveAuthorizationValidatorForTest(HiveMetastoreClientFactory metastoreClientFactory,
       HiveConf conf, HiveAuthenticationProvider authenticator,
       SQLStdHiveAccessControllerWrapper privController, HiveAuthzSessionContext ctx)
       throws HiveAuthzPluginException {
     super(metastoreClientFactory, conf, authenticator, privController, ctx);
+    setupBypass(conf.get(BYPASS_OBJTYPES_KEY,""));
+  }
+
+  private void setupBypass(String bypassObjectTypesConf){
+    bypassObjectTypes = new HashSet<HivePrivilegeObject.HivePrivilegeObjectType>();
+    if (!bypassObjectTypesConf.isEmpty()){
+      for (String bypassType : bypassObjectTypesConf.split(",")){
+        if ((bypassType != null) && !bypassType.isEmpty()){
+          bypassObjectTypes.add(HivePrivilegeObject.HivePrivilegeObjectType.valueOf(bypassType));
+        }
+      }
+    }
+  }
+
+  List<HivePrivilegeObject> filterForBypass(List<HivePrivilegeObject> privilegeObjects){
+    if (privilegeObjects == null){
+      return null;
+    } else {
+      return Lists.newArrayList(Iterables.filter(privilegeObjects,new Predicate<HivePrivilegeObject>()
{
+        @Override
+        public boolean apply(@Nullable HivePrivilegeObject hivePrivilegeObject) {
+          // Return true to retain an item, and false to filter it out.
+          if (hivePrivilegeObject == null){
+            return true;
+          }
+          return !bypassObjectTypes.contains(hivePrivilegeObject.getType());
+        }
+      }));
+    }
   }
 
   @Override
@@ -54,7 +99,7 @@ public class SQLStdHiveAuthorizationValidatorForTest extends SQLStdHiveAuthoriza
       // allow SET and DFS commands to be used during testing
       return;
     default:
-      super.checkPrivileges(hiveOpType, inputHObjs, outputHObjs, context);
+      super.checkPrivileges(hiveOpType, filterForBypass(inputHObjs), filterForBypass(outputHObjs),
context);
     }
 
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
index d034afc..d1db215 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
@@ -599,8 +599,12 @@ public class Driver implements CommandProcessor {
           continue;
         }
         if (write.getType() == Entity.Type.DATABASE) {
-          authorizer.authorize(write.getDatabase(),
-              null, op.getOutputRequiredPrivileges());
+          if (!op.equals(HiveOperation.IMPORT)){
+            // We skip DB check for import here because we already handle it above
+            // as a CTAS check.
+            authorizer.authorize(write.getDatabase(),
+                null, op.getOutputRequiredPrivileges());
+          }
           continue;
         }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
index 1061cb0..88c4b95 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
@@ -718,6 +718,10 @@ public class ImportSemanticAnalyzer extends BaseSemanticAnalyzer {
       table = new Table(tblDesc.getDatabaseName(), tblDesc.getTableName());
       Database parentDb = db.getDatabase(tblDesc.getDatabaseName());
 
+      // Since we are going to be creating a new table in a db, we should mark that db as
a write entity
+      // so that the auth framework can go to work there.
+      outputs.add(new WriteEntity(parentDb, WriteEntity.WriteType.DDL_SHARED));
+
       if (isPartitioned(tblDesc)) {
         for (AddPartitionDesc addPartitionDesc : partitionDescs) {
           t.addDependentTask(

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
index 8e61d57..a2aeafc 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/Operation2Privilege.java
@@ -271,8 +271,16 @@ public class Operation2Privilege {
     // select with grant for exporting contents
     op2Priv.put(HiveOperationType.EXPORT, PrivRequirement.newIOPrivRequirement
 (SEL_GRANT_AR, OWNER_INS_SEL_DEL_NOGRANT_AR));
-    op2Priv.put(HiveOperationType.IMPORT, PrivRequirement.newIOPrivRequirement
-(OWNER_INS_SEL_DEL_NOGRANT_AR, INS_NOGRANT_AR));
+    // For import statement, require uri rwx+owner privileges on input uri, and
+    // necessary privileges on the output table and database
+    // NOTE : privileges are only checked if the object of that type is marked as part of
ReadEntity or WriteEntity
+    // So, if a table is present, Import will mark a table as a WriteEntity, and we'll authorize
for that, and if not present,
+    // Import will mark the parent db as a WriteEntity, thus ensuring that we check for table
creation privileges.
+    op2Priv.put(HiveOperationType.IMPORT, PrivRequirement.newPrivRequirementList(
+        new PrivRequirement(OWNER_INS_SEL_DEL_NOGRANT_AR, IOType.INPUT),
+        new PrivRequirement(arr(SQLPrivTypeGrant.INSERT_NOGRANT, SQLPrivTypeGrant.DELETE_NOGRANT),
+            IOType.OUTPUT, null, HivePrivilegeObjectType.TABLE_OR_VIEW),
+        new PrivRequirement(OWNER_PRIV_AR, IOType.OUTPUT, null, HivePrivilegeObjectType.DATABASE)));
 
     // operations require select priv
     op2Priv.put(HiveOperationType.SHOWCOLUMNS, PrivRequirement.newIOPrivRequirement

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/queries/clientnegative/authorization_import.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientnegative/authorization_import.q b/ql/src/test/queries/clientnegative/authorization_import.q
new file mode 100644
index 0000000..e296411
--- /dev/null
+++ b/ql/src/test/queries/clientnegative/authorization_import.q
@@ -0,0 +1,39 @@
+set hive.test.authz.sstd.hs2.mode=true;
+set hive.security.authenticator.manager=org.apache.hadoop.hive.ql.security.SessionStateConfigUserAuthenticator;
+set hive.security.authorization.manager=org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactoryForTest;
+set hive.security.authorization.enabled=true;
+
+set test.hive.authz.sstd.validator.bypassObjTypes=DFS_URI;
+
+set hive.test.mode=true;
+set hive.test.mode.prefix=;
+set hive.test.mode.nosamplelist=import_auth_t1,import_auth_t2,import_auth_t3;
+
+drop table if exists import_auth_t1;
+create table import_auth_t1 ( dep_id int comment "department id") stored as textfile;
+dfs ${system:test.dfs.mkdir} target/tmp/ql/test/data/exports/import_auth_t1/temp;
+dfs -rmr target/tmp/ql/test/data/exports/import_auth_t1;
+
+export table import_auth_t1 to 'ql/test/data/exports/import_auth_t1';
+
+dfs -touchz target/tmp/ql/test/data/exports/import_auth_t1/1.txt;
+dfs -chmod 777 target/tmp/ql/test/data/exports/import_auth_t1/1.txt;
+dfs -chmod 777 target/tmp/ql/test/data/exports/import_auth_t1;
+
+dfs ${system:test.dfs.mkdir} target/tmp/ql/test/data/exports/import_auth_t2/temp;
+
+set user.name=hive_admin_user;
+set role admin;
+
+create database importer;
+use importer;
+
+show roles;
+
+set user.name=hive_test_user;
+set role public;
+
+import table import_auth_t2 from 'ql/test/data/exports/import_auth_t1';
+
+set user.name=hive_admin_user;
+set role admin;

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientnegative/authorization_import.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientnegative/authorization_import.q.out b/ql/src/test/results/clientnegative/authorization_import.q.out
new file mode 100644
index 0000000..9972a8a
--- /dev/null
+++ b/ql/src/test/results/clientnegative/authorization_import.q.out
@@ -0,0 +1,48 @@
+PREHOOK: query: drop table if exists import_auth_t1
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table if exists import_auth_t1
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: create table import_auth_t1 ( dep_id int comment "department id") stored
as textfile
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@import_auth_t1
+POSTHOOK: query: create table import_auth_t1 ( dep_id int comment "department id") stored
as textfile
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@import_auth_t1
+#### A masked pattern was here ####
+PREHOOK: query: export table import_auth_t1 to 'ql/test/data/exports/import_auth_t1'
+PREHOOK: type: EXPORT
+PREHOOK: Input: default@import_auth_t1
+#### A masked pattern was here ####
+POSTHOOK: query: export table import_auth_t1 to 'ql/test/data/exports/import_auth_t1'
+POSTHOOK: type: EXPORT
+POSTHOOK: Input: default@import_auth_t1
+#### A masked pattern was here ####
+PREHOOK: query: set role admin
+PREHOOK: type: SHOW_ROLES
+POSTHOOK: query: set role admin
+POSTHOOK: type: SHOW_ROLES
+PREHOOK: query: create database importer
+PREHOOK: type: CREATEDATABASE
+PREHOOK: Output: database:importer
+POSTHOOK: query: create database importer
+POSTHOOK: type: CREATEDATABASE
+POSTHOOK: Output: database:importer
+PREHOOK: query: use importer
+PREHOOK: type: SWITCHDATABASE
+PREHOOK: Input: database:importer
+POSTHOOK: query: use importer
+POSTHOOK: type: SWITCHDATABASE
+POSTHOOK: Input: database:importer
+PREHOOK: query: show roles
+PREHOOK: type: SHOW_ROLES
+POSTHOOK: query: show roles
+POSTHOOK: type: SHOW_ROLES
+admin
+public
+PREHOOK: query: set role public
+PREHOOK: type: SHOW_ROLES
+POSTHOOK: query: set role public
+POSTHOOK: type: SHOW_ROLES
+FAILED: HiveAccessControlException Permission denied: Principal [name=hive_test_user, type=USER]
does not have following privileges for operation IMPORT [[OBJECT OWNERSHIP] on Object [type=DATABASE,
name=importer]]

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientnegative/authorization_uri_import.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientnegative/authorization_uri_import.q.out b/ql/src/test/results/clientnegative/authorization_uri_import.q.out
index 1ffe831..7ad8023 100644
--- a/ql/src/test/results/clientnegative/authorization_uri_import.q.out
+++ b/ql/src/test/results/clientnegative/authorization_uri_import.q.out
@@ -9,3 +9,32 @@ POSTHOOK: type: CREATETABLE
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@import_auth_uri
 #### A masked pattern was here ####
+PREHOOK: query: export table import_auth_uri to 'ql/test/data/exports/import_auth_uri'
+PREHOOK: type: EXPORT
+PREHOOK: Input: default@import_auth_uri
+#### A masked pattern was here ####
+POSTHOOK: query: export table import_auth_uri to 'ql/test/data/exports/import_auth_uri'
+POSTHOOK: type: EXPORT
+POSTHOOK: Input: default@import_auth_uri
+#### A masked pattern was here ####
+PREHOOK: query: drop table import_auth_uri
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@import_auth_uri
+PREHOOK: Output: default@import_auth_uri
+POSTHOOK: query: drop table import_auth_uri
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@import_auth_uri
+POSTHOOK: Output: default@import_auth_uri
+PREHOOK: query: create database importer
+PREHOOK: type: CREATEDATABASE
+PREHOOK: Output: database:importer
+POSTHOOK: query: create database importer
+POSTHOOK: type: CREATEDATABASE
+POSTHOOK: Output: database:importer
+PREHOOK: query: use importer
+PREHOOK: type: SWITCHDATABASE
+PREHOOK: Input: database:importer
+POSTHOOK: query: use importer
+POSTHOOK: type: SWITCHDATABASE
+POSTHOOK: Input: database:importer
+#### A masked pattern was here ####

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_00_nonpart_empty.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_00_nonpart_empty.q.out b/ql/src/test/results/clientpositive/exim_00_nonpart_empty.q.out
index 2d34c5b..62e5b27 100644
--- a/ql/src/test/results/clientpositive/exim_00_nonpart_empty.q.out
+++ b/ql/src/test/results/clientpositive/exim_00_nonpart_empty.q.out
@@ -42,9 +42,11 @@ POSTHOOK: Input: database:importer
 PREHOOK: query: import from 'ql/test/data/exports/exim_department'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import from 'ql/test/data/exports/exim_department'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_department
 PREHOOK: query: describe extended exim_department
 PREHOOK: type: DESCTABLE

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_01_nonpart.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_01_nonpart.q.out b/ql/src/test/results/clientpositive/exim_01_nonpart.q.out
index c919ca4..604fe31 100644
--- a/ql/src/test/results/clientpositive/exim_01_nonpart.q.out
+++ b/ql/src/test/results/clientpositive/exim_01_nonpart.q.out
@@ -50,9 +50,11 @@ POSTHOOK: Input: database:importer
 PREHOOK: query: import from 'ql/test/data/exports/exim_department'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import from 'ql/test/data/exports/exim_department'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_department
 PREHOOK: query: describe extended exim_department
 PREHOOK: type: DESCTABLE

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_02_00_part_empty.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_02_00_part_empty.q.out b/ql/src/test/results/clientpositive/exim_02_00_part_empty.q.out
index 1a28bb5..6273bbc 100644
--- a/ql/src/test/results/clientpositive/exim_02_00_part_empty.q.out
+++ b/ql/src/test/results/clientpositive/exim_02_00_part_empty.q.out
@@ -44,9 +44,11 @@ POSTHOOK: Input: database:importer
 PREHOOK: query: import from 'ql/test/data/exports/exim_employee'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import from 'ql/test/data/exports/exim_employee'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_employee
 PREHOOK: query: describe extended exim_employee
 PREHOOK: type: DESCTABLE

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_02_part.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_02_part.q.out b/ql/src/test/results/clientpositive/exim_02_part.q.out
index 6e0988a..b98515f 100644
--- a/ql/src/test/results/clientpositive/exim_02_part.q.out
+++ b/ql/src/test/results/clientpositive/exim_02_part.q.out
@@ -57,9 +57,11 @@ POSTHOOK: Input: database:importer
 PREHOOK: query: import from 'ql/test/data/exports/exim_employee'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import from 'ql/test/data/exports/exim_employee'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_employee
 POSTHOOK: Output: importer@exim_employee@emp_country=in/emp_state=tn
 PREHOOK: query: describe extended exim_employee

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_04_all_part.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_04_all_part.q.out b/ql/src/test/results/clientpositive/exim_04_all_part.q.out
index 862efa3..f7dfdf1 100644
--- a/ql/src/test/results/clientpositive/exim_04_all_part.q.out
+++ b/ql/src/test/results/clientpositive/exim_04_all_part.q.out
@@ -96,9 +96,11 @@ POSTHOOK: Input: database:importer
 PREHOOK: query: import from 'ql/test/data/exports/exim_employee'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import from 'ql/test/data/exports/exim_employee'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_employee
 POSTHOOK: Output: importer@exim_employee@emp_country=in/emp_state=ka
 POSTHOOK: Output: importer@exim_employee@emp_country=in/emp_state=tn

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_04_evolved_parts.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_04_evolved_parts.q.out b/ql/src/test/results/clientpositive/exim_04_evolved_parts.q.out
index 4151a94..86999f4 100644
--- a/ql/src/test/results/clientpositive/exim_04_evolved_parts.q.out
+++ b/ql/src/test/results/clientpositive/exim_04_evolved_parts.q.out
@@ -102,9 +102,11 @@ POSTHOOK: Input: database:importer
 PREHOOK: query: import from 'ql/test/data/exports/exim_employee'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import from 'ql/test/data/exports/exim_employee'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_employee
 POSTHOOK: Output: importer@exim_employee@emp_country=in/emp_state=ka
 POSTHOOK: Output: importer@exim_employee@emp_country=in/emp_state=tn

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_05_some_part.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_05_some_part.q.out b/ql/src/test/results/clientpositive/exim_05_some_part.q.out
index 1b6a515..c35599f 100644
--- a/ql/src/test/results/clientpositive/exim_05_some_part.q.out
+++ b/ql/src/test/results/clientpositive/exim_05_some_part.q.out
@@ -92,9 +92,11 @@ POSTHOOK: Input: database:importer
 PREHOOK: query: import from 'ql/test/data/exports/exim_employee'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import from 'ql/test/data/exports/exim_employee'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_employee
 POSTHOOK: Output: importer@exim_employee@emp_country=in/emp_state=ka
 POSTHOOK: Output: importer@exim_employee@emp_country=us/emp_state=ka

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_06_one_part.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_06_one_part.q.out b/ql/src/test/results/clientpositive/exim_06_one_part.q.out
index 39c83c3..0ea6998 100644
--- a/ql/src/test/results/clientpositive/exim_06_one_part.q.out
+++ b/ql/src/test/results/clientpositive/exim_06_one_part.q.out
@@ -90,9 +90,11 @@ POSTHOOK: Input: database:importer
 PREHOOK: query: import from 'ql/test/data/exports/exim_employee'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import from 'ql/test/data/exports/exim_employee'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_employee
 POSTHOOK: Output: importer@exim_employee@emp_country=in/emp_state=ka
 PREHOOK: query: describe extended exim_employee

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_08_nonpart_rename.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_08_nonpart_rename.q.out b/ql/src/test/results/clientpositive/exim_08_nonpart_rename.q.out
index 740833b..8cb2c75 100644
--- a/ql/src/test/results/clientpositive/exim_08_nonpart_rename.q.out
+++ b/ql/src/test/results/clientpositive/exim_08_nonpart_rename.q.out
@@ -73,9 +73,11 @@ POSTHOOK: Output: importer@exim_department@emp_org=hr
 PREHOOK: query: import table exim_imported_dept from 'ql/test/data/exports/exim_department'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import table exim_imported_dept from 'ql/test/data/exports/exim_department'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_imported_dept
 PREHOOK: query: describe extended exim_imported_dept
 PREHOOK: type: DESCTABLE

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_10_external_managed.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_10_external_managed.q.out b/ql/src/test/results/clientpositive/exim_10_external_managed.q.out
index fdb5c91..5672db9 100644
--- a/ql/src/test/results/clientpositive/exim_10_external_managed.q.out
+++ b/ql/src/test/results/clientpositive/exim_10_external_managed.q.out
@@ -56,9 +56,11 @@ POSTHOOK: Input: database:importer
 PREHOOK: query: import from 'ql/test/data/exports/exim_department'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import from 'ql/test/data/exports/exim_department'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_department
 PREHOOK: query: describe extended exim_department
 PREHOOK: type: DESCTABLE

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_11_managed_external.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_11_managed_external.q.out b/ql/src/test/results/clientpositive/exim_11_managed_external.q.out
index 7bdefdc..c0af2bb 100644
--- a/ql/src/test/results/clientpositive/exim_11_managed_external.q.out
+++ b/ql/src/test/results/clientpositive/exim_11_managed_external.q.out
@@ -50,9 +50,11 @@ POSTHOOK: Input: database:importer
 PREHOOK: query: import external table exim_department from 'ql/test/data/exports/exim_department'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import external table exim_department from 'ql/test/data/exports/exim_department'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_department
 PREHOOK: query: describe extended exim_department
 PREHOOK: type: DESCTABLE

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_12_external_location.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_12_external_location.q.out b/ql/src/test/results/clientpositive/exim_12_external_location.q.out
index a8bf137..70b9239 100644
--- a/ql/src/test/results/clientpositive/exim_12_external_location.q.out
+++ b/ql/src/test/results/clientpositive/exim_12_external_location.q.out
@@ -52,10 +52,12 @@ PREHOOK: query: import external table exim_department from 'ql/test/data/exports
 	location 'ql/test/data/tablestore/exim_department'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import external table exim_department from 'ql/test/data/exports/exim_department'

 	location 'ql/test/data/tablestore/exim_department'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_department
 PREHOOK: query: describe extended exim_department
 PREHOOK: type: DESCTABLE

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_13_managed_location.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_13_managed_location.q.out b/ql/src/test/results/clientpositive/exim_13_managed_location.q.out
index 4118a32..6332298 100644
--- a/ql/src/test/results/clientpositive/exim_13_managed_location.q.out
+++ b/ql/src/test/results/clientpositive/exim_13_managed_location.q.out
@@ -52,10 +52,12 @@ PREHOOK: query: import table exim_department from 'ql/test/data/exports/exim_dep
 	location 'ql/test/data/tablestore/exim_department'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import table exim_department from 'ql/test/data/exports/exim_department'

 	location 'ql/test/data/tablestore/exim_department'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_department
 PREHOOK: query: describe extended exim_department
 PREHOOK: type: DESCTABLE

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_18_part_external.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_18_part_external.q.out b/ql/src/test/results/clientpositive/exim_18_part_external.q.out
index a082a11..2ab4314 100644
--- a/ql/src/test/results/clientpositive/exim_18_part_external.q.out
+++ b/ql/src/test/results/clientpositive/exim_18_part_external.q.out
@@ -97,10 +97,12 @@ PREHOOK: query: import external table exim_employee partition (emp_country="us",
 	from 'ql/test/data/exports/exim_employee'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import external table exim_employee partition (emp_country="us", emp_state="tn")

 	from 'ql/test/data/exports/exim_employee'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_employee
 POSTHOOK: Output: importer@exim_employee@emp_country=us/emp_state=tn
 PREHOOK: query: describe extended exim_employee

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_19_00_part_external_location.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_19_00_part_external_location.q.out b/ql/src/test/results/clientpositive/exim_19_00_part_external_location.q.out
index 5a97e03..625f91b 100644
--- a/ql/src/test/results/clientpositive/exim_19_00_part_external_location.q.out
+++ b/ql/src/test/results/clientpositive/exim_19_00_part_external_location.q.out
@@ -73,11 +73,13 @@ PREHOOK: query: import external table exim_employee
 	location 'ql/test/data/tablestore/exim_employee'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import external table exim_employee 
 	from 'ql/test/data/exports/exim_employee'
 	location 'ql/test/data/tablestore/exim_employee'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_employee
 POSTHOOK: Output: importer@exim_employee@emp_country=in/emp_state=ka
 POSTHOOK: Output: importer@exim_employee@emp_country=in/emp_state=tn

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_19_part_external_location.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_19_part_external_location.q.out b/ql/src/test/results/clientpositive/exim_19_part_external_location.q.out
index f9a20f7..3ee28ce 100644
--- a/ql/src/test/results/clientpositive/exim_19_part_external_location.q.out
+++ b/ql/src/test/results/clientpositive/exim_19_part_external_location.q.out
@@ -99,11 +99,13 @@ PREHOOK: query: import external table exim_employee partition (emp_country="us",
 	location 'ql/test/data/tablestore/exim_employee'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import external table exim_employee partition (emp_country="us", emp_state="tn")

 	from 'ql/test/data/exports/exim_employee'
 	location 'ql/test/data/tablestore/exim_employee'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_employee
 POSTHOOK: Output: importer@exim_employee@emp_country=us/emp_state=tn
 PREHOOK: query: describe extended exim_employee

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_20_part_managed_location.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_20_part_managed_location.q.out b/ql/src/test/results/clientpositive/exim_20_part_managed_location.q.out
index b196ba5..e920fda 100644
--- a/ql/src/test/results/clientpositive/exim_20_part_managed_location.q.out
+++ b/ql/src/test/results/clientpositive/exim_20_part_managed_location.q.out
@@ -99,11 +99,13 @@ PREHOOK: query: import table exim_employee partition (emp_country="us",
emp_stat
 	location 'ql/test/data/tablestore/exim_employee'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import table exim_employee partition (emp_country="us", emp_state="tn")

 	from 'ql/test/data/exports/exim_employee'
 	location 'ql/test/data/tablestore/exim_employee'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_employee
 POSTHOOK: Output: importer@exim_employee@emp_country=us/emp_state=tn
 PREHOOK: query: describe extended exim_employee

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_24_import_nonexist_authsuccess.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_24_import_nonexist_authsuccess.q.out
b/ql/src/test/results/clientpositive/exim_24_import_nonexist_authsuccess.q.out
index 3b97179..53ea960 100644
--- a/ql/src/test/results/clientpositive/exim_24_import_nonexist_authsuccess.q.out
+++ b/ql/src/test/results/clientpositive/exim_24_import_nonexist_authsuccess.q.out
@@ -50,9 +50,11 @@ POSTHOOK: type: GRANT_PRIVILEGE
 PREHOOK: query: import from 'ql/test/data/exports/exim_department'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import from 'ql/test/data/exports/exim_department'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_department
 PREHOOK: query: select * from exim_department
 PREHOOK: type: QUERY

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/exim_hidden_files.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exim_hidden_files.q.out b/ql/src/test/results/clientpositive/exim_hidden_files.q.out
index e449e0e..dd4646e 100644
--- a/ql/src/test/results/clientpositive/exim_hidden_files.q.out
+++ b/ql/src/test/results/clientpositive/exim_hidden_files.q.out
@@ -46,9 +46,11 @@ POSTHOOK: Input: database:importer
 PREHOOK: query: import from 'ql/test/data/exports/exim_employee'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:importer
 POSTHOOK: query: import from 'ql/test/data/exports/exim_employee'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:importer
 POSTHOOK: Output: importer@exim_employee
 POSTHOOK: Output: importer@exim_employee@emp_country=in
 PREHOOK: query: describe formatted exim_employee

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/import_exported_table.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/import_exported_table.q.out b/ql/src/test/results/clientpositive/import_exported_table.q.out
index d2f098d..65d7480 100644
--- a/ql/src/test/results/clientpositive/import_exported_table.q.out
+++ b/ql/src/test/results/clientpositive/import_exported_table.q.out
@@ -1,8 +1,11 @@
 #### A masked pattern was here ####
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:default
+#### A masked pattern was here ####
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:default
 POSTHOOK: Output: default@j1_41
 PREHOOK: query: DESCRIBE j1_41
 PREHOOK: type: DESCTABLE

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/repl_2_exim_basic.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/repl_2_exim_basic.q.out b/ql/src/test/results/clientpositive/repl_2_exim_basic.q.out
index 8df0653..b2cbea9 100644
--- a/ql/src/test/results/clientpositive/repl_2_exim_basic.q.out
+++ b/ql/src/test/results/clientpositive/repl_2_exim_basic.q.out
@@ -136,9 +136,11 @@ POSTHOOK: Output: default@managed_t
 PREHOOK: query: import table managed_t_imported from 'ql/test/data/exports/managed_t'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:default
 POSTHOOK: query: import table managed_t_imported from 'ql/test/data/exports/managed_t'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:default
 POSTHOOK: Output: default@managed_t_imported
 POSTHOOK: Output: default@managed_t_imported@emp_country=us/emp_state=ca
 PREHOOK: query: describe extended managed_t_imported
@@ -298,9 +300,11 @@ POSTHOOK: Input: default@managed_t_r_imported@emp_country=us/emp_state=ca
 PREHOOK: query: import table ext_t_imported from 'ql/test/data/exports/ext_t'
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:default
 POSTHOOK: query: import table ext_t_imported from 'ql/test/data/exports/ext_t'
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:default
 POSTHOOK: Output: default@ext_t_imported
 POSTHOOK: Output: default@ext_t_imported@emp_country=us/emp_state=ca
 PREHOOK: query: describe extended ext_t_imported

http://git-wip-us.apache.org/repos/asf/hive/blob/c1d0d501/ql/src/test/results/clientpositive/spark/import_exported_table.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/import_exported_table.q.out b/ql/src/test/results/clientpositive/spark/import_exported_table.q.out
index d2f098d..65d7480 100644
--- a/ql/src/test/results/clientpositive/spark/import_exported_table.q.out
+++ b/ql/src/test/results/clientpositive/spark/import_exported_table.q.out
@@ -1,8 +1,11 @@
 #### A masked pattern was here ####
 PREHOOK: type: IMPORT
 #### A masked pattern was here ####
+PREHOOK: Output: database:default
+#### A masked pattern was here ####
 POSTHOOK: type: IMPORT
 #### A masked pattern was here ####
+POSTHOOK: Output: database:default
 POSTHOOK: Output: default@j1_41
 PREHOOK: query: DESCRIBE j1_41
 PREHOOK: type: DESCTABLE


Mime
View raw message