You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by gs...@apache.org on 2023/05/11 23:28:53 UTC

[hive] branch master updated: HIVE-27319: HMS server should throw InvalidObjectException in get_par… (#4299) (Sai Hemanth G, Reviewed by Zhihua Deng, Naveen Gangam)

This is an automated email from the ASF dual-hosted git repository.

gsaihemanth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 64bc8bb2921 HIVE-27319: HMS server should throw InvalidObjectException in get_par… (#4299) (Sai Hemanth G, Reviewed by Zhihua Deng, Naveen Gangam)
64bc8bb2921 is described below

commit 64bc8bb29215ad51c719a78acf9d8012a5a66d27
Author: Sai Hemanth Gantasala <68...@users.noreply.github.com>
AuthorDate: Thu May 11 16:28:40 2023 -0700

    HIVE-27319: HMS server should throw InvalidObjectException in get_par… (#4299) (Sai Hemanth G, Reviewed by Zhihua Deng, Naveen Gangam)
---
 .../src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp |  60 +++++
 .../src/gen/thrift/gen-cpp/ThriftHiveMetastore.h   |  24 +-
 .../hive/metastore/api/ThriftHiveMetastore.java    | 262 +++++++++++++++++++--
 .../metastore/ThriftHiveMetastoreClient.php        |   6 +
 .../gen-php/metastore/ThriftHiveMetastoreIf.php    |   2 +
 ...etastore_get_partitions_by_names_req_result.php |  26 ++
 ...iveMetastore_get_partitions_by_names_result.php |  26 ++
 .../gen-py/hive_metastore/ThriftHiveMetastore.py   |  38 ++-
 .../src/gen/thrift/gen-rb/thrift_hive_metastore.rb |  14 +-
 .../src/main/thrift/hive_metastore.thrift          |   4 +-
 .../apache/hadoop/hive/metastore/HMSHandler.java   |   4 +-
 .../hadoop/hive/metastore/TestHiveMetaStore.java   |  48 ++++
 12 files changed, 487 insertions(+), 27 deletions(-)

diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp b/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp
index db3d0880014..75db7d6b3ed 100644
--- a/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp
+++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp
@@ -26640,6 +26640,14 @@ uint32_t ThriftHiveMetastore_get_partitions_by_names_result::read(::apache::thri
           xfer += iprot->skip(ftype);
         }
         break;
+      case 3:
+        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+          xfer += this->o3.read(iprot);
+          this->__isset.o3 = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
       default:
         xfer += iprot->skip(ftype);
         break;
@@ -26678,6 +26686,10 @@ uint32_t ThriftHiveMetastore_get_partitions_by_names_result::write(::apache::thr
     xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2);
     xfer += this->o2.write(oprot);
     xfer += oprot->writeFieldEnd();
+  } else if (this->__isset.o3) {
+    xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3);
+    xfer += this->o3.write(oprot);
+    xfer += oprot->writeFieldEnd();
   }
   xfer += oprot->writeFieldStop();
   xfer += oprot->writeStructEnd();
@@ -26746,6 +26758,14 @@ uint32_t ThriftHiveMetastore_get_partitions_by_names_presult::read(::apache::thr
           xfer += iprot->skip(ftype);
         }
         break;
+      case 3:
+        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+          xfer += this->o3.read(iprot);
+          this->__isset.o3 = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
       default:
         xfer += iprot->skip(ftype);
         break;
@@ -26887,6 +26907,14 @@ uint32_t ThriftHiveMetastore_get_partitions_by_names_req_result::read(::apache::
           xfer += iprot->skip(ftype);
         }
         break;
+      case 3:
+        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+          xfer += this->o3.read(iprot);
+          this->__isset.o3 = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
       default:
         xfer += iprot->skip(ftype);
         break;
@@ -26917,6 +26945,10 @@ uint32_t ThriftHiveMetastore_get_partitions_by_names_req_result::write(::apache:
     xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2);
     xfer += this->o2.write(oprot);
     xfer += oprot->writeFieldEnd();
+  } else if (this->__isset.o3) {
+    xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3);
+    xfer += this->o3.write(oprot);
+    xfer += oprot->writeFieldEnd();
   }
   xfer += oprot->writeFieldStop();
   xfer += oprot->writeStructEnd();
@@ -26973,6 +27005,14 @@ uint32_t ThriftHiveMetastore_get_partitions_by_names_req_presult::read(::apache:
           xfer += iprot->skip(ftype);
         }
         break;
+      case 3:
+        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+          xfer += this->o3.read(iprot);
+          this->__isset.o3 = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
       default:
         xfer += iprot->skip(ftype);
         break;
@@ -71118,6 +71158,9 @@ void ThriftHiveMetastoreClient::recv_get_partitions_by_names(std::vector<Partiti
   if (result.__isset.o2) {
     throw result.o2;
   }
+  if (result.__isset.o3) {
+    throw result.o3;
+  }
   throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_by_names failed: unknown result");
 }
 
@@ -71182,6 +71225,9 @@ void ThriftHiveMetastoreClient::recv_get_partitions_by_names_req(GetPartitionsBy
   if (result.__isset.o2) {
     throw result.o2;
   }
+  if (result.__isset.o3) {
+    throw result.o3;
+  }
   throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_by_names_req failed: unknown result");
 }
 
@@ -87798,6 +87844,9 @@ void ThriftHiveMetastoreProcessor::process_get_partitions_by_names(int32_t seqid
   } catch (NoSuchObjectException &o2) {
     result.o2 = std::move(o2);
     result.__isset.o2 = true;
+  } catch (InvalidObjectException &o3) {
+    result.o3 = std::move(o3);
+    result.__isset.o3 = true;
   } catch (const std::exception& e) {
     if (this->eventHandler_.get() != nullptr) {
       this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_by_names");
@@ -87858,6 +87907,9 @@ void ThriftHiveMetastoreProcessor::process_get_partitions_by_names_req(int32_t s
   } catch (NoSuchObjectException &o2) {
     result.o2 = std::move(o2);
     result.__isset.o2 = true;
+  } catch (InvalidObjectException &o3) {
+    result.o3 = std::move(o3);
+    result.__isset.o3 = true;
   } catch (const std::exception& e) {
     if (this->eventHandler_.get() != nullptr) {
       this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_by_names_req");
@@ -107260,6 +107312,10 @@ void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_by_names(std::vect
         sentry.commit();
         throw result.o2;
       }
+      if (result.__isset.o3) {
+        sentry.commit();
+        throw result.o3;
+      }
       // in a bad state, don't commit
       throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_by_names failed: unknown result");
     }
@@ -107352,6 +107408,10 @@ void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_by_names_req(GetPa
         sentry.commit();
         throw result.o2;
       }
+      if (result.__isset.o3) {
+        sentry.commit();
+        throw result.o3;
+      }
       // in a bad state, don't commit
       throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_by_names_req failed: unknown result");
     }
diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h b/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h
index 9a0132ac839..9dab5870c86 100644
--- a/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h
+++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h
@@ -14350,10 +14350,11 @@ class ThriftHiveMetastore_get_partitions_by_names_pargs {
 };
 
 typedef struct _ThriftHiveMetastore_get_partitions_by_names_result__isset {
-  _ThriftHiveMetastore_get_partitions_by_names_result__isset() : success(false), o1(false), o2(false) {}
+  _ThriftHiveMetastore_get_partitions_by_names_result__isset() : success(false), o1(false), o2(false), o3(false) {}
   bool success :1;
   bool o1 :1;
   bool o2 :1;
+  bool o3 :1;
 } _ThriftHiveMetastore_get_partitions_by_names_result__isset;
 
 class ThriftHiveMetastore_get_partitions_by_names_result {
@@ -14368,6 +14369,7 @@ class ThriftHiveMetastore_get_partitions_by_names_result {
   std::vector<Partition>  success;
   MetaException o1;
   NoSuchObjectException o2;
+  InvalidObjectException o3;
 
   _ThriftHiveMetastore_get_partitions_by_names_result__isset __isset;
 
@@ -14377,6 +14379,8 @@ class ThriftHiveMetastore_get_partitions_by_names_result {
 
   void __set_o2(const NoSuchObjectException& val);
 
+  void __set_o3(const InvalidObjectException& val);
+
   bool operator == (const ThriftHiveMetastore_get_partitions_by_names_result & rhs) const
   {
     if (!(success == rhs.success))
@@ -14385,6 +14389,8 @@ class ThriftHiveMetastore_get_partitions_by_names_result {
       return false;
     if (!(o2 == rhs.o2))
       return false;
+    if (!(o3 == rhs.o3))
+      return false;
     return true;
   }
   bool operator != (const ThriftHiveMetastore_get_partitions_by_names_result &rhs) const {
@@ -14399,10 +14405,11 @@ class ThriftHiveMetastore_get_partitions_by_names_result {
 };
 
 typedef struct _ThriftHiveMetastore_get_partitions_by_names_presult__isset {
-  _ThriftHiveMetastore_get_partitions_by_names_presult__isset() : success(false), o1(false), o2(false) {}
+  _ThriftHiveMetastore_get_partitions_by_names_presult__isset() : success(false), o1(false), o2(false), o3(false) {}
   bool success :1;
   bool o1 :1;
   bool o2 :1;
+  bool o3 :1;
 } _ThriftHiveMetastore_get_partitions_by_names_presult__isset;
 
 class ThriftHiveMetastore_get_partitions_by_names_presult {
@@ -14413,6 +14420,7 @@ class ThriftHiveMetastore_get_partitions_by_names_presult {
   std::vector<Partition> * success;
   MetaException o1;
   NoSuchObjectException o2;
+  InvalidObjectException o3;
 
   _ThriftHiveMetastore_get_partitions_by_names_presult__isset __isset;
 
@@ -14470,10 +14478,11 @@ class ThriftHiveMetastore_get_partitions_by_names_req_pargs {
 };
 
 typedef struct _ThriftHiveMetastore_get_partitions_by_names_req_result__isset {
-  _ThriftHiveMetastore_get_partitions_by_names_req_result__isset() : success(false), o1(false), o2(false) {}
+  _ThriftHiveMetastore_get_partitions_by_names_req_result__isset() : success(false), o1(false), o2(false), o3(false) {}
   bool success :1;
   bool o1 :1;
   bool o2 :1;
+  bool o3 :1;
 } _ThriftHiveMetastore_get_partitions_by_names_req_result__isset;
 
 class ThriftHiveMetastore_get_partitions_by_names_req_result {
@@ -14488,6 +14497,7 @@ class ThriftHiveMetastore_get_partitions_by_names_req_result {
   GetPartitionsByNamesResult success;
   MetaException o1;
   NoSuchObjectException o2;
+  InvalidObjectException o3;
 
   _ThriftHiveMetastore_get_partitions_by_names_req_result__isset __isset;
 
@@ -14497,6 +14507,8 @@ class ThriftHiveMetastore_get_partitions_by_names_req_result {
 
   void __set_o2(const NoSuchObjectException& val);
 
+  void __set_o3(const InvalidObjectException& val);
+
   bool operator == (const ThriftHiveMetastore_get_partitions_by_names_req_result & rhs) const
   {
     if (!(success == rhs.success))
@@ -14505,6 +14517,8 @@ class ThriftHiveMetastore_get_partitions_by_names_req_result {
       return false;
     if (!(o2 == rhs.o2))
       return false;
+    if (!(o3 == rhs.o3))
+      return false;
     return true;
   }
   bool operator != (const ThriftHiveMetastore_get_partitions_by_names_req_result &rhs) const {
@@ -14519,10 +14533,11 @@ class ThriftHiveMetastore_get_partitions_by_names_req_result {
 };
 
 typedef struct _ThriftHiveMetastore_get_partitions_by_names_req_presult__isset {
-  _ThriftHiveMetastore_get_partitions_by_names_req_presult__isset() : success(false), o1(false), o2(false) {}
+  _ThriftHiveMetastore_get_partitions_by_names_req_presult__isset() : success(false), o1(false), o2(false), o3(false) {}
   bool success :1;
   bool o1 :1;
   bool o2 :1;
+  bool o3 :1;
 } _ThriftHiveMetastore_get_partitions_by_names_req_presult__isset;
 
 class ThriftHiveMetastore_get_partitions_by_names_req_presult {
@@ -14533,6 +14548,7 @@ class ThriftHiveMetastore_get_partitions_by_names_req_presult {
   GetPartitionsByNamesResult* success;
   MetaException o1;
   NoSuchObjectException o2;
+  InvalidObjectException o3;
 
   _ThriftHiveMetastore_get_partitions_by_names_req_presult__isset __isset;
 
diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java
index bf9def9de93..15c606dd947 100644
--- a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java
+++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java
@@ -219,9 +219,9 @@ package org.apache.hadoop.hive.metastore.api;
 
     public int get_num_partitions_by_filter(java.lang.String db_name, java.lang.String tbl_name, java.lang.String filter) throws MetaException, NoSuchObjectException, org.apache.thrift.TException;
 
-    public java.util.List<Partition> get_partitions_by_names(java.lang.String db_name, java.lang.String tbl_name, java.util.List<java.lang.String> names) throws MetaException, NoSuchObjectException, org.apache.thrift.TException;
+    public java.util.List<Partition> get_partitions_by_names(java.lang.String db_name, java.lang.String tbl_name, java.util.List<java.lang.String> names) throws MetaException, NoSuchObjectException, InvalidObjectException, org.apache.thrift.TException;
 
-    public GetPartitionsByNamesResult get_partitions_by_names_req(GetPartitionsByNamesRequest req) throws MetaException, NoSuchObjectException, org.apache.thrift.TException;
+    public GetPartitionsByNamesResult get_partitions_by_names_req(GetPartitionsByNamesRequest req) throws MetaException, NoSuchObjectException, InvalidObjectException, org.apache.thrift.TException;
 
     public void alter_partition(java.lang.String db_name, java.lang.String tbl_name, Partition new_part) throws InvalidOperationException, MetaException, org.apache.thrift.TException;
 
@@ -4184,7 +4184,7 @@ package org.apache.hadoop.hive.metastore.api;
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "get_num_partitions_by_filter failed: unknown result");
     }
 
-    public java.util.List<Partition> get_partitions_by_names(java.lang.String db_name, java.lang.String tbl_name, java.util.List<java.lang.String> names) throws MetaException, NoSuchObjectException, org.apache.thrift.TException
+    public java.util.List<Partition> get_partitions_by_names(java.lang.String db_name, java.lang.String tbl_name, java.util.List<java.lang.String> names) throws MetaException, NoSuchObjectException, InvalidObjectException, org.apache.thrift.TException
     {
       send_get_partitions_by_names(db_name, tbl_name, names);
       return recv_get_partitions_by_names();
@@ -4199,7 +4199,7 @@ package org.apache.hadoop.hive.metastore.api;
       sendBase("get_partitions_by_names", args);
     }
 
-    public java.util.List<Partition> recv_get_partitions_by_names() throws MetaException, NoSuchObjectException, org.apache.thrift.TException
+    public java.util.List<Partition> recv_get_partitions_by_names() throws MetaException, NoSuchObjectException, InvalidObjectException, org.apache.thrift.TException
     {
       get_partitions_by_names_result result = new get_partitions_by_names_result();
       receiveBase(result, "get_partitions_by_names");
@@ -4212,10 +4212,13 @@ package org.apache.hadoop.hive.metastore.api;
       if (result.o2 != null) {
         throw result.o2;
       }
+      if (result.o3 != null) {
+        throw result.o3;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "get_partitions_by_names failed: unknown result");
     }
 
-    public GetPartitionsByNamesResult get_partitions_by_names_req(GetPartitionsByNamesRequest req) throws MetaException, NoSuchObjectException, org.apache.thrift.TException
+    public GetPartitionsByNamesResult get_partitions_by_names_req(GetPartitionsByNamesRequest req) throws MetaException, NoSuchObjectException, InvalidObjectException, org.apache.thrift.TException
     {
       send_get_partitions_by_names_req(req);
       return recv_get_partitions_by_names_req();
@@ -4228,7 +4231,7 @@ package org.apache.hadoop.hive.metastore.api;
       sendBase("get_partitions_by_names_req", args);
     }
 
-    public GetPartitionsByNamesResult recv_get_partitions_by_names_req() throws MetaException, NoSuchObjectException, org.apache.thrift.TException
+    public GetPartitionsByNamesResult recv_get_partitions_by_names_req() throws MetaException, NoSuchObjectException, InvalidObjectException, org.apache.thrift.TException
     {
       get_partitions_by_names_req_result result = new get_partitions_by_names_req_result();
       receiveBase(result, "get_partitions_by_names_req");
@@ -4241,6 +4244,9 @@ package org.apache.hadoop.hive.metastore.api;
       if (result.o2 != null) {
         throw result.o2;
       }
+      if (result.o3 != null) {
+        throw result.o3;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "get_partitions_by_names_req failed: unknown result");
     }
 
@@ -12490,7 +12496,7 @@ package org.apache.hadoop.hive.metastore.api;
         prot.writeMessageEnd();
       }
 
-      public java.util.List<Partition> getResult() throws MetaException, NoSuchObjectException, org.apache.thrift.TException {
+      public java.util.List<Partition> getResult() throws MetaException, NoSuchObjectException, InvalidObjectException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new java.lang.IllegalStateException("Method call not finished!");
         }
@@ -12522,7 +12528,7 @@ package org.apache.hadoop.hive.metastore.api;
         prot.writeMessageEnd();
       }
 
-      public GetPartitionsByNamesResult getResult() throws MetaException, NoSuchObjectException, org.apache.thrift.TException {
+      public GetPartitionsByNamesResult getResult() throws MetaException, NoSuchObjectException, InvalidObjectException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new java.lang.IllegalStateException("Method call not finished!");
         }
@@ -21634,6 +21640,8 @@ package org.apache.hadoop.hive.metastore.api;
           result.o1 = o1;
         } catch (NoSuchObjectException o2) {
           result.o2 = o2;
+        } catch (InvalidObjectException o3) {
+          result.o3 = o3;
         }
         return result;
       }
@@ -21665,6 +21673,8 @@ package org.apache.hadoop.hive.metastore.api;
           result.o1 = o1;
         } catch (NoSuchObjectException o2) {
           result.o2 = o2;
+        } catch (InvalidObjectException o3) {
+          result.o3 = o3;
         }
         return result;
       }
@@ -34147,6 +34157,10 @@ package org.apache.hadoop.hive.metastore.api;
               result.o2 = (NoSuchObjectException) e;
               result.setO2IsSet(true);
               msg = result;
+            } else if (e instanceof InvalidObjectException) {
+              result.o3 = (InvalidObjectException) e;
+              result.setO3IsSet(true);
+              msg = result;
             } else if (e instanceof org.apache.thrift.transport.TTransportException) {
               _LOGGER.error("TTransportException inside handler", e);
               fb.close();
@@ -34216,6 +34230,10 @@ package org.apache.hadoop.hive.metastore.api;
               result.o2 = (NoSuchObjectException) e;
               result.setO2IsSet(true);
               msg = result;
+            } else if (e instanceof InvalidObjectException) {
+              result.o3 = (InvalidObjectException) e;
+              result.setO3IsSet(true);
+              msg = result;
             } else if (e instanceof org.apache.thrift.transport.TTransportException) {
               _LOGGER.error("TTransportException inside handler", e);
               fb.close();
@@ -155967,6 +155985,7 @@ package org.apache.hadoop.hive.metastore.api;
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
     private static final org.apache.thrift.protocol.TField O1_FIELD_DESC = new org.apache.thrift.protocol.TField("o1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
     private static final org.apache.thrift.protocol.TField O2_FIELD_DESC = new org.apache.thrift.protocol.TField("o2", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+    private static final org.apache.thrift.protocol.TField O3_FIELD_DESC = new org.apache.thrift.protocol.TField("o3", org.apache.thrift.protocol.TType.STRUCT, (short)3);
 
     private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new get_partitions_by_names_resultStandardSchemeFactory();
     private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new get_partitions_by_names_resultTupleSchemeFactory();
@@ -155974,12 +155993,14 @@ package org.apache.hadoop.hive.metastore.api;
     private @org.apache.thrift.annotation.Nullable java.util.List<Partition> success; // required
     private @org.apache.thrift.annotation.Nullable MetaException o1; // required
     private @org.apache.thrift.annotation.Nullable NoSuchObjectException o2; // required
+    private @org.apache.thrift.annotation.Nullable InvalidObjectException o3; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success"),
       O1((short)1, "o1"),
-      O2((short)2, "o2");
+      O2((short)2, "o2"),
+      O3((short)3, "o3");
 
       private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
@@ -156001,6 +156022,8 @@ package org.apache.hadoop.hive.metastore.api;
             return O1;
           case 2: // O2
             return O2;
+          case 3: // O3
+            return O3;
           default:
             return null;
         }
@@ -156052,6 +156075,8 @@ package org.apache.hadoop.hive.metastore.api;
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, MetaException.class)));
       tmpMap.put(_Fields.O2, new org.apache.thrift.meta_data.FieldMetaData("o2", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NoSuchObjectException.class)));
+      tmpMap.put(_Fields.O3, new org.apache.thrift.meta_data.FieldMetaData("o3", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InvalidObjectException.class)));
       metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_partitions_by_names_result.class, metaDataMap);
     }
@@ -156062,12 +156087,14 @@ package org.apache.hadoop.hive.metastore.api;
     public get_partitions_by_names_result(
       java.util.List<Partition> success,
       MetaException o1,
-      NoSuchObjectException o2)
+      NoSuchObjectException o2,
+      InvalidObjectException o3)
     {
       this();
       this.success = success;
       this.o1 = o1;
       this.o2 = o2;
+      this.o3 = o3;
     }
 
     /**
@@ -156087,6 +156114,9 @@ package org.apache.hadoop.hive.metastore.api;
       if (other.isSetO2()) {
         this.o2 = new NoSuchObjectException(other.o2);
       }
+      if (other.isSetO3()) {
+        this.o3 = new InvalidObjectException(other.o3);
+      }
     }
 
     public get_partitions_by_names_result deepCopy() {
@@ -156098,6 +156128,7 @@ package org.apache.hadoop.hive.metastore.api;
       this.success = null;
       this.o1 = null;
       this.o2 = null;
+      this.o3 = null;
     }
 
     public int getSuccessSize() {
@@ -156188,6 +156219,30 @@ package org.apache.hadoop.hive.metastore.api;
       }
     }
 
+    @org.apache.thrift.annotation.Nullable
+    public InvalidObjectException getO3() {
+      return this.o3;
+    }
+
+    public void setO3(@org.apache.thrift.annotation.Nullable InvalidObjectException o3) {
+      this.o3 = o3;
+    }
+
+    public void unsetO3() {
+      this.o3 = null;
+    }
+
+    /** Returns true if field o3 is set (has been assigned a value) and false otherwise */
+    public boolean isSetO3() {
+      return this.o3 != null;
+    }
+
+    public void setO3IsSet(boolean value) {
+      if (!value) {
+        this.o3 = null;
+      }
+    }
+
     public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
       switch (field) {
       case SUCCESS:
@@ -156214,6 +156269,14 @@ package org.apache.hadoop.hive.metastore.api;
         }
         break;
 
+      case O3:
+        if (value == null) {
+          unsetO3();
+        } else {
+          setO3((InvalidObjectException)value);
+        }
+        break;
+
       }
     }
 
@@ -156229,6 +156292,9 @@ package org.apache.hadoop.hive.metastore.api;
       case O2:
         return getO2();
 
+      case O3:
+        return getO3();
+
       }
       throw new java.lang.IllegalStateException();
     }
@@ -156246,6 +156312,8 @@ package org.apache.hadoop.hive.metastore.api;
         return isSetO1();
       case O2:
         return isSetO2();
+      case O3:
+        return isSetO3();
       }
       throw new java.lang.IllegalStateException();
     }
@@ -156290,6 +156358,15 @@ package org.apache.hadoop.hive.metastore.api;
           return false;
       }
 
+      boolean this_present_o3 = true && this.isSetO3();
+      boolean that_present_o3 = true && that.isSetO3();
+      if (this_present_o3 || that_present_o3) {
+        if (!(this_present_o3 && that_present_o3))
+          return false;
+        if (!this.o3.equals(that.o3))
+          return false;
+      }
+
       return true;
     }
 
@@ -156309,6 +156386,10 @@ package org.apache.hadoop.hive.metastore.api;
       if (isSetO2())
         hashCode = hashCode * 8191 + o2.hashCode();
 
+      hashCode = hashCode * 8191 + ((isSetO3()) ? 131071 : 524287);
+      if (isSetO3())
+        hashCode = hashCode * 8191 + o3.hashCode();
+
       return hashCode;
     }
 
@@ -156350,6 +156431,16 @@ package org.apache.hadoop.hive.metastore.api;
           return lastComparison;
         }
       }
+      lastComparison = java.lang.Boolean.compare(isSetO3(), other.isSetO3());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetO3()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.o3, other.o3);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
       return 0;
     }
 
@@ -156394,6 +156485,14 @@ package org.apache.hadoop.hive.metastore.api;
         sb.append(this.o2);
       }
       first = false;
+      if (!first) sb.append(", ");
+      sb.append("o3:");
+      if (this.o3 == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.o3);
+      }
+      first = false;
       sb.append(")");
       return sb.toString();
     }
@@ -156474,6 +156573,15 @@ package org.apache.hadoop.hive.metastore.api;
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
               break;
+            case 3: // O3
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.o3 = new InvalidObjectException();
+                struct.o3.read(iprot);
+                struct.setO3IsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
             default:
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
           }
@@ -156509,6 +156617,11 @@ package org.apache.hadoop.hive.metastore.api;
           struct.o2.write(oprot);
           oprot.writeFieldEnd();
         }
+        if (struct.o3 != null) {
+          oprot.writeFieldBegin(O3_FIELD_DESC);
+          struct.o3.write(oprot);
+          oprot.writeFieldEnd();
+        }
         oprot.writeFieldStop();
         oprot.writeStructEnd();
       }
@@ -156536,7 +156649,10 @@ package org.apache.hadoop.hive.metastore.api;
         if (struct.isSetO2()) {
           optionals.set(2);
         }
-        oprot.writeBitSet(optionals, 3);
+        if (struct.isSetO3()) {
+          optionals.set(3);
+        }
+        oprot.writeBitSet(optionals, 4);
         if (struct.isSetSuccess()) {
           {
             oprot.writeI32(struct.success.size());
@@ -156552,12 +156668,15 @@ package org.apache.hadoop.hive.metastore.api;
         if (struct.isSetO2()) {
           struct.o2.write(oprot);
         }
+        if (struct.isSetO3()) {
+          struct.o3.write(oprot);
+        }
       }
 
       @Override
       public void read(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_names_result struct) throws org.apache.thrift.TException {
         org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
-        java.util.BitSet incoming = iprot.readBitSet(3);
+        java.util.BitSet incoming = iprot.readBitSet(4);
         if (incoming.get(0)) {
           {
             org.apache.thrift.protocol.TList _list1893 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
@@ -156582,6 +156701,11 @@ package org.apache.hadoop.hive.metastore.api;
           struct.o2.read(iprot);
           struct.setO2IsSet(true);
         }
+        if (incoming.get(3)) {
+          struct.o3 = new InvalidObjectException();
+          struct.o3.read(iprot);
+          struct.setO3IsSet(true);
+        }
       }
     }
 
@@ -156963,6 +157087,7 @@ package org.apache.hadoop.hive.metastore.api;
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
     private static final org.apache.thrift.protocol.TField O1_FIELD_DESC = new org.apache.thrift.protocol.TField("o1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
     private static final org.apache.thrift.protocol.TField O2_FIELD_DESC = new org.apache.thrift.protocol.TField("o2", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+    private static final org.apache.thrift.protocol.TField O3_FIELD_DESC = new org.apache.thrift.protocol.TField("o3", org.apache.thrift.protocol.TType.STRUCT, (short)3);
 
     private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new get_partitions_by_names_req_resultStandardSchemeFactory();
     private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new get_partitions_by_names_req_resultTupleSchemeFactory();
@@ -156970,12 +157095,14 @@ package org.apache.hadoop.hive.metastore.api;
     private @org.apache.thrift.annotation.Nullable GetPartitionsByNamesResult success; // required
     private @org.apache.thrift.annotation.Nullable MetaException o1; // required
     private @org.apache.thrift.annotation.Nullable NoSuchObjectException o2; // required
+    private @org.apache.thrift.annotation.Nullable InvalidObjectException o3; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success"),
       O1((short)1, "o1"),
-      O2((short)2, "o2");
+      O2((short)2, "o2"),
+      O3((short)3, "o3");
 
       private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
@@ -156997,6 +157124,8 @@ package org.apache.hadoop.hive.metastore.api;
             return O1;
           case 2: // O2
             return O2;
+          case 3: // O3
+            return O3;
           default:
             return null;
         }
@@ -157047,6 +157176,8 @@ package org.apache.hadoop.hive.metastore.api;
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, MetaException.class)));
       tmpMap.put(_Fields.O2, new org.apache.thrift.meta_data.FieldMetaData("o2", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NoSuchObjectException.class)));
+      tmpMap.put(_Fields.O3, new org.apache.thrift.meta_data.FieldMetaData("o3", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InvalidObjectException.class)));
       metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_partitions_by_names_req_result.class, metaDataMap);
     }
@@ -157057,12 +157188,14 @@ package org.apache.hadoop.hive.metastore.api;
     public get_partitions_by_names_req_result(
       GetPartitionsByNamesResult success,
       MetaException o1,
-      NoSuchObjectException o2)
+      NoSuchObjectException o2,
+      InvalidObjectException o3)
     {
       this();
       this.success = success;
       this.o1 = o1;
       this.o2 = o2;
+      this.o3 = o3;
     }
 
     /**
@@ -157078,6 +157211,9 @@ package org.apache.hadoop.hive.metastore.api;
       if (other.isSetO2()) {
         this.o2 = new NoSuchObjectException(other.o2);
       }
+      if (other.isSetO3()) {
+        this.o3 = new InvalidObjectException(other.o3);
+      }
     }
 
     public get_partitions_by_names_req_result deepCopy() {
@@ -157089,6 +157225,7 @@ package org.apache.hadoop.hive.metastore.api;
       this.success = null;
       this.o1 = null;
       this.o2 = null;
+      this.o3 = null;
     }
 
     @org.apache.thrift.annotation.Nullable
@@ -157163,6 +157300,30 @@ package org.apache.hadoop.hive.metastore.api;
       }
     }
 
+    @org.apache.thrift.annotation.Nullable
+    public InvalidObjectException getO3() {
+      return this.o3;
+    }
+
+    public void setO3(@org.apache.thrift.annotation.Nullable InvalidObjectException o3) {
+      this.o3 = o3;
+    }
+
+    public void unsetO3() {
+      this.o3 = null;
+    }
+
+    /** Returns true if field o3 is set (has been assigned a value) and false otherwise */
+    public boolean isSetO3() {
+      return this.o3 != null;
+    }
+
+    public void setO3IsSet(boolean value) {
+      if (!value) {
+        this.o3 = null;
+      }
+    }
+
     public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
       switch (field) {
       case SUCCESS:
@@ -157189,6 +157350,14 @@ package org.apache.hadoop.hive.metastore.api;
         }
         break;
 
+      case O3:
+        if (value == null) {
+          unsetO3();
+        } else {
+          setO3((InvalidObjectException)value);
+        }
+        break;
+
       }
     }
 
@@ -157204,6 +157373,9 @@ package org.apache.hadoop.hive.metastore.api;
       case O2:
         return getO2();
 
+      case O3:
+        return getO3();
+
       }
       throw new java.lang.IllegalStateException();
     }
@@ -157221,6 +157393,8 @@ package org.apache.hadoop.hive.metastore.api;
         return isSetO1();
       case O2:
         return isSetO2();
+      case O3:
+        return isSetO3();
       }
       throw new java.lang.IllegalStateException();
     }
@@ -157265,6 +157439,15 @@ package org.apache.hadoop.hive.metastore.api;
           return false;
       }
 
+      boolean this_present_o3 = true && this.isSetO3();
+      boolean that_present_o3 = true && that.isSetO3();
+      if (this_present_o3 || that_present_o3) {
+        if (!(this_present_o3 && that_present_o3))
+          return false;
+        if (!this.o3.equals(that.o3))
+          return false;
+      }
+
       return true;
     }
 
@@ -157284,6 +157467,10 @@ package org.apache.hadoop.hive.metastore.api;
       if (isSetO2())
         hashCode = hashCode * 8191 + o2.hashCode();
 
+      hashCode = hashCode * 8191 + ((isSetO3()) ? 131071 : 524287);
+      if (isSetO3())
+        hashCode = hashCode * 8191 + o3.hashCode();
+
       return hashCode;
     }
 
@@ -157325,6 +157512,16 @@ package org.apache.hadoop.hive.metastore.api;
           return lastComparison;
         }
       }
+      lastComparison = java.lang.Boolean.compare(isSetO3(), other.isSetO3());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetO3()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.o3, other.o3);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
       return 0;
     }
 
@@ -157369,6 +157566,14 @@ package org.apache.hadoop.hive.metastore.api;
         sb.append(this.o2);
       }
       first = false;
+      if (!first) sb.append(", ");
+      sb.append("o3:");
+      if (this.o3 == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.o3);
+      }
+      first = false;
       sb.append(")");
       return sb.toString();
     }
@@ -157442,6 +157647,15 @@ package org.apache.hadoop.hive.metastore.api;
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
               break;
+            case 3: // O3
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.o3 = new InvalidObjectException();
+                struct.o3.read(iprot);
+                struct.setO3IsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
             default:
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
           }
@@ -157470,6 +157684,11 @@ package org.apache.hadoop.hive.metastore.api;
           struct.o2.write(oprot);
           oprot.writeFieldEnd();
         }
+        if (struct.o3 != null) {
+          oprot.writeFieldBegin(O3_FIELD_DESC);
+          struct.o3.write(oprot);
+          oprot.writeFieldEnd();
+        }
         oprot.writeFieldStop();
         oprot.writeStructEnd();
       }
@@ -157497,7 +157716,10 @@ package org.apache.hadoop.hive.metastore.api;
         if (struct.isSetO2()) {
           optionals.set(2);
         }
-        oprot.writeBitSet(optionals, 3);
+        if (struct.isSetO3()) {
+          optionals.set(3);
+        }
+        oprot.writeBitSet(optionals, 4);
         if (struct.isSetSuccess()) {
           struct.success.write(oprot);
         }
@@ -157507,12 +157729,15 @@ package org.apache.hadoop.hive.metastore.api;
         if (struct.isSetO2()) {
           struct.o2.write(oprot);
         }
+        if (struct.isSetO3()) {
+          struct.o3.write(oprot);
+        }
       }
 
       @Override
       public void read(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_names_req_result struct) throws org.apache.thrift.TException {
         org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
-        java.util.BitSet incoming = iprot.readBitSet(3);
+        java.util.BitSet incoming = iprot.readBitSet(4);
         if (incoming.get(0)) {
           struct.success = new GetPartitionsByNamesResult();
           struct.success.read(iprot);
@@ -157528,6 +157753,11 @@ package org.apache.hadoop.hive.metastore.api;
           struct.o2.read(iprot);
           struct.setO2IsSet(true);
         }
+        if (incoming.get(3)) {
+          struct.o3 = new InvalidObjectException();
+          struct.o3.read(iprot);
+          struct.setO3IsSet(true);
+        }
       }
     }
 
diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreClient.php b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreClient.php
index 9fa6942be90..34a69f5662d 100644
--- a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreClient.php
+++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreClient.php
@@ -6811,6 +6811,9 @@ class ThriftHiveMetastoreClient extends \FacebookServiceClient implements \metas
         if ($result->o2 !== null) {
             throw $result->o2;
         }
+        if ($result->o3 !== null) {
+            throw $result->o3;
+        }
         throw new \Exception("get_partitions_by_names failed: unknown result");
     }
 
@@ -6876,6 +6879,9 @@ class ThriftHiveMetastoreClient extends \FacebookServiceClient implements \metas
         if ($result->o2 !== null) {
             throw $result->o2;
         }
+        if ($result->o3 !== null) {
+            throw $result->o3;
+        }
         throw new \Exception("get_partitions_by_names_req failed: unknown result");
     }
 
diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreIf.php b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreIf.php
index e9bfcd476b4..88b9cbd2631 100644
--- a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreIf.php
+++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreIf.php
@@ -849,6 +849,7 @@ interface ThriftHiveMetastoreIf extends \FacebookServiceIf
      * @return \metastore\Partition[]
      * @throws \metastore\MetaException
      * @throws \metastore\NoSuchObjectException
+     * @throws \metastore\InvalidObjectException
      */
     public function get_partitions_by_names($db_name, $tbl_name, array $names);
     /**
@@ -856,6 +857,7 @@ interface ThriftHiveMetastoreIf extends \FacebookServiceIf
      * @return \metastore\GetPartitionsByNamesResult
      * @throws \metastore\MetaException
      * @throws \metastore\NoSuchObjectException
+     * @throws \metastore\InvalidObjectException
      */
     public function get_partitions_by_names_req(\metastore\GetPartitionsByNamesRequest $req);
     /**
diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore_get_partitions_by_names_req_result.php b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore_get_partitions_by_names_req_result.php
index 2003bda54f3..66cde01a895 100644
--- a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore_get_partitions_by_names_req_result.php
+++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore_get_partitions_by_names_req_result.php
@@ -39,6 +39,12 @@ class ThriftHiveMetastore_get_partitions_by_names_req_result
             'type' => TType::STRUCT,
             'class' => '\metastore\NoSuchObjectException',
         ),
+        3 => array(
+            'var' => 'o3',
+            'isRequired' => false,
+            'type' => TType::STRUCT,
+            'class' => '\metastore\InvalidObjectException',
+        ),
     );
 
     /**
@@ -53,6 +59,10 @@ class ThriftHiveMetastore_get_partitions_by_names_req_result
      * @var \metastore\NoSuchObjectException
      */
     public $o2 = null;
+    /**
+     * @var \metastore\InvalidObjectException
+     */
+    public $o3 = null;
 
     public function __construct($vals = null)
     {
@@ -66,6 +76,9 @@ class ThriftHiveMetastore_get_partitions_by_names_req_result
             if (isset($vals['o2'])) {
                 $this->o2 = $vals['o2'];
             }
+            if (isset($vals['o3'])) {
+                $this->o3 = $vals['o3'];
+            }
         }
     }
 
@@ -112,6 +125,14 @@ class ThriftHiveMetastore_get_partitions_by_names_req_result
                         $xfer += $input->skip($ftype);
                     }
                     break;
+                case 3:
+                    if ($ftype == TType::STRUCT) {
+                        $this->o3 = new \metastore\InvalidObjectException();
+                        $xfer += $this->o3->read($input);
+                    } else {
+                        $xfer += $input->skip($ftype);
+                    }
+                    break;
                 default:
                     $xfer += $input->skip($ftype);
                     break;
@@ -144,6 +165,11 @@ class ThriftHiveMetastore_get_partitions_by_names_req_result
             $xfer += $this->o2->write($output);
             $xfer += $output->writeFieldEnd();
         }
+        if ($this->o3 !== null) {
+            $xfer += $output->writeFieldBegin('o3', TType::STRUCT, 3);
+            $xfer += $this->o3->write($output);
+            $xfer += $output->writeFieldEnd();
+        }
         $xfer += $output->writeFieldStop();
         $xfer += $output->writeStructEnd();
         return $xfer;
diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore_get_partitions_by_names_result.php b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore_get_partitions_by_names_result.php
index b6fed00b056..62486a4e92c 100644
--- a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore_get_partitions_by_names_result.php
+++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore_get_partitions_by_names_result.php
@@ -43,6 +43,12 @@ class ThriftHiveMetastore_get_partitions_by_names_result
             'type' => TType::STRUCT,
             'class' => '\metastore\NoSuchObjectException',
         ),
+        3 => array(
+            'var' => 'o3',
+            'isRequired' => false,
+            'type' => TType::STRUCT,
+            'class' => '\metastore\InvalidObjectException',
+        ),
     );
 
     /**
@@ -57,6 +63,10 @@ class ThriftHiveMetastore_get_partitions_by_names_result
      * @var \metastore\NoSuchObjectException
      */
     public $o2 = null;
+    /**
+     * @var \metastore\InvalidObjectException
+     */
+    public $o3 = null;
 
     public function __construct($vals = null)
     {
@@ -70,6 +80,9 @@ class ThriftHiveMetastore_get_partitions_by_names_result
             if (isset($vals['o2'])) {
                 $this->o2 = $vals['o2'];
             }
+            if (isset($vals['o3'])) {
+                $this->o3 = $vals['o3'];
+            }
         }
     }
 
@@ -125,6 +138,14 @@ class ThriftHiveMetastore_get_partitions_by_names_result
                         $xfer += $input->skip($ftype);
                     }
                     break;
+                case 3:
+                    if ($ftype == TType::STRUCT) {
+                        $this->o3 = new \metastore\InvalidObjectException();
+                        $xfer += $this->o3->read($input);
+                    } else {
+                        $xfer += $input->skip($ftype);
+                    }
+                    break;
                 default:
                     $xfer += $input->skip($ftype);
                     break;
@@ -161,6 +182,11 @@ class ThriftHiveMetastore_get_partitions_by_names_result
             $xfer += $this->o2->write($output);
             $xfer += $output->writeFieldEnd();
         }
+        if ($this->o3 !== null) {
+            $xfer += $output->writeFieldBegin('o3', TType::STRUCT, 3);
+            $xfer += $this->o3->write($output);
+            $xfer += $output->writeFieldEnd();
+        }
         $xfer += $output->writeFieldStop();
         $xfer += $output->writeStructEnd();
         return $xfer;
diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py b/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py
index 739493f1c13..b9c511a2c61 100644
--- a/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py
+++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py
@@ -6245,6 +6245,8 @@ class Client(fb303.FacebookService.Client, Iface):
             raise result.o1
         if result.o2 is not None:
             raise result.o2
+        if result.o3 is not None:
+            raise result.o3
         raise TApplicationException(TApplicationException.MISSING_RESULT, "get_partitions_by_names failed: unknown result")
 
     def get_partitions_by_names_req(self, req):
@@ -6281,6 +6283,8 @@ class Client(fb303.FacebookService.Client, Iface):
             raise result.o1
         if result.o2 is not None:
             raise result.o2
+        if result.o3 is not None:
+            raise result.o3
         raise TApplicationException(TApplicationException.MISSING_RESULT, "get_partitions_by_names_req failed: unknown result")
 
     def alter_partition(self, db_name, tbl_name, new_part):
@@ -15540,6 +15544,9 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor):
         except NoSuchObjectException as o2:
             msg_type = TMessageType.REPLY
             result.o2 = o2
+        except InvalidObjectException as o3:
+            msg_type = TMessageType.REPLY
+            result.o3 = o3
         except TApplicationException as ex:
             logging.exception('TApplication exception in handler')
             msg_type = TMessageType.EXCEPTION
@@ -15569,6 +15576,9 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor):
         except NoSuchObjectException as o2:
             msg_type = TMessageType.REPLY
             result.o2 = o2
+        except InvalidObjectException as o3:
+            msg_type = TMessageType.REPLY
+            result.o3 = o3
         except TApplicationException as ex:
             logging.exception('TApplication exception in handler')
             msg_type = TMessageType.EXCEPTION
@@ -37192,14 +37202,16 @@ class get_partitions_by_names_result(object):
      - success
      - o1
      - o2
+     - o3
 
     """
 
 
-    def __init__(self, success=None, o1=None, o2=None,):
+    def __init__(self, success=None, o1=None, o2=None, o3=None,):
         self.success = success
         self.o1 = o1
         self.o2 = o2
+        self.o3 = o3
 
     def read(self, iprot):
         if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
@@ -37231,6 +37243,11 @@ class get_partitions_by_names_result(object):
                     self.o2 = NoSuchObjectException.read(iprot)
                 else:
                     iprot.skip(ftype)
+            elif fid == 3:
+                if ftype == TType.STRUCT:
+                    self.o3 = InvalidObjectException.read(iprot)
+                else:
+                    iprot.skip(ftype)
             else:
                 iprot.skip(ftype)
             iprot.readFieldEnd()
@@ -37256,6 +37273,10 @@ class get_partitions_by_names_result(object):
             oprot.writeFieldBegin('o2', TType.STRUCT, 2)
             self.o2.write(oprot)
             oprot.writeFieldEnd()
+        if self.o3 is not None:
+            oprot.writeFieldBegin('o3', TType.STRUCT, 3)
+            self.o3.write(oprot)
+            oprot.writeFieldEnd()
         oprot.writeFieldStop()
         oprot.writeStructEnd()
 
@@ -37277,6 +37298,7 @@ get_partitions_by_names_result.thrift_spec = (
     (0, TType.LIST, 'success', (TType.STRUCT, [Partition, None], False), None, ),  # 0
     (1, TType.STRUCT, 'o1', [MetaException, None], None, ),  # 1
     (2, TType.STRUCT, 'o2', [NoSuchObjectException, None], None, ),  # 2
+    (3, TType.STRUCT, 'o3', [InvalidObjectException, None], None, ),  # 3
 )
 
 
@@ -37349,14 +37371,16 @@ class get_partitions_by_names_req_result(object):
      - success
      - o1
      - o2
+     - o3
 
     """
 
 
-    def __init__(self, success=None, o1=None, o2=None,):
+    def __init__(self, success=None, o1=None, o2=None, o3=None,):
         self.success = success
         self.o1 = o1
         self.o2 = o2
+        self.o3 = o3
 
     def read(self, iprot):
         if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
@@ -37383,6 +37407,11 @@ class get_partitions_by_names_req_result(object):
                     self.o2 = NoSuchObjectException.read(iprot)
                 else:
                     iprot.skip(ftype)
+            elif fid == 3:
+                if ftype == TType.STRUCT:
+                    self.o3 = InvalidObjectException.read(iprot)
+                else:
+                    iprot.skip(ftype)
             else:
                 iprot.skip(ftype)
             iprot.readFieldEnd()
@@ -37405,6 +37434,10 @@ class get_partitions_by_names_req_result(object):
             oprot.writeFieldBegin('o2', TType.STRUCT, 2)
             self.o2.write(oprot)
             oprot.writeFieldEnd()
+        if self.o3 is not None:
+            oprot.writeFieldBegin('o3', TType.STRUCT, 3)
+            self.o3.write(oprot)
+            oprot.writeFieldEnd()
         oprot.writeFieldStop()
         oprot.writeStructEnd()
 
@@ -37426,6 +37459,7 @@ get_partitions_by_names_req_result.thrift_spec = (
     (0, TType.STRUCT, 'success', [GetPartitionsByNamesResult, None], None, ),  # 0
     (1, TType.STRUCT, 'o1', [MetaException, None], None, ),  # 1
     (2, TType.STRUCT, 'o2', [NoSuchObjectException, None], None, ),  # 2
+    (3, TType.STRUCT, 'o3', [InvalidObjectException, None], None, ),  # 3
 )
 
 
diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-rb/thrift_hive_metastore.rb b/standalone-metastore/metastore-common/src/gen/thrift/gen-rb/thrift_hive_metastore.rb
index 60fca527fe1..481f02662ee 100644
--- a/standalone-metastore/metastore-common/src/gen/thrift/gen-rb/thrift_hive_metastore.rb
+++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-rb/thrift_hive_metastore.rb
@@ -1753,6 +1753,7 @@ module ThriftHiveMetastore
       return result.success unless result.success.nil?
       raise result.o1 unless result.o1.nil?
       raise result.o2 unless result.o2.nil?
+      raise result.o3 unless result.o3.nil?
       raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_partitions_by_names failed: unknown result')
     end
 
@@ -1770,6 +1771,7 @@ module ThriftHiveMetastore
       return result.success unless result.success.nil?
       raise result.o1 unless result.o1.nil?
       raise result.o2 unless result.o2.nil?
+      raise result.o3 unless result.o3.nil?
       raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_partitions_by_names_req failed: unknown result')
     end
 
@@ -5905,6 +5907,8 @@ module ThriftHiveMetastore
         result.o1 = o1
       rescue ::NoSuchObjectException => o2
         result.o2 = o2
+      rescue ::InvalidObjectException => o3
+        result.o3 = o3
       end
       write_result(result, oprot, 'get_partitions_by_names', seqid)
     end
@@ -5918,6 +5922,8 @@ module ThriftHiveMetastore
         result.o1 = o1
       rescue ::NoSuchObjectException => o2
         result.o2 = o2
+      rescue ::InvalidObjectException => o3
+        result.o3 = o3
       end
       write_result(result, oprot, 'get_partitions_by_names_req', seqid)
     end
@@ -11822,11 +11828,13 @@ module ThriftHiveMetastore
     SUCCESS = 0
     O1 = 1
     O2 = 2
+    O3 = 3
 
     FIELDS = {
       SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Partition}},
       O1 => {:type => ::Thrift::Types::STRUCT, :name => 'o1', :class => ::MetaException},
-      O2 => {:type => ::Thrift::Types::STRUCT, :name => 'o2', :class => ::NoSuchObjectException}
+      O2 => {:type => ::Thrift::Types::STRUCT, :name => 'o2', :class => ::NoSuchObjectException},
+      O3 => {:type => ::Thrift::Types::STRUCT, :name => 'o3', :class => ::InvalidObjectException}
     }
 
     def struct_fields; FIELDS; end
@@ -11858,11 +11866,13 @@ module ThriftHiveMetastore
     SUCCESS = 0
     O1 = 1
     O2 = 2
+    O3 = 3
 
     FIELDS = {
       SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::GetPartitionsByNamesResult},
       O1 => {:type => ::Thrift::Types::STRUCT, :name => 'o1', :class => ::MetaException},
-      O2 => {:type => ::Thrift::Types::STRUCT, :name => 'o2', :class => ::NoSuchObjectException}
+      O2 => {:type => ::Thrift::Types::STRUCT, :name => 'o2', :class => ::NoSuchObjectException},
+      O3 => {:type => ::Thrift::Types::STRUCT, :name => 'o3', :class => ::InvalidObjectException}
     }
 
     def struct_fields; FIELDS; end
diff --git a/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift b/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift
index 647d5c6cf17..63936d29985 100644
--- a/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift
+++ b/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift
@@ -2770,9 +2770,9 @@ PartitionsResponse get_partitions_req(1:PartitionsRequest req)
 
   // get partitions give a list of partition names
   list<Partition> get_partitions_by_names(1:string db_name 2:string tbl_name 3:list<string> names)
-                       throws(1:MetaException o1, 2:NoSuchObjectException o2)
+      throws(1:MetaException o1, 2:NoSuchObjectException o2, 3:InvalidObjectException o3)
   GetPartitionsByNamesResult get_partitions_by_names_req(1:GetPartitionsByNamesRequest req)
-                        throws(1:MetaException o1, 2:NoSuchObjectException o2)
+      throws(1:MetaException o1, 2:NoSuchObjectException o2, 3:InvalidObjectException o3)
 
   // changes the partition to the new partition object. partition is identified from the part values
   // in the new_part
diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
index 1a58b2003c4..d544bf30ed8 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
@@ -7526,7 +7526,9 @@ public class HMSHandler extends FacebookBase implements IHMSHandler {
       success = getMS().commitTransaction();
     } catch (Exception e) {
       ex = e;
-      rethrowException(e);
+      throw handleException(e)
+          .throwIfInstance(MetaException.class, NoSuchObjectException.class, InvalidObjectException.class)
+          .defaultMetaException();
     } finally {
       if (!success) {
         getMS().rollbackTransaction();
diff --git a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java
index 51aae60f704..bda150aea93 100644
--- a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java
+++ b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java
@@ -45,6 +45,7 @@ import org.apache.hadoop.hive.metastore.api.DataConnector;
 import org.apache.hadoop.hive.metastore.api.DatabaseType;
 import org.apache.hadoop.hive.metastore.api.GetPartitionsFilterSpec;
 import org.apache.hadoop.hive.metastore.api.GetProjectionsSpec;
+import org.apache.hadoop.hive.metastore.api.GetPartitionsByNamesRequest;
 import org.apache.hadoop.hive.metastore.api.GetPartitionsRequest;
 import org.apache.hadoop.hive.metastore.api.GetPartitionsResponse;
 import org.apache.hadoop.hive.metastore.api.PartitionSpecWithSharedSD;
@@ -105,6 +106,7 @@ import org.junit.Test;
 
 import com.google.common.collect.Lists;
 
+import static org.apache.hadoop.hive.metastore.utils.MetaStoreUtils.convertToGetPartitionsByNamesRequest;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotEquals;
@@ -1135,6 +1137,52 @@ public abstract class TestHiveMetaStore {
     }
   }
 
+  @Test(expected = InvalidObjectException.class)
+  public void testDropTableFetchPartitions() throws Throwable {
+    String dbName = "fetchPartitionsDb";
+    String tblName = "fetchPartitionsTbl";
+    List<String> vals = new ArrayList<>(2);
+    vals.add("2011-07-11");
+    vals.add("8");
+    client.dropTable(dbName, tblName);
+    silentDropDatabase(dbName);
+    new DatabaseBuilder()
+            .setName(dbName)
+            .setDescription("Drop table Fetch partition Test database")
+            .create(client, conf);
+
+    Table tbl = new TableBuilder()
+            .setDbName(dbName)
+            .setTableName(tblName)
+            .addCol("name", ColumnType.STRING_TYPE_NAME)
+            .addCol("income", ColumnType.INT_TYPE_NAME)
+            .addPartCol("ds", ColumnType.STRING_TYPE_NAME)
+            .addPartCol("hr", ColumnType.INT_TYPE_NAME)
+            .create(client, conf);
+
+    if (isThriftClient) {
+      // the createTable() above does not update the location in the 'tbl'
+      // object when the client is a thrift client and the code below relies
+      // on the location being present in the 'tbl' object - so get the table
+      // from the metastore
+      tbl = client.getTable(dbName, tblName);
+    }
+
+    Partition part = new Partition();
+    part.setDbName(dbName);
+    part.setTableName(tblName);
+    part.setValues(vals);
+    part.setParameters(new HashMap<>());
+    part.setSd(tbl.getSd().deepCopy());
+    part.getSd().setLocation(tbl.getSd().getLocation() + "/part1");
+
+    client.add_partition(part);
+
+    GetPartitionsByNamesRequest req = convertToGetPartitionsByNamesRequest(dbName, tblName, vals);
+    client.dropTable(dbName, tblName, true, false);
+    List<Partition> partitionsList = client.getPartitionsByNames(req).getPartitions();
+  }
+
   @Test
   public void testDatabase() throws Throwable {
     try {