hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From the...@apache.org
Subject hive git commit: HIVE-10843 : desc database and show tables commands don't pass db to HiveAuthorizer check (Thejas Nair, reviewed by Gunther Hagleitner)
Date Sun, 31 May 2015 23:28:49 GMT
Repository: hive
Updated Branches:
  refs/heads/master c6a09ce30 -> fac9ee909


HIVE-10843 : desc database and show tables commands don't pass db to HiveAuthorizer check (Thejas Nair, reviewed by Gunther Hagleitner)


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

Branch: refs/heads/master
Commit: fac9ee9099bb4ed8adc921c08e88721f64fd0bd8
Parents: c6a09ce
Author: Thejas Nair <thejas@hortonworks.com>
Authored: Sun May 31 16:28:28 2015 -0700
Committer: Thejas Nair <thejas@hortonworks.com>
Committed: Sun May 31 16:28:42 2015 -0700

----------------------------------------------------------------------
 .../test/results/clientpositive/url_hook.q.out  |  4 +++
 .../hive/minikdc/TestHs2HooksWithMiniKdc.java   |  2 +-
 .../apache/hadoop/hive/hooks/TestHs2Hooks.java  | 10 ++++--
 .../TestHiveAuthorizerCheckInvocation.java      | 34 +++++++++++++++++++-
 .../hive/ql/parse/DDLSemanticAnalyzer.java      |  3 +-
 .../SQLStdHiveAuthorizationValidator.java       |  5 +++
 .../clientnegative/authorization_ctas2.q.out    |  2 ++
 .../results/clientpositive/add_part_exist.q.out |  2 ++
 ql/src/test/results/clientpositive/alter1.q.out |  4 +++
 ql/src/test/results/clientpositive/alter2.q.out |  4 +++
 ql/src/test/results/clientpositive/alter3.q.out |  4 +++
 ql/src/test/results/clientpositive/alter4.q.out |  4 +++
 ql/src/test/results/clientpositive/alter5.q.out |  4 +++
 .../alter_change_db_location.q.out              |  2 ++
 .../results/clientpositive/alter_db_owner.q.out |  6 ++++
 .../results/clientpositive/alter_index.q.out    |  2 ++
 .../clientpositive/alter_rename_partition.q.out |  6 ++++
 .../authorization_owner_actions_db.q.out        |  2 ++
 .../results/clientpositive/create_view.q.out    |  2 ++
 .../test/results/clientpositive/database.q.out  | 12 +++++++
 .../clientpositive/database_location.q.out      |  8 +++++
 .../clientpositive/database_properties.q.out    |  6 ++++
 .../clientpositive/dbtxnmgr_query5.q.out        |  2 ++
 .../clientpositive/describe_database.q.out      |  4 +++
 .../clientpositive/describe_database_json.q.out | 12 +++++++
 .../clientpositive/describe_table_json.q.out    |  4 +++
 .../encrypted/encryption_drop_table.q.out       |  6 ++++
 .../encrypted/encryption_move_tbl.q.out         |  4 +++
 .../results/clientpositive/index_creation.q.out |  2 ++
 ql/src/test/results/clientpositive/input2.q.out |  4 +++
 ql/src/test/results/clientpositive/input3.q.out |  4 +++
 .../results/clientpositive/rename_column.q.out  |  4 +++
 .../results/clientpositive/show_tables.q.out    | 18 +++++++++++
 .../clientpositive/spark/temp_table.q.out       |  6 ++++
 .../results/clientpositive/temp_table.q.out     |  6 ++++
 .../clientpositive/temp_table_names.q.out       |  8 +++++
 .../results/clientpositive/tez/temp_table.q.out |  6 ++++
 37 files changed, 212 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/contrib/src/test/results/clientpositive/url_hook.q.out
----------------------------------------------------------------------
diff --git a/contrib/src/test/results/clientpositive/url_hook.q.out b/contrib/src/test/results/clientpositive/url_hook.q.out
index 971da8e..ca04d15 100644
--- a/contrib/src/test/results/clientpositive/url_hook.q.out
+++ b/contrib/src/test/results/clientpositive/url_hook.q.out
@@ -1,11 +1,15 @@
 PREHOOK: query: SHOW TABLES 'src'
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES 'src'
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 src
 PREHOOK: query: -- changes to dummy derby store.. should return empty result
 SHOW TABLES 'src'
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: -- changes to dummy derby store.. should return empty result
 SHOW TABLES 'src'
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestHs2HooksWithMiniKdc.java
----------------------------------------------------------------------
diff --git a/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestHs2HooksWithMiniKdc.java b/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestHs2HooksWithMiniKdc.java
index e089aa9..4fabe47 100644
--- a/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestHs2HooksWithMiniKdc.java
+++ b/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestHs2HooksWithMiniKdc.java
@@ -54,7 +54,7 @@ public class TestHs2HooksWithMiniKdc {
     confOverlay.put(ConfVars.PREEXECHOOKS.varname, PreExecHook.class.getName());
     confOverlay.put(ConfVars.SEMANTIC_ANALYZER_HOOK.varname,
         SemanticAnalysisHook.class.getName());
-
+    confOverlay.put(ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "" + Boolean.FALSE);
     HiveConf hiveConf = new HiveConf();
     miniHiveKdc = MiniHiveKdc.getMiniHiveKdc(hiveConf);
     miniHS2 = MiniHiveKdc.getMiniHS2WithKerb(miniHiveKdc, hiveConf);

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/itests/hive-unit/src/test/java/org/apache/hadoop/hive/hooks/TestHs2Hooks.java
----------------------------------------------------------------------
diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/hooks/TestHs2Hooks.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/hooks/TestHs2Hooks.java
index 5696076..6f3e779 100644
--- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/hooks/TestHs2Hooks.java
+++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/hooks/TestHs2Hooks.java
@@ -28,6 +28,7 @@ import java.util.Properties;
 import junit.framework.Assert;
 
 import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
 import org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext;
 import org.apache.hadoop.hive.ql.hooks.HookContext;
 import org.apache.hadoop.hive.ql.hooks.HookContext.HookType;
@@ -58,6 +59,7 @@ public class TestHs2Hooks {
     public static String operation;
     public static Throwable error;
 
+    @Override
     public void run(HookContext hookContext) {
       try {
         if (hookContext.getHookType().equals(HookType.POST_EXEC_HOOK)) {
@@ -78,6 +80,7 @@ public class TestHs2Hooks {
     public static String operation;
     public static Throwable error;
 
+    @Override
     public void run(HookContext hookContext) {
       try {
         if (hookContext.getHookType().equals(HookType.PRE_EXEC_HOOK)) {
@@ -133,12 +136,13 @@ public class TestHs2Hooks {
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     HiveConf hiveConf = new HiveConf();
-    hiveConf.setVar(HiveConf.ConfVars.PREEXECHOOKS,
+    hiveConf.setVar(ConfVars.PREEXECHOOKS,
         PreExecHook.class.getName());
-    hiveConf.setVar(HiveConf.ConfVars.POSTEXECHOOKS,
+    hiveConf.setVar(ConfVars.POSTEXECHOOKS,
         PostExecHook.class.getName());
-    hiveConf.setVar(HiveConf.ConfVars.SEMANTIC_ANALYZER_HOOK,
+    hiveConf.setVar(ConfVars.SEMANTIC_ANALYZER_HOOK,
         SemanticAnalysisHook.class.getName());
+    hiveConf.setBoolVar(ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
 
     hiveServer2 = new HiveServer2();
     hiveServer2.init(hiveConf);

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/authorization/plugin/TestHiveAuthorizerCheckInvocation.java
----------------------------------------------------------------------
diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/authorization/plugin/TestHiveAuthorizerCheckInvocation.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/authorization/plugin/TestHiveAuthorizerCheckInvocation.java
index 8e93932..6494ba0 100644
--- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/authorization/plugin/TestHiveAuthorizerCheckInvocation.java
+++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/authorization/plugin/TestHiveAuthorizerCheckInvocation.java
@@ -60,6 +60,7 @@ public class TestHiveAuthorizerCheckInvocation {
   protected static Driver driver;
   private static final String tableName = TestHiveAuthorizerCheckInvocation.class.getSimpleName()
       + "Table";
+  private static final String inDbTableName = tableName + "_in_db";
   private static final String acidTableName = tableName + "_acid";
   private static final String dbName = TestHiveAuthorizerCheckInvocation.class.getSimpleName()
       + "Db";
@@ -96,6 +97,7 @@ public class TestHiveAuthorizerCheckInvocation {
     runCmd("create table " + tableName
         + " (i int, j int, k string) partitioned by (city string, `date` string) ");
     runCmd("create database " + dbName);
+    runCmd("create table " + dbName + "." + inDbTableName + "(i int)");
     // Need a separate table for ACID testing since it has to be bucketed and it has to be Acid
     runCmd("create table " + acidTableName + " (i int, j int, k int) clustered by (k) into 2 buckets " +
         "stored as orc TBLPROPERTIES ('transactional'='true')");
@@ -111,7 +113,8 @@ public class TestHiveAuthorizerCheckInvocation {
     // Drop the tables when we're done.  This makes the test work inside an IDE
     runCmd("drop table if exists " + acidTableName);
     runCmd("drop table if exists " + tableName);
-    runCmd("drop database if exists " + dbName);
+    runCmd("drop table if exists " + dbName + "." + inDbTableName);
+    runCmd("drop database if exists " + dbName );
     driver.close();
   }
 
@@ -314,6 +317,35 @@ public class TestHiveAuthorizerCheckInvocation {
     assertEquals("j", tableObj.getColumns().get(0));
   }
 
+  @Test
+  public void testShowTables() throws HiveAuthzPluginException,
+      HiveAccessControlException, CommandNeedRetryException {
+    reset(mockedAuthorizer);
+    int status = driver.compile("show tables");
+    assertEquals(0, status);
+
+    Pair<List<HivePrivilegeObject>, List<HivePrivilegeObject>> io = getHivePrivilegeObjectInputs();
+    List<HivePrivilegeObject> inputs = io.getLeft();
+    assertEquals(1, inputs.size());
+    HivePrivilegeObject dbObj = inputs.get(0);
+    assertEquals("default", dbObj.getDbname().toLowerCase());
+  }
+
+  @Test
+  public void testDescDatabase() throws HiveAuthzPluginException,
+      HiveAccessControlException, CommandNeedRetryException {
+    reset(mockedAuthorizer);
+    int status = driver.compile("describe database " + dbName);
+    assertEquals(0, status);
+
+    Pair<List<HivePrivilegeObject>, List<HivePrivilegeObject>> io = getHivePrivilegeObjectInputs();
+    List<HivePrivilegeObject> inputs = io.getLeft();
+    assertEquals(1, inputs.size());
+    HivePrivilegeObject dbObj = inputs.get(0);
+    assertEquals(dbName.toLowerCase(), dbObj.getDbname().toLowerCase());
+  }
+
+
   private void checkSingleTableInput(List<HivePrivilegeObject> inputs) {
     assertEquals("number of inputs", 1, inputs.size());
 

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
index bc69d23..24ca663 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
@@ -2068,6 +2068,7 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer {
 
     DescDatabaseDesc descDbDesc = new DescDatabaseDesc(ctx.getResFile(),
         dbName, isExtended);
+    inputs.add(new ReadEntity(getDatabase(dbName)));
     rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), descDbDesc), conf));
     setFetchTask(createFetchTask(descDbDesc.getSchema()));
   }
@@ -2178,7 +2179,7 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer {
       showTblsDesc = new ShowTablesDesc(ctx.getResFile(), dbName);
       break;
     }
-
+    inputs.add(new ReadEntity(getDatabase(dbName)));
     rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(),
         showTblsDesc), conf));
     setFetchTask(createFetchTask(showTblsDesc.getSchema()));

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLStdHiveAuthorizationValidator.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLStdHiveAuthorizationValidator.java b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLStdHiveAuthorizationValidator.java
index 7267756..31357c4 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLStdHiveAuthorizationValidator.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLStdHiveAuthorizationValidator.java
@@ -152,6 +152,11 @@ public class SQLStdHiveAuthorizationValidator implements HiveAuthorizationValida
   @Override
   public List<HivePrivilegeObject> filterListCmdObjects(List<HivePrivilegeObject> listObjs,
       HiveAuthzContext context) {
+    if (LOG.isDebugEnabled()) {
+      String msg = "Obtained following objects in  filterListCmdObjects " + listObjs + " for user "
+          + authenticator.getUserName() + ". Context Info: " + context;
+      LOG.debug(msg);
+    }
     return listObjs;
   }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientnegative/authorization_ctas2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientnegative/authorization_ctas2.q.out b/ql/src/test/results/clientnegative/authorization_ctas2.q.out
index 6b6a50b..284e60f 100644
--- a/ql/src/test/results/clientnegative/authorization_ctas2.q.out
+++ b/ql/src/test/results/clientnegative/authorization_ctas2.q.out
@@ -22,6 +22,8 @@ POSTHOOK: type: SWITCHDATABASE
 POSTHOOK: Input: database:ctas_auth
 PREHOOK: query: show tables
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:ctas_auth
 POSTHOOK: query: show tables
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:ctas_auth
 FAILED: HiveAccessControlException Permission denied: Principal [name=user_unauth, type=USER] does not have following privileges for operation CREATETABLE_AS_SELECT [[OBJECT OWNERSHIP] on Object [type=DATABASE, name=ctas_auth]]

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/add_part_exist.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/add_part_exist.q.out b/ql/src/test/results/clientpositive/add_part_exist.q.out
index 04d7070..5a69944 100644
--- a/ql/src/test/results/clientpositive/add_part_exist.q.out
+++ b/ql/src/test/results/clientpositive/add_part_exist.q.out
@@ -80,8 +80,10 @@ POSTHOOK: Input: default@add_part_test
 POSTHOOK: Output: default@add_part_test
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/alter1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/alter1.q.out b/ql/src/test/results/clientpositive/alter1.q.out
index c288129..99248c3 100644
--- a/ql/src/test/results/clientpositive/alter1.q.out
+++ b/ql/src/test/results/clientpositive/alter1.q.out
@@ -189,8 +189,10 @@ POSTHOOK: Input: default@alter1
 POSTHOOK: Output: default@alter1
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2
@@ -218,8 +220,10 @@ POSTHOOK: type: CREATEDATABASE
 POSTHOOK: Output: database:alter1_db
 PREHOOK: query: SHOW TABLES alter1_db
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES alter1_db
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 PREHOOK: query: CREATE TABLE alter1_db.alter1(a INT, b INT)
 PREHOOK: type: CREATETABLE
 PREHOOK: Output: alter1_db@alter1

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/alter2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/alter2.q.out b/ql/src/test/results/clientpositive/alter2.q.out
index ffda7bd..083d04f 100644
--- a/ql/src/test/results/clientpositive/alter2.q.out
+++ b/ql/src/test/results/clientpositive/alter2.q.out
@@ -208,8 +208,10 @@ POSTHOOK: Input: default@alter2
 POSTHOOK: Output: default@alter2
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2
@@ -243,8 +245,10 @@ POSTHOOK: type: SWITCHDATABASE
 POSTHOOK: Input: database:alter2_db
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:alter2_db
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:alter2_db
 PREHOOK: query: CREATE TABLE alter2(a int, b int) PARTITIONED BY (insertdate string)
 PREHOOK: type: CREATETABLE
 PREHOOK: Output: alter2_db@alter2

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/alter3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/alter3.q.out b/ql/src/test/results/clientpositive/alter3.q.out
index 388a8c1..385073f 100644
--- a/ql/src/test/results/clientpositive/alter3.q.out
+++ b/ql/src/test/results/clientpositive/alter3.q.out
@@ -181,8 +181,10 @@ POSTHOOK: Input: default@alter3_like_renamed
 POSTHOOK: Output: default@alter3_like_renamed
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2
@@ -216,8 +218,10 @@ POSTHOOK: type: SWITCHDATABASE
 POSTHOOK: Input: database:alter3_db
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:alter3_db
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:alter3_db
 PREHOOK: query: CREATE TABLE alter3_src (col1 STRING) STORED AS TEXTFILE
 PREHOOK: type: CREATETABLE
 PREHOOK: Output: alter3_db@alter3_src

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/alter4.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/alter4.q.out b/ql/src/test/results/clientpositive/alter4.q.out
index 2af02e8..1d895a2 100644
--- a/ql/src/test/results/clientpositive/alter4.q.out
+++ b/ql/src/test/results/clientpositive/alter4.q.out
@@ -46,8 +46,10 @@ POSTHOOK: Input: default@set_bucketing_test
 POSTHOOK: Output: default@set_bucketing_test
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2
@@ -81,8 +83,10 @@ POSTHOOK: type: SWITCHDATABASE
 POSTHOOK: Input: database:alter4_db
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:alter4_db
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:alter4_db
 PREHOOK: query: CREATE TABLE set_bucketing_test (key INT, value STRING) CLUSTERED BY (key) INTO 10 BUCKETS
 PREHOOK: type: CREATETABLE
 PREHOOK: Output: alter4_db@set_bucketing_test

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/alter5.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/alter5.q.out b/ql/src/test/results/clientpositive/alter5.q.out
index c876e31..1e9573e 100644
--- a/ql/src/test/results/clientpositive/alter5.q.out
+++ b/ql/src/test/results/clientpositive/alter5.q.out
@@ -122,8 +122,10 @@ POSTHOOK: Input: default@alter5
 POSTHOOK: Output: default@alter5
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2
@@ -157,8 +159,10 @@ POSTHOOK: type: SWITCHDATABASE
 POSTHOOK: Input: database:alter5_db
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:alter5_db
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:alter5_db
 PREHOOK: query: create table alter5_src ( col1 string ) stored as textfile
 PREHOOK: type: CREATETABLE
 PREHOOK: Output: alter5_db@alter5_src

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/alter_change_db_location.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/alter_change_db_location.q.out b/ql/src/test/results/clientpositive/alter_change_db_location.q.out
index 64bd680..d511b16 100644
--- a/ql/src/test/results/clientpositive/alter_change_db_location.q.out
+++ b/ql/src/test/results/clientpositive/alter_change_db_location.q.out
@@ -7,8 +7,10 @@ POSTHOOK: Output: database:newDB
 #### A masked pattern was here ####
 PREHOOK: query: describe database extended newDB
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:newdb
 POSTHOOK: query: describe database extended newDB
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:newdb
 newdb		location/in/test	hive_test_user	USER	
 PREHOOK: query: use newDB
 PREHOOK: type: SWITCHDATABASE

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/alter_db_owner.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/alter_db_owner.q.out b/ql/src/test/results/clientpositive/alter_db_owner.q.out
index 19b88df..bc3752f 100644
--- a/ql/src/test/results/clientpositive/alter_db_owner.q.out
+++ b/ql/src/test/results/clientpositive/alter_db_owner.q.out
@@ -6,8 +6,10 @@ POSTHOOK: type: CREATEDATABASE
 POSTHOOK: Output: database:db_alter_onr
 PREHOOK: query: describe database db_alter_onr
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:db_alter_onr
 POSTHOOK: query: describe database db_alter_onr
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:db_alter_onr
 db_alter_onr		location/in/test	hive_test_user	USER	
 #### A masked pattern was here ####
 PREHOOK: type: ALTERDATABASE_OWNER
@@ -17,8 +19,10 @@ POSTHOOK: type: ALTERDATABASE_OWNER
 POSTHOOK: Output: database:db_alter_onr
 PREHOOK: query: describe database db_alter_onr
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:db_alter_onr
 POSTHOOK: query: describe database db_alter_onr
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:db_alter_onr
 db_alter_onr		location/in/test	user1	USER	
 #### A masked pattern was here ####
 PREHOOK: type: ALTERDATABASE_OWNER
@@ -28,6 +32,8 @@ POSTHOOK: type: ALTERDATABASE_OWNER
 POSTHOOK: Output: database:db_alter_onr
 PREHOOK: query: describe database db_alter_onr
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:db_alter_onr
 POSTHOOK: query: describe database db_alter_onr
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:db_alter_onr
 db_alter_onr		location/in/test	role1	ROLE	

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/alter_index.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/alter_index.q.out b/ql/src/test/results/clientpositive/alter_index.q.out
index 90c814d..bca4e12 100644
--- a/ql/src/test/results/clientpositive/alter_index.q.out
+++ b/ql/src/test/results/clientpositive/alter_index.q.out
@@ -45,8 +45,10 @@ POSTHOOK: type: DROPINDEX
 POSTHOOK: Input: default@src
 PREHOOK: query: show tables
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: show tables
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/alter_rename_partition.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/alter_rename_partition.q.out b/ql/src/test/results/clientpositive/alter_rename_partition.q.out
index 040c9e9..9a119a9 100644
--- a/ql/src/test/results/clientpositive/alter_rename_partition.q.out
+++ b/ql/src/test/results/clientpositive/alter_rename_partition.q.out
@@ -10,8 +10,10 @@ POSTHOOK: query: DROP TABLE alter_rename_partition
 POSTHOOK: type: DROPTABLE
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2
@@ -137,8 +139,10 @@ POSTHOOK: Input: default@alter_rename_partition
 POSTHOOK: Output: default@alter_rename_partition
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2
@@ -172,8 +176,10 @@ POSTHOOK: type: SWITCHDATABASE
 POSTHOOK: Input: database:alter_rename_partition_db
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:alter_rename_partition_db
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:alter_rename_partition_db
 PREHOOK: query: CREATE TABLE alter_rename_partition_src (col1 STRING) STORED AS TEXTFILE
 PREHOOK: type: CREATETABLE
 PREHOOK: Output: alter_rename_partition_db@alter_rename_partition_src

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/authorization_owner_actions_db.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/authorization_owner_actions_db.q.out b/ql/src/test/results/clientpositive/authorization_owner_actions_db.q.out
index 2d4e37f..1d2defe 100644
--- a/ql/src/test/results/clientpositive/authorization_owner_actions_db.q.out
+++ b/ql/src/test/results/clientpositive/authorization_owner_actions_db.q.out
@@ -26,8 +26,10 @@ POSTHOOK: type: ALTERDATABASE_OWNER
 POSTHOOK: Output: database:testdb
 PREHOOK: query: desc database testdb
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:testdb
 POSTHOOK: query: desc database testdb
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:testdb
 testdb		location/in/test	testrole	ROLE	
 #### A masked pattern was here ####
 -- create table

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/create_view.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/create_view.q.out b/ql/src/test/results/clientpositive/create_view.q.out
index c837bfb..67e87b9 100644
--- a/ql/src/test/results/clientpositive/create_view.q.out
+++ b/ql/src/test/results/clientpositive/create_view.q.out
@@ -214,8 +214,10 @@ STAGE PLANS:
 
 PREHOOK: query: SHOW TABLES 'view.*'
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES 'view.*'
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 view1
 view2
 view3

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/database.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/database.q.out b/ql/src/test/results/clientpositive/database.q.out
index 043d91b..19b0ea2 100644
--- a/ql/src/test/results/clientpositive/database.q.out
+++ b/ql/src/test/results/clientpositive/database.q.out
@@ -145,8 +145,10 @@ POSTHOOK: Output: database:test_db
 POSTHOOK: Output: test_db@test_table
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:test_db
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:test_db
 test_table
 PREHOOK: query: -- DESCRIBE table in non-default DB
 DESCRIBE test_table
@@ -180,8 +182,10 @@ POSTHOOK: Output: database:test_db
 POSTHOOK: Output: test_db@test_table_like
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:test_db
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:test_db
 test_table
 test_table_like
 PREHOOK: query: DESCRIBE EXTENDED test_table_like
@@ -231,8 +235,10 @@ POSTHOOK: Input: test_db@test_table
 POSTHOOK: Output: test_db@test_table
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:test_db
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:test_db
 test_table_like
 PREHOOK: query: CREATE TABLE test_table (col1 STRING) STORED AS TEXTFILE
 PREHOOK: type: CREATETABLE
@@ -244,8 +250,10 @@ POSTHOOK: Output: database:test_db
 POSTHOOK: Output: test_db@test_table
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:test_db
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:test_db
 test_table
 test_table_like
 PREHOOK: query: SELECT * FROM test_table
@@ -274,8 +282,10 @@ POSTHOOK: Output: database:test_db
 POSTHOOK: Output: test_db@src
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:test_db
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:test_db
 src
 test_table
 test_table_like
@@ -345,8 +355,10 @@ POSTHOOK: Input: test_db@test_table_like
 POSTHOOK: Output: test_db@test_table_like
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:test_db
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:test_db
 PREHOOK: query: USE default
 PREHOOK: type: SWITCHDATABASE
 PREHOOK: Input: database:default

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/database_location.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/database_location.q.out b/ql/src/test/results/clientpositive/database_location.q.out
index 3ad6bbb..159a8e2 100644
--- a/ql/src/test/results/clientpositive/database_location.q.out
+++ b/ql/src/test/results/clientpositive/database_location.q.out
@@ -6,8 +6,10 @@ POSTHOOK: type: CREATEDATABASE
 POSTHOOK: Output: database:db1
 PREHOOK: query: DESCRIBE DATABASE EXTENDED db1
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:db1
 POSTHOOK: query: DESCRIBE DATABASE EXTENDED db1
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:db1
 db1		location/in/test	hive_test_user	USER	
 PREHOOK: query: USE db1
 PREHOOK: type: SWITCHDATABASE
@@ -56,8 +58,10 @@ Storage Desc Params:
 	serialization.format	1                   
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:db1
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:db1
 table_db1
 PREHOOK: query: CREATE DATABASE db2
 COMMENT 'database 2'
@@ -73,8 +77,10 @@ POSTHOOK: Output: database:db2
 #### A masked pattern was here ####
 PREHOOK: query: DESCRIBE DATABASE EXTENDED db2
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:db2
 POSTHOOK: query: DESCRIBE DATABASE EXTENDED db2
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:db2
 db2	database 2	location/in/test	hive_test_user	USER	
 PREHOOK: query: USE db2
 PREHOOK: type: SWITCHDATABASE
@@ -123,6 +129,8 @@ Storage Desc Params:
 	serialization.format	1                   
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:db2
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:db2
 table_db2

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/database_properties.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/database_properties.q.out b/ql/src/test/results/clientpositive/database_properties.q.out
index 86a1c43..685ed25 100644
--- a/ql/src/test/results/clientpositive/database_properties.q.out
+++ b/ql/src/test/results/clientpositive/database_properties.q.out
@@ -24,13 +24,17 @@ POSTHOOK: type: CREATEDATABASE
 POSTHOOK: Output: database:db2
 PREHOOK: query: describe database db2
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:db2
 POSTHOOK: query: describe database db2
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:db2
 db2		location/in/test	hive_test_user	USER	
 PREHOOK: query: describe database extended db2
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:db2
 POSTHOOK: query: describe database extended db2
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:db2
 #### A masked pattern was here ####
 PREHOOK: query: alter database db2 set dbproperties (
   'new.property' = 'some new props',
@@ -44,6 +48,8 @@ POSTHOOK: type: ALTERDATABASE
 POSTHOOK: Output: database:db2
 PREHOOK: query: describe database extended db2
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:db2
 POSTHOOK: query: describe database extended db2
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:db2
 #### A masked pattern was here ####

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/dbtxnmgr_query5.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/dbtxnmgr_query5.q.out b/ql/src/test/results/clientpositive/dbtxnmgr_query5.q.out
index 071a015..a95c5aa 100644
--- a/ql/src/test/results/clientpositive/dbtxnmgr_query5.q.out
+++ b/ql/src/test/results/clientpositive/dbtxnmgr_query5.q.out
@@ -37,8 +37,10 @@ POSTHOOK: Output: database:foo
 POSTHOOK: Output: foo@V1
 PREHOOK: query: show tables
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:foo
 POSTHOOK: query: show tables
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:foo
 t1
 v1
 PREHOOK: query: describe T1

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/describe_database.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/describe_database.q.out b/ql/src/test/results/clientpositive/describe_database.q.out
index deec251..3394d5b 100644
--- a/ql/src/test/results/clientpositive/describe_database.q.out
+++ b/ql/src/test/results/clientpositive/describe_database.q.out
@@ -6,13 +6,17 @@ POSTHOOK: type: CREATEDATABASE
 POSTHOOK: Output: database:test_db
 PREHOOK: query: desc database extended test_db
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:test_db
 POSTHOOK: query: desc database extended test_db
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:test_db
 test_db		location/in/test	hive_test_user	USER	{key1=value1, key2=value2}
 PREHOOK: query: desc schema extended test_db
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:test_db
 POSTHOOK: query: desc schema extended test_db
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:test_db
 test_db		location/in/test	hive_test_user	USER	{key1=value1, key2=value2}
 PREHOOK: query: drop database test_db
 PREHOOK: type: DROPDATABASE

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/describe_database_json.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/describe_database_json.q.out b/ql/src/test/results/clientpositive/describe_database_json.q.out
index bedcae1..699eede 100644
--- a/ql/src/test/results/clientpositive/describe_database_json.q.out
+++ b/ql/src/test/results/clientpositive/describe_database_json.q.out
@@ -7,23 +7,31 @@ POSTHOOK: Output: database:jsondb1
 #### A masked pattern was here ####
 PREHOOK: query: DESCRIBE DATABASE jsondb1
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:jsondb1
 POSTHOOK: query: DESCRIBE DATABASE jsondb1
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:jsondb1
 #### A masked pattern was here ####
 PREHOOK: query: DESCRIBE DATABASE EXTENDED jsondb1
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:jsondb1
 POSTHOOK: query: DESCRIBE DATABASE EXTENDED jsondb1
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:jsondb1
 #### A masked pattern was here ####
 PREHOOK: query: DESCRIBE SCHEMA jsondb1
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:jsondb1
 POSTHOOK: query: DESCRIBE SCHEMA jsondb1
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:jsondb1
 #### A masked pattern was here ####
 PREHOOK: query: DESCRIBE SCHEMA EXTENDED jsondb1
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:jsondb1
 POSTHOOK: query: DESCRIBE SCHEMA EXTENDED jsondb1
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:jsondb1
 #### A masked pattern was here ####
 PREHOOK: query: SHOW DATABASES
 PREHOOK: type: SHOWDATABASES
@@ -51,13 +59,17 @@ POSTHOOK: type: CREATEDATABASE
 POSTHOOK: Output: database:jsondb1
 PREHOOK: query: DESCRIBE DATABASE jsondb1
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:jsondb1
 POSTHOOK: query: DESCRIBE DATABASE jsondb1
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:jsondb1
 #### A masked pattern was here ####
 PREHOOK: query: DESCRIBE DATABASE EXTENDED jsondb1
 PREHOOK: type: DESCDATABASE
+PREHOOK: Input: database:jsondb1
 POSTHOOK: query: DESCRIBE DATABASE EXTENDED jsondb1
 POSTHOOK: type: DESCDATABASE
+POSTHOOK: Input: database:jsondb1
 #### A masked pattern was here ####
 PREHOOK: query: DROP DATABASE jsondb1
 PREHOOK: type: DROPDATABASE

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/describe_table_json.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/describe_table_json.q.out b/ql/src/test/results/clientpositive/describe_table_json.q.out
index 0290cad..ebf15ac 100644
--- a/ql/src/test/results/clientpositive/describe_table_json.q.out
+++ b/ql/src/test/results/clientpositive/describe_table_json.q.out
@@ -8,13 +8,17 @@ POSTHOOK: Output: database:default
 POSTHOOK: Output: default@jsontable
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 {"tables":["alltypesorc","cbo_t1","cbo_t2","cbo_t3","jsontable","lineitem","part","src","src1","src_cbo","src_json","src_sequencefile","src_thrift","srcbucket","srcbucket2","srcpart"]}
 PREHOOK: query: SHOW TABLES LIKE 'json*'
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES LIKE 'json*'
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 {"tables":["jsontable"]}
 PREHOOK: query: SHOW TABLE EXTENDED LIKE 'json*'
 PREHOOK: type: SHOW_TABLESTATUS

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/encrypted/encryption_drop_table.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/encrypted/encryption_drop_table.q.out b/ql/src/test/results/clientpositive/encrypted/encryption_drop_table.q.out
index 8f51fb9..9171e1b 100644
--- a/ql/src/test/results/clientpositive/encrypted/encryption_drop_table.q.out
+++ b/ql/src/test/results/clientpositive/encrypted/encryption_drop_table.q.out
@@ -26,8 +26,10 @@ POSTHOOK: Lineage: encrypted_table.key EXPRESSION [(src)src.FieldSchema(name:key
 POSTHOOK: Lineage: encrypted_table.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 encrypted_table
 src
 PREHOOK: query: DROP TABLE default.encrypted_table
@@ -37,8 +39,10 @@ PREHOOK: Output: default@encrypted_table
 FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:Unable to drop table because it is in an encryption zone and trash is enabled.  Use PURGE option to skip trash.)
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 encrypted_table
 src
 PREHOOK: query: DROP TABLE default.encrypted_table PURGE
@@ -51,6 +55,8 @@ POSTHOOK: Input: default@encrypted_table
 POSTHOOK: Output: default@encrypted_table
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 src

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/encrypted/encryption_move_tbl.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/encrypted/encryption_move_tbl.q.out b/ql/src/test/results/clientpositive/encrypted/encryption_move_tbl.q.out
index e0098f3..1106880 100644
--- a/ql/src/test/results/clientpositive/encrypted/encryption_move_tbl.q.out
+++ b/ql/src/test/results/clientpositive/encrypted/encryption_move_tbl.q.out
@@ -26,8 +26,10 @@ POSTHOOK: Lineage: encrypted_table.key EXPRESSION [(src)src.FieldSchema(name:key
 POSTHOOK: Lineage: encrypted_table.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 encrypted_table
 src
 PREHOOK: query: ALTER TABLE default.encrypted_table RENAME TO default.plain_table
@@ -37,8 +39,10 @@ PREHOOK: Output: default@encrypted_table
 FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Unable to alter table. Alter Table operation for default.encrypted_table failed to move data due to: '/build/ql/test/data/warehouse/default/encrypted_table can't be moved from an encryption zone.' See hive log file for details.
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 encrypted_table
 src
 PREHOOK: query: DROP TABLE encrypted_table PURGE

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/index_creation.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/index_creation.q.out b/ql/src/test/results/clientpositive/index_creation.q.out
index 9c29422..ca113ef 100644
--- a/ql/src/test/results/clientpositive/index_creation.q.out
+++ b/ql/src/test/results/clientpositive/index_creation.q.out
@@ -299,8 +299,10 @@ POSTHOOK: Input: default@_t
 POSTHOOK: Output: default@_t
 PREHOOK: query: show tables
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: show tables
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/input2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/input2.q.out b/ql/src/test/results/clientpositive/input2.q.out
index 037ab32..4dac88a 100644
--- a/ql/src/test/results/clientpositive/input2.q.out
+++ b/ql/src/test/results/clientpositive/input2.q.out
@@ -41,8 +41,10 @@ b                   	double
 c                   	map<double,int>     	                    
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2
@@ -70,8 +72,10 @@ POSTHOOK: Input: default@test2a
 POSTHOOK: Output: default@test2a
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/input3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/input3.q.out b/ql/src/test/results/clientpositive/input3.q.out
index b1d714e..8316a46 100644
--- a/ql/src/test/results/clientpositive/input3.q.out
+++ b/ql/src/test/results/clientpositive/input3.q.out
@@ -33,8 +33,10 @@ b                   	double
 c                   	map<double,int>     	                    
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2
@@ -125,8 +127,10 @@ c                   	map<double,int>
 x                   	double              	                    
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/rename_column.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/rename_column.q.out b/ql/src/test/results/clientpositive/rename_column.q.out
index 0cdad39..10a4df2 100644
--- a/ql/src/test/results/clientpositive/rename_column.q.out
+++ b/ql/src/test/results/clientpositive/rename_column.q.out
@@ -144,8 +144,10 @@ POSTHOOK: Input: default@kv_rename_test
 POSTHOOK: Output: default@kv_rename_test
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2
@@ -321,5 +323,7 @@ POSTHOOK: Input: kv_rename_test_db@kv_rename_test
 POSTHOOK: Output: kv_rename_test_db@kv_rename_test
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:kv_rename_test_db
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:kv_rename_test_db

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/show_tables.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/show_tables.q.out b/ql/src/test/results/clientpositive/show_tables.q.out
index 5db6b8b..432c2ab 100644
--- a/ql/src/test/results/clientpositive/show_tables.q.out
+++ b/ql/src/test/results/clientpositive/show_tables.q.out
@@ -39,8 +39,10 @@ STAGE PLANS:
 
 PREHOOK: query: SHOW TABLES 'shtb_*'
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES 'shtb_*'
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 shtb_test1
 shtb_test2
 PREHOOK: query: EXPLAIN
@@ -68,8 +70,10 @@ STAGE PLANS:
 
 PREHOOK: query: SHOW TABLES LIKE 'shtb_test1|shtb_test2'
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES LIKE 'shtb_test1|shtb_test2'
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 shtb_test1
 shtb_test2
 PREHOOK: query: -- SHOW TABLES FROM/IN database
@@ -120,15 +124,19 @@ POSTHOOK: type: SWITCHDATABASE
 POSTHOOK: Input: database:default
 PREHOOK: query: SHOW TABLES FROM test_db
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:test_db
 POSTHOOK: query: SHOW TABLES FROM test_db
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:test_db
 bar
 baz
 foo
 PREHOOK: query: SHOW TABLES FROM default
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES FROM default
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2
@@ -148,15 +156,19 @@ srcbucket2
 srcpart
 PREHOOK: query: SHOW TABLES IN test_db
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:test_db
 POSTHOOK: query: SHOW TABLES IN test_db
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:test_db
 bar
 baz
 foo
 PREHOOK: query: SHOW TABLES IN default
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES IN default
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 cbo_t1
 cbo_t2
@@ -176,12 +188,16 @@ srcbucket2
 srcpart
 PREHOOK: query: SHOW TABLES IN test_db "test*"
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:test_db
 POSTHOOK: query: SHOW TABLES IN test_db "test*"
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:test_db
 PREHOOK: query: SHOW TABLES IN test_db LIKE "nomatch"
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:test_db
 POSTHOOK: query: SHOW TABLES IN test_db LIKE "nomatch"
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:test_db
 PREHOOK: query: -- SHOW TABLE EXTENDED basic syntax tests and wildcard
 SHOW TABLE EXTENDED IN test_db LIKE foo
 PREHOOK: type: SHOW_TABLESTATUS
@@ -372,6 +388,8 @@ POSTHOOK: type: SWITCHDATABASE
 POSTHOOK: Input: database:default
 PREHOOK: query: SHOW TABLES FROM `database` LIKE "foo"
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:database
 POSTHOOK: query: SHOW TABLES FROM `database` LIKE "foo"
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:database
 foo

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/spark/temp_table.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/temp_table.q.out b/ql/src/test/results/clientpositive/spark/temp_table.q.out
index 30563b2..0801abc 100644
--- a/ql/src/test/results/clientpositive/spark/temp_table.q.out
+++ b/ql/src/test/results/clientpositive/spark/temp_table.q.out
@@ -366,8 +366,10 @@ POSTHOOK: Input: default@bay
 104	val_104
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 bar
 bay
@@ -401,8 +403,10 @@ POSTHOOK: type: SWITCHDATABASE
 POSTHOOK: Input: database:two
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:two
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:two
 PREHOOK: query: CREATE TEMPORARY TABLE foo AS SELECT * FROM default.foo
 PREHOOK: type: CREATETABLE_AS_SELECT
 PREHOOK: Input: default@foo
@@ -415,8 +419,10 @@ POSTHOOK: Output: database:two
 POSTHOOK: Output: two@foo
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:two
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:two
 foo
 PREHOOK: query: use default
 PREHOOK: type: SWITCHDATABASE

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/temp_table.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/temp_table.q.out b/ql/src/test/results/clientpositive/temp_table.q.out
index 2c5730d..e2987fe 100644
--- a/ql/src/test/results/clientpositive/temp_table.q.out
+++ b/ql/src/test/results/clientpositive/temp_table.q.out
@@ -438,8 +438,10 @@ POSTHOOK: Input: default@bay
 104	val_104
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 bar
 bay
@@ -473,8 +475,10 @@ POSTHOOK: type: SWITCHDATABASE
 POSTHOOK: Input: database:two
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:two
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:two
 PREHOOK: query: CREATE TEMPORARY TABLE foo AS SELECT * FROM default.foo
 PREHOOK: type: CREATETABLE_AS_SELECT
 PREHOOK: Input: default@foo
@@ -487,8 +491,10 @@ POSTHOOK: Output: database:two
 POSTHOOK: Output: two@foo
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:two
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:two
 foo
 PREHOOK: query: use default
 PREHOOK: type: SWITCHDATABASE

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/temp_table_names.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/temp_table_names.q.out b/ql/src/test/results/clientpositive/temp_table_names.q.out
index 890ab14..e2b368b 100644
--- a/ql/src/test/results/clientpositive/temp_table_names.q.out
+++ b/ql/src/test/results/clientpositive/temp_table_names.q.out
@@ -10,18 +10,24 @@ POSTHOOK: Output: Default@Temp_Table_Names
 POSTHOOK: Output: database:default
 PREHOOK: query: show tables 'Temp_Table*'
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: show tables 'Temp_Table*'
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 temp_table_names
 PREHOOK: query: show tables in default 'temp_table_names'
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: show tables in default 'temp_table_names'
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 temp_table_names
 PREHOOK: query: show tables in DEFAULT 'TEMP_TABLE_NAMES'
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: show tables in DEFAULT 'TEMP_TABLE_NAMES'
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 temp_table_names
 PREHOOK: query: select c1 from default.temp_table_names
 PREHOOK: type: QUERY
@@ -49,5 +55,7 @@ POSTHOOK: Input: default@temp_table_names
 POSTHOOK: Output: default@temp_table_names
 PREHOOK: query: show tables 'temp_table_names'
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: show tables 'temp_table_names'
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default

http://git-wip-us.apache.org/repos/asf/hive/blob/fac9ee90/ql/src/test/results/clientpositive/tez/temp_table.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/temp_table.q.out b/ql/src/test/results/clientpositive/tez/temp_table.q.out
index 89c1784..49f57c2 100644
--- a/ql/src/test/results/clientpositive/tez/temp_table.q.out
+++ b/ql/src/test/results/clientpositive/tez/temp_table.q.out
@@ -378,8 +378,10 @@ POSTHOOK: Input: default@bay
 104	val_104
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:default
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:default
 alltypesorc
 bar
 bay
@@ -413,8 +415,10 @@ POSTHOOK: type: SWITCHDATABASE
 POSTHOOK: Input: database:two
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:two
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:two
 PREHOOK: query: CREATE TEMPORARY TABLE foo AS SELECT * FROM default.foo
 PREHOOK: type: CREATETABLE_AS_SELECT
 PREHOOK: Input: default@foo
@@ -427,8 +431,10 @@ POSTHOOK: Output: database:two
 POSTHOOK: Output: two@foo
 PREHOOK: query: SHOW TABLES
 PREHOOK: type: SHOWTABLES
+PREHOOK: Input: database:two
 POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
+POSTHOOK: Input: database:two
 foo
 PREHOOK: query: use default
 PREHOOK: type: SWITCHDATABASE


Mime
View raw message