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 <ga...@hortonworks.com> Authored: Tue May 29 12:21:32 2018 -0700 Committer: Alan Gates <ga...@hortonworks.com> 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. */