hive git commit: HIVE-19576 IHMSHandler.getTable not always fetching the right catalog (Alan Gates, reviewed by Daniel Dai)

2018-05-29 Thread gates
Repository: hive
Updated Branches:
  refs/heads/branch-3.0 2073cdebe -> 84f18e4ea


HIVE-19576 IHMSHandler.getTable not always fetching the right catalog (Alan 
Gates, reviewed by Daniel Dai)


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

Branch: refs/heads/branch-3.0
Commit: 84f18e4eabdc33812e320e3440912425f45f5423
Parents: 2073cde
Author: Alan Gates 
Authored: Tue May 29 12:21:32 2018 -0700
Committer: Alan Gates 
Committed: Tue May 29 12:31:09 2018 -0700

--
 .../authorization/AuthorizationPreEventListener.java |  4 +++-
 .../apache/hadoop/hive/metastore/IHMSHandler.java| 15 ---
 2 files changed, 3 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/84f18e4e/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
--
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
 
b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
index 16efb72..2cc057e 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
@@ -464,8 +464,10 @@ public class AuthorizationPreEventListener extends 
MetaStorePreEventListener {
 public PartitionWrapper(org.apache.hadoop.hive.metastore.api.Partition 
mapiPart,
 PreEventContext context) throws HiveException, NoSuchObjectException, 
MetaException {
   org.apache.hadoop.hive.metastore.api.Partition wrapperApiPart = 
mapiPart.deepCopy();
+  String catName = mapiPart.isSetCatName() ? mapiPart.getCatName() :
+  MetaStoreUtils.getDefaultCatalog(context.getHandler().getConf());
   org.apache.hadoop.hive.metastore.api.Table t = 
context.getHandler().get_table_core(
-  mapiPart.getDbName(), mapiPart.getTableName());
+  catName, mapiPart.getDbName(), mapiPart.getTableName());
   if (wrapperApiPart.getSd() == null){
 // In the cases of create partition, by the time this event fires, the 
partition
 // object has not yet come into existence, and thus will not yet have a

http://git-wip-us.apache.org/repos/asf/hive/blob/84f18e4e/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
--
diff --git 
a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
index 1a81dc9..29c98d1 100644
--- 
a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
+++ 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
@@ -91,21 +91,6 @@ public interface IHMSHandler extends 
ThriftHiveMetastore.Iface, Configurable {
   throws MetaException, NoSuchObjectException;
 
   /**
-   * Equivalent of get_table, but does not log audits and fire pre-event 
listener.
-   * Meant to be used for calls made by other hive classes, that are not using 
the
-   * thrift interface.  Uses the configured catalog.
-   * @param dbName database name
-   * @param name table name
-   * @return Table object
-   * @throws NoSuchObjectException If the table does not exist.
-   * @throws MetaException  If another error occurs.
-   */
-  default Table get_table_core(final String dbName, final String name)
-  throws MetaException, NoSuchObjectException {
-return get_table_core(MetaStoreUtils.getDefaultCatalog(getConf()), dbName, 
name);
-  }
-
-  /**
* Get a list of all transactional listeners.
* @return list of listeners.
*/



hive git commit: HIVE-19576 IHMSHandler.getTable not always fetching the right catalog (Alan Gates, reviewed by Daniel Dai)

2018-05-29 Thread gates
Repository: hive
Updated Branches:
  refs/heads/branch-3 80eafb4fa -> 7156df66f


HIVE-19576 IHMSHandler.getTable not always fetching the right catalog (Alan 
Gates, reviewed by Daniel Dai)


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

Branch: refs/heads/branch-3
Commit: 7156df66fcf05549c2c0c7f5cbfd6539cf035f16
Parents: 80eafb4
Author: Alan Gates 
Authored: Tue May 29 12:21:32 2018 -0700
Committer: Alan Gates 
Committed: Tue May 29 12:23:13 2018 -0700

--
 .../authorization/AuthorizationPreEventListener.java |  4 +++-
 .../apache/hadoop/hive/metastore/IHMSHandler.java| 15 ---
 2 files changed, 3 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/7156df66/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
--
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
 
b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
index 16efb72..2cc057e 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
@@ -464,8 +464,10 @@ public class AuthorizationPreEventListener extends 
MetaStorePreEventListener {
 public PartitionWrapper(org.apache.hadoop.hive.metastore.api.Partition 
mapiPart,
 PreEventContext context) throws HiveException, NoSuchObjectException, 
MetaException {
   org.apache.hadoop.hive.metastore.api.Partition wrapperApiPart = 
mapiPart.deepCopy();
+  String catName = mapiPart.isSetCatName() ? mapiPart.getCatName() :
+  MetaStoreUtils.getDefaultCatalog(context.getHandler().getConf());
   org.apache.hadoop.hive.metastore.api.Table t = 
context.getHandler().get_table_core(
-  mapiPart.getDbName(), mapiPart.getTableName());
+  catName, mapiPart.getDbName(), mapiPart.getTableName());
   if (wrapperApiPart.getSd() == null){
 // In the cases of create partition, by the time this event fires, the 
partition
 // object has not yet come into existence, and thus will not yet have a

http://git-wip-us.apache.org/repos/asf/hive/blob/7156df66/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
--
diff --git 
a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
index 1a81dc9..29c98d1 100644
--- 
a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
+++ 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
@@ -91,21 +91,6 @@ public interface IHMSHandler extends 
ThriftHiveMetastore.Iface, Configurable {
   throws MetaException, NoSuchObjectException;
 
   /**
-   * Equivalent of get_table, but does not log audits and fire pre-event 
listener.
-   * Meant to be used for calls made by other hive classes, that are not using 
the
-   * thrift interface.  Uses the configured catalog.
-   * @param dbName database name
-   * @param name table name
-   * @return Table object
-   * @throws NoSuchObjectException If the table does not exist.
-   * @throws MetaException  If another error occurs.
-   */
-  default Table get_table_core(final String dbName, final String name)
-  throws MetaException, NoSuchObjectException {
-return get_table_core(MetaStoreUtils.getDefaultCatalog(getConf()), dbName, 
name);
-  }
-
-  /**
* Get a list of all transactional listeners.
* @return list of listeners.
*/



hive git commit: HIVE-19576 IHMSHandler.getTable not always fetching the right catalog (Alan Gates, reviewed by Daniel Dai)

2018-05-29 Thread gates
Repository: hive
Updated Branches:
  refs/heads/master 83afdb4d5 -> b55b521c7


HIVE-19576 IHMSHandler.getTable not always fetching the right catalog (Alan 
Gates, reviewed by Daniel Dai)


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

Branch: refs/heads/master
Commit: b55b521c7d0a3c7e0049fc5d5803647c31c28918
Parents: 83afdb4
Author: Alan Gates 
Authored: Tue May 29 12:21:32 2018 -0700
Committer: Alan Gates 
Committed: Tue May 29 12:21:32 2018 -0700

--
 .../authorization/AuthorizationPreEventListener.java |  4 +++-
 .../apache/hadoop/hive/metastore/IHMSHandler.java| 15 ---
 2 files changed, 3 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/b55b521c/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
--
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
 
b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
index 16efb72..2cc057e 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
@@ -464,8 +464,10 @@ public class AuthorizationPreEventListener extends 
MetaStorePreEventListener {
 public PartitionWrapper(org.apache.hadoop.hive.metastore.api.Partition 
mapiPart,
 PreEventContext context) throws HiveException, NoSuchObjectException, 
MetaException {
   org.apache.hadoop.hive.metastore.api.Partition wrapperApiPart = 
mapiPart.deepCopy();
+  String catName = mapiPart.isSetCatName() ? mapiPart.getCatName() :
+  MetaStoreUtils.getDefaultCatalog(context.getHandler().getConf());
   org.apache.hadoop.hive.metastore.api.Table t = 
context.getHandler().get_table_core(
-  mapiPart.getDbName(), mapiPart.getTableName());
+  catName, mapiPart.getDbName(), mapiPart.getTableName());
   if (wrapperApiPart.getSd() == null){
 // In the cases of create partition, by the time this event fires, the 
partition
 // object has not yet come into existence, and thus will not yet have a

http://git-wip-us.apache.org/repos/asf/hive/blob/b55b521c/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
--
diff --git 
a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
index 1a81dc9..29c98d1 100644
--- 
a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
+++ 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
@@ -91,21 +91,6 @@ public interface IHMSHandler extends 
ThriftHiveMetastore.Iface, Configurable {
   throws MetaException, NoSuchObjectException;
 
   /**
-   * Equivalent of get_table, but does not log audits and fire pre-event 
listener.
-   * Meant to be used for calls made by other hive classes, that are not using 
the
-   * thrift interface.  Uses the configured catalog.
-   * @param dbName database name
-   * @param name table name
-   * @return Table object
-   * @throws NoSuchObjectException If the table does not exist.
-   * @throws MetaException  If another error occurs.
-   */
-  default Table get_table_core(final String dbName, final String name)
-  throws MetaException, NoSuchObjectException {
-return get_table_core(MetaStoreUtils.getDefaultCatalog(getConf()), dbName, 
name);
-  }
-
-  /**
* Get a list of all transactional listeners.
* @return list of listeners.
*/