hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xu...@apache.org
Subject [49/55] [abbrv] hive git commit: HIVE-12061 : add file type support to file metadata by expr call (Sergey Shelukhin, reviewed by Alan Gates)
Date Wed, 28 Oct 2015 12:11:42 GMT
http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp
----------------------------------------------------------------------
diff --git a/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp b/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp
index cb0ee7a..5fd4a90 100644
--- a/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp
+++ b/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp
@@ -151,6 +151,14 @@ const char* _kResourceTypeNames[] = {
 };
 const std::map<int, const char*> _ResourceType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kResourceTypeValues, _kResourceTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
 
+int _kFileMetadataExprTypeValues[] = {
+  FileMetadataExprType::ORC_SARG
+};
+const char* _kFileMetadataExprTypeNames[] = {
+  "ORC_SARG"
+};
+const std::map<int, const char*> _FileMetadataExprType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(1, _kFileMetadataExprTypeValues, _kFileMetadataExprTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
+
 
 Version::~Version() throw() {
 }
@@ -14262,6 +14270,11 @@ void GetFileMetadataByExprRequest::__set_doGetFooters(const bool val) {
 __isset.doGetFooters = true;
 }
 
+void GetFileMetadataByExprRequest::__set_type(const FileMetadataExprType::type val) {
+  this->type = val;
+__isset.type = true;
+}
+
 uint32_t GetFileMetadataByExprRequest::read(::apache::thrift::protocol::TProtocol* iprot) {
 
   apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
@@ -14321,6 +14334,16 @@ uint32_t GetFileMetadataByExprRequest::read(::apache::thrift::protocol::TProtoco
           xfer += iprot->skip(ftype);
         }
         break;
+      case 4:
+        if (ftype == ::apache::thrift::protocol::T_I32) {
+          int32_t ecast626;
+          xfer += iprot->readI32(ecast626);
+          this->type = (FileMetadataExprType::type)ecast626;
+          this->__isset.type = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
       default:
         xfer += iprot->skip(ftype);
         break;
@@ -14345,10 +14368,10 @@ uint32_t GetFileMetadataByExprRequest::write(::apache::thrift::protocol::TProtoc
   xfer += oprot->writeFieldBegin("fileIds", ::apache::thrift::protocol::T_LIST, 1);
   {
     xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast<uint32_t>(this->fileIds.size()));
-    std::vector<int64_t> ::const_iterator _iter626;
-    for (_iter626 = this->fileIds.begin(); _iter626 != this->fileIds.end(); ++_iter626)
+    std::vector<int64_t> ::const_iterator _iter627;
+    for (_iter627 = this->fileIds.begin(); _iter627 != this->fileIds.end(); ++_iter627)
     {
-      xfer += oprot->writeI64((*_iter626));
+      xfer += oprot->writeI64((*_iter627));
     }
     xfer += oprot->writeListEnd();
   }
@@ -14363,6 +14386,11 @@ uint32_t GetFileMetadataByExprRequest::write(::apache::thrift::protocol::TProtoc
     xfer += oprot->writeBool(this->doGetFooters);
     xfer += oprot->writeFieldEnd();
   }
+  if (this->__isset.type) {
+    xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 4);
+    xfer += oprot->writeI32((int32_t)this->type);
+    xfer += oprot->writeFieldEnd();
+  }
   xfer += oprot->writeFieldStop();
   xfer += oprot->writeStructEnd();
   return xfer;
@@ -14373,20 +14401,23 @@ void swap(GetFileMetadataByExprRequest &a, GetFileMetadataByExprRequest &b) {
   swap(a.fileIds, b.fileIds);
   swap(a.expr, b.expr);
   swap(a.doGetFooters, b.doGetFooters);
+  swap(a.type, b.type);
   swap(a.__isset, b.__isset);
 }
 
-GetFileMetadataByExprRequest::GetFileMetadataByExprRequest(const GetFileMetadataByExprRequest& other627) {
-  fileIds = other627.fileIds;
-  expr = other627.expr;
-  doGetFooters = other627.doGetFooters;
-  __isset = other627.__isset;
-}
-GetFileMetadataByExprRequest& GetFileMetadataByExprRequest::operator=(const GetFileMetadataByExprRequest& other628) {
+GetFileMetadataByExprRequest::GetFileMetadataByExprRequest(const GetFileMetadataByExprRequest& other628) {
   fileIds = other628.fileIds;
   expr = other628.expr;
   doGetFooters = other628.doGetFooters;
+  type = other628.type;
   __isset = other628.__isset;
+}
+GetFileMetadataByExprRequest& GetFileMetadataByExprRequest::operator=(const GetFileMetadataByExprRequest& other629) {
+  fileIds = other629.fileIds;
+  expr = other629.expr;
+  doGetFooters = other629.doGetFooters;
+  type = other629.type;
+  __isset = other629.__isset;
   return *this;
 }
 void GetFileMetadataByExprRequest::printTo(std::ostream& out) const {
@@ -14395,6 +14426,7 @@ void GetFileMetadataByExprRequest::printTo(std::ostream& out) const {
   out << "fileIds=" << to_string(fileIds);
   out << ", " << "expr=" << to_string(expr);
   out << ", " << "doGetFooters="; (__isset.doGetFooters ? (out << to_string(doGetFooters)) : (out << "<null>"));
+  out << ", " << "type="; (__isset.type ? (out << to_string(type)) : (out << "<null>"));
   out << ")";
 }
 
@@ -14438,17 +14470,17 @@ uint32_t GetFileMetadataResult::read(::apache::thrift::protocol::TProtocol* ipro
         if (ftype == ::apache::thrift::protocol::T_MAP) {
           {
             this->metadata.clear();
-            uint32_t _size629;
-            ::apache::thrift::protocol::TType _ktype630;
-            ::apache::thrift::protocol::TType _vtype631;
-            xfer += iprot->readMapBegin(_ktype630, _vtype631, _size629);
-            uint32_t _i633;
-            for (_i633 = 0; _i633 < _size629; ++_i633)
+            uint32_t _size630;
+            ::apache::thrift::protocol::TType _ktype631;
+            ::apache::thrift::protocol::TType _vtype632;
+            xfer += iprot->readMapBegin(_ktype631, _vtype632, _size630);
+            uint32_t _i634;
+            for (_i634 = 0; _i634 < _size630; ++_i634)
             {
-              int64_t _key634;
-              xfer += iprot->readI64(_key634);
-              std::string& _val635 = this->metadata[_key634];
-              xfer += iprot->readBinary(_val635);
+              int64_t _key635;
+              xfer += iprot->readI64(_key635);
+              std::string& _val636 = this->metadata[_key635];
+              xfer += iprot->readBinary(_val636);
             }
             xfer += iprot->readMapEnd();
           }
@@ -14489,11 +14521,11 @@ uint32_t GetFileMetadataResult::write(::apache::thrift::protocol::TProtocol* opr
   xfer += oprot->writeFieldBegin("metadata", ::apache::thrift::protocol::T_MAP, 1);
   {
     xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_I64, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->metadata.size()));
-    std::map<int64_t, std::string> ::const_iterator _iter636;
-    for (_iter636 = this->metadata.begin(); _iter636 != this->metadata.end(); ++_iter636)
+    std::map<int64_t, std::string> ::const_iterator _iter637;
+    for (_iter637 = this->metadata.begin(); _iter637 != this->metadata.end(); ++_iter637)
     {
-      xfer += oprot->writeI64(_iter636->first);
-      xfer += oprot->writeBinary(_iter636->second);
+      xfer += oprot->writeI64(_iter637->first);
+      xfer += oprot->writeBinary(_iter637->second);
     }
     xfer += oprot->writeMapEnd();
   }
@@ -14514,13 +14546,13 @@ void swap(GetFileMetadataResult &a, GetFileMetadataResult &b) {
   swap(a.isSupported, b.isSupported);
 }
 
-GetFileMetadataResult::GetFileMetadataResult(const GetFileMetadataResult& other637) {
-  metadata = other637.metadata;
-  isSupported = other637.isSupported;
-}
-GetFileMetadataResult& GetFileMetadataResult::operator=(const GetFileMetadataResult& other638) {
+GetFileMetadataResult::GetFileMetadataResult(const GetFileMetadataResult& other638) {
   metadata = other638.metadata;
   isSupported = other638.isSupported;
+}
+GetFileMetadataResult& GetFileMetadataResult::operator=(const GetFileMetadataResult& other639) {
+  metadata = other639.metadata;
+  isSupported = other639.isSupported;
   return *this;
 }
 void GetFileMetadataResult::printTo(std::ostream& out) const {
@@ -14566,14 +14598,14 @@ uint32_t GetFileMetadataRequest::read(::apache::thrift::protocol::TProtocol* ipr
         if (ftype == ::apache::thrift::protocol::T_LIST) {
           {
             this->fileIds.clear();
-            uint32_t _size639;
-            ::apache::thrift::protocol::TType _etype642;
-            xfer += iprot->readListBegin(_etype642, _size639);
-            this->fileIds.resize(_size639);
-            uint32_t _i643;
-            for (_i643 = 0; _i643 < _size639; ++_i643)
+            uint32_t _size640;
+            ::apache::thrift::protocol::TType _etype643;
+            xfer += iprot->readListBegin(_etype643, _size640);
+            this->fileIds.resize(_size640);
+            uint32_t _i644;
+            for (_i644 = 0; _i644 < _size640; ++_i644)
             {
-              xfer += iprot->readI64(this->fileIds[_i643]);
+              xfer += iprot->readI64(this->fileIds[_i644]);
             }
             xfer += iprot->readListEnd();
           }
@@ -14604,10 +14636,10 @@ uint32_t GetFileMetadataRequest::write(::apache::thrift::protocol::TProtocol* op
   xfer += oprot->writeFieldBegin("fileIds", ::apache::thrift::protocol::T_LIST, 1);
   {
     xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast<uint32_t>(this->fileIds.size()));
-    std::vector<int64_t> ::const_iterator _iter644;
-    for (_iter644 = this->fileIds.begin(); _iter644 != this->fileIds.end(); ++_iter644)
+    std::vector<int64_t> ::const_iterator _iter645;
+    for (_iter645 = this->fileIds.begin(); _iter645 != this->fileIds.end(); ++_iter645)
     {
-      xfer += oprot->writeI64((*_iter644));
+      xfer += oprot->writeI64((*_iter645));
     }
     xfer += oprot->writeListEnd();
   }
@@ -14623,11 +14655,11 @@ void swap(GetFileMetadataRequest &a, GetFileMetadataRequest &b) {
   swap(a.fileIds, b.fileIds);
 }
 
-GetFileMetadataRequest::GetFileMetadataRequest(const GetFileMetadataRequest& other645) {
-  fileIds = other645.fileIds;
-}
-GetFileMetadataRequest& GetFileMetadataRequest::operator=(const GetFileMetadataRequest& other646) {
+GetFileMetadataRequest::GetFileMetadataRequest(const GetFileMetadataRequest& other646) {
   fileIds = other646.fileIds;
+}
+GetFileMetadataRequest& GetFileMetadataRequest::operator=(const GetFileMetadataRequest& other647) {
+  fileIds = other647.fileIds;
   return *this;
 }
 void GetFileMetadataRequest::printTo(std::ostream& out) const {
@@ -14686,11 +14718,11 @@ void swap(PutFileMetadataResult &a, PutFileMetadataResult &b) {
   (void) b;
 }
 
-PutFileMetadataResult::PutFileMetadataResult(const PutFileMetadataResult& other647) {
-  (void) other647;
-}
-PutFileMetadataResult& PutFileMetadataResult::operator=(const PutFileMetadataResult& other648) {
+PutFileMetadataResult::PutFileMetadataResult(const PutFileMetadataResult& other648) {
   (void) other648;
+}
+PutFileMetadataResult& PutFileMetadataResult::operator=(const PutFileMetadataResult& other649) {
+  (void) other649;
   return *this;
 }
 void PutFileMetadataResult::printTo(std::ostream& out) const {
@@ -14739,14 +14771,14 @@ uint32_t PutFileMetadataRequest::read(::apache::thrift::protocol::TProtocol* ipr
         if (ftype == ::apache::thrift::protocol::T_LIST) {
           {
             this->fileIds.clear();
-            uint32_t _size649;
-            ::apache::thrift::protocol::TType _etype652;
-            xfer += iprot->readListBegin(_etype652, _size649);
-            this->fileIds.resize(_size649);
-            uint32_t _i653;
-            for (_i653 = 0; _i653 < _size649; ++_i653)
+            uint32_t _size650;
+            ::apache::thrift::protocol::TType _etype653;
+            xfer += iprot->readListBegin(_etype653, _size650);
+            this->fileIds.resize(_size650);
+            uint32_t _i654;
+            for (_i654 = 0; _i654 < _size650; ++_i654)
             {
-              xfer += iprot->readI64(this->fileIds[_i653]);
+              xfer += iprot->readI64(this->fileIds[_i654]);
             }
             xfer += iprot->readListEnd();
           }
@@ -14759,14 +14791,14 @@ uint32_t PutFileMetadataRequest::read(::apache::thrift::protocol::TProtocol* ipr
         if (ftype == ::apache::thrift::protocol::T_LIST) {
           {
             this->metadata.clear();
-            uint32_t _size654;
-            ::apache::thrift::protocol::TType _etype657;
-            xfer += iprot->readListBegin(_etype657, _size654);
-            this->metadata.resize(_size654);
-            uint32_t _i658;
-            for (_i658 = 0; _i658 < _size654; ++_i658)
+            uint32_t _size655;
+            ::apache::thrift::protocol::TType _etype658;
+            xfer += iprot->readListBegin(_etype658, _size655);
+            this->metadata.resize(_size655);
+            uint32_t _i659;
+            for (_i659 = 0; _i659 < _size655; ++_i659)
             {
-              xfer += iprot->readBinary(this->metadata[_i658]);
+              xfer += iprot->readBinary(this->metadata[_i659]);
             }
             xfer += iprot->readListEnd();
           }
@@ -14799,10 +14831,10 @@ uint32_t PutFileMetadataRequest::write(::apache::thrift::protocol::TProtocol* op
   xfer += oprot->writeFieldBegin("fileIds", ::apache::thrift::protocol::T_LIST, 1);
   {
     xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast<uint32_t>(this->fileIds.size()));
-    std::vector<int64_t> ::const_iterator _iter659;
-    for (_iter659 = this->fileIds.begin(); _iter659 != this->fileIds.end(); ++_iter659)
+    std::vector<int64_t> ::const_iterator _iter660;
+    for (_iter660 = this->fileIds.begin(); _iter660 != this->fileIds.end(); ++_iter660)
     {
-      xfer += oprot->writeI64((*_iter659));
+      xfer += oprot->writeI64((*_iter660));
     }
     xfer += oprot->writeListEnd();
   }
@@ -14811,10 +14843,10 @@ uint32_t PutFileMetadataRequest::write(::apache::thrift::protocol::TProtocol* op
   xfer += oprot->writeFieldBegin("metadata", ::apache::thrift::protocol::T_LIST, 2);
   {
     xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->metadata.size()));
-    std::vector<std::string> ::const_iterator _iter660;
-    for (_iter660 = this->metadata.begin(); _iter660 != this->metadata.end(); ++_iter660)
+    std::vector<std::string> ::const_iterator _iter661;
+    for (_iter661 = this->metadata.begin(); _iter661 != this->metadata.end(); ++_iter661)
     {
-      xfer += oprot->writeBinary((*_iter660));
+      xfer += oprot->writeBinary((*_iter661));
     }
     xfer += oprot->writeListEnd();
   }
@@ -14831,13 +14863,13 @@ void swap(PutFileMetadataRequest &a, PutFileMetadataRequest &b) {
   swap(a.metadata, b.metadata);
 }
 
-PutFileMetadataRequest::PutFileMetadataRequest(const PutFileMetadataRequest& other661) {
-  fileIds = other661.fileIds;
-  metadata = other661.metadata;
-}
-PutFileMetadataRequest& PutFileMetadataRequest::operator=(const PutFileMetadataRequest& other662) {
+PutFileMetadataRequest::PutFileMetadataRequest(const PutFileMetadataRequest& other662) {
   fileIds = other662.fileIds;
   metadata = other662.metadata;
+}
+PutFileMetadataRequest& PutFileMetadataRequest::operator=(const PutFileMetadataRequest& other663) {
+  fileIds = other663.fileIds;
+  metadata = other663.metadata;
   return *this;
 }
 void PutFileMetadataRequest::printTo(std::ostream& out) const {
@@ -14897,11 +14929,11 @@ void swap(ClearFileMetadataResult &a, ClearFileMetadataResult &b) {
   (void) b;
 }
 
-ClearFileMetadataResult::ClearFileMetadataResult(const ClearFileMetadataResult& other663) {
-  (void) other663;
-}
-ClearFileMetadataResult& ClearFileMetadataResult::operator=(const ClearFileMetadataResult& other664) {
+ClearFileMetadataResult::ClearFileMetadataResult(const ClearFileMetadataResult& other664) {
   (void) other664;
+}
+ClearFileMetadataResult& ClearFileMetadataResult::operator=(const ClearFileMetadataResult& other665) {
+  (void) other665;
   return *this;
 }
 void ClearFileMetadataResult::printTo(std::ostream& out) const {
@@ -14945,14 +14977,14 @@ uint32_t ClearFileMetadataRequest::read(::apache::thrift::protocol::TProtocol* i
         if (ftype == ::apache::thrift::protocol::T_LIST) {
           {
             this->fileIds.clear();
-            uint32_t _size665;
-            ::apache::thrift::protocol::TType _etype668;
-            xfer += iprot->readListBegin(_etype668, _size665);
-            this->fileIds.resize(_size665);
-            uint32_t _i669;
-            for (_i669 = 0; _i669 < _size665; ++_i669)
+            uint32_t _size666;
+            ::apache::thrift::protocol::TType _etype669;
+            xfer += iprot->readListBegin(_etype669, _size666);
+            this->fileIds.resize(_size666);
+            uint32_t _i670;
+            for (_i670 = 0; _i670 < _size666; ++_i670)
             {
-              xfer += iprot->readI64(this->fileIds[_i669]);
+              xfer += iprot->readI64(this->fileIds[_i670]);
             }
             xfer += iprot->readListEnd();
           }
@@ -14983,10 +15015,10 @@ uint32_t ClearFileMetadataRequest::write(::apache::thrift::protocol::TProtocol*
   xfer += oprot->writeFieldBegin("fileIds", ::apache::thrift::protocol::T_LIST, 1);
   {
     xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast<uint32_t>(this->fileIds.size()));
-    std::vector<int64_t> ::const_iterator _iter670;
-    for (_iter670 = this->fileIds.begin(); _iter670 != this->fileIds.end(); ++_iter670)
+    std::vector<int64_t> ::const_iterator _iter671;
+    for (_iter671 = this->fileIds.begin(); _iter671 != this->fileIds.end(); ++_iter671)
     {
-      xfer += oprot->writeI64((*_iter670));
+      xfer += oprot->writeI64((*_iter671));
     }
     xfer += oprot->writeListEnd();
   }
@@ -15002,11 +15034,11 @@ void swap(ClearFileMetadataRequest &a, ClearFileMetadataRequest &b) {
   swap(a.fileIds, b.fileIds);
 }
 
-ClearFileMetadataRequest::ClearFileMetadataRequest(const ClearFileMetadataRequest& other671) {
-  fileIds = other671.fileIds;
-}
-ClearFileMetadataRequest& ClearFileMetadataRequest::operator=(const ClearFileMetadataRequest& other672) {
+ClearFileMetadataRequest::ClearFileMetadataRequest(const ClearFileMetadataRequest& other672) {
   fileIds = other672.fileIds;
+}
+ClearFileMetadataRequest& ClearFileMetadataRequest::operator=(const ClearFileMetadataRequest& other673) {
+  fileIds = other673.fileIds;
   return *this;
 }
 void ClearFileMetadataRequest::printTo(std::ostream& out) const {
@@ -15051,14 +15083,14 @@ uint32_t GetAllFunctionsResponse::read(::apache::thrift::protocol::TProtocol* ip
         if (ftype == ::apache::thrift::protocol::T_LIST) {
           {
             this->functions.clear();
-            uint32_t _size673;
-            ::apache::thrift::protocol::TType _etype676;
-            xfer += iprot->readListBegin(_etype676, _size673);
-            this->functions.resize(_size673);
-            uint32_t _i677;
-            for (_i677 = 0; _i677 < _size673; ++_i677)
+            uint32_t _size674;
+            ::apache::thrift::protocol::TType _etype677;
+            xfer += iprot->readListBegin(_etype677, _size674);
+            this->functions.resize(_size674);
+            uint32_t _i678;
+            for (_i678 = 0; _i678 < _size674; ++_i678)
             {
-              xfer += this->functions[_i677].read(iprot);
+              xfer += this->functions[_i678].read(iprot);
             }
             xfer += iprot->readListEnd();
           }
@@ -15088,10 +15120,10 @@ uint32_t GetAllFunctionsResponse::write(::apache::thrift::protocol::TProtocol* o
     xfer += oprot->writeFieldBegin("functions", ::apache::thrift::protocol::T_LIST, 1);
     {
       xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->functions.size()));
-      std::vector<Function> ::const_iterator _iter678;
-      for (_iter678 = this->functions.begin(); _iter678 != this->functions.end(); ++_iter678)
+      std::vector<Function> ::const_iterator _iter679;
+      for (_iter679 = this->functions.begin(); _iter679 != this->functions.end(); ++_iter679)
       {
-        xfer += (*_iter678).write(oprot);
+        xfer += (*_iter679).write(oprot);
       }
       xfer += oprot->writeListEnd();
     }
@@ -15108,13 +15140,13 @@ void swap(GetAllFunctionsResponse &a, GetAllFunctionsResponse &b) {
   swap(a.__isset, b.__isset);
 }
 
-GetAllFunctionsResponse::GetAllFunctionsResponse(const GetAllFunctionsResponse& other679) {
-  functions = other679.functions;
-  __isset = other679.__isset;
-}
-GetAllFunctionsResponse& GetAllFunctionsResponse::operator=(const GetAllFunctionsResponse& other680) {
+GetAllFunctionsResponse::GetAllFunctionsResponse(const GetAllFunctionsResponse& other680) {
   functions = other680.functions;
   __isset = other680.__isset;
+}
+GetAllFunctionsResponse& GetAllFunctionsResponse::operator=(const GetAllFunctionsResponse& other681) {
+  functions = other681.functions;
+  __isset = other681.__isset;
   return *this;
 }
 void GetAllFunctionsResponse::printTo(std::ostream& out) const {
@@ -15194,13 +15226,13 @@ void swap(MetaException &a, MetaException &b) {
   swap(a.__isset, b.__isset);
 }
 
-MetaException::MetaException(const MetaException& other681) : TException() {
-  message = other681.message;
-  __isset = other681.__isset;
-}
-MetaException& MetaException::operator=(const MetaException& other682) {
+MetaException::MetaException(const MetaException& other682) : TException() {
   message = other682.message;
   __isset = other682.__isset;
+}
+MetaException& MetaException::operator=(const MetaException& other683) {
+  message = other683.message;
+  __isset = other683.__isset;
   return *this;
 }
 void MetaException::printTo(std::ostream& out) const {
@@ -15291,13 +15323,13 @@ void swap(UnknownTableException &a, UnknownTableException &b) {
   swap(a.__isset, b.__isset);
 }
 
-UnknownTableException::UnknownTableException(const UnknownTableException& other683) : TException() {
-  message = other683.message;
-  __isset = other683.__isset;
-}
-UnknownTableException& UnknownTableException::operator=(const UnknownTableException& other684) {
+UnknownTableException::UnknownTableException(const UnknownTableException& other684) : TException() {
   message = other684.message;
   __isset = other684.__isset;
+}
+UnknownTableException& UnknownTableException::operator=(const UnknownTableException& other685) {
+  message = other685.message;
+  __isset = other685.__isset;
   return *this;
 }
 void UnknownTableException::printTo(std::ostream& out) const {
@@ -15388,13 +15420,13 @@ void swap(UnknownDBException &a, UnknownDBException &b) {
   swap(a.__isset, b.__isset);
 }
 
-UnknownDBException::UnknownDBException(const UnknownDBException& other685) : TException() {
-  message = other685.message;
-  __isset = other685.__isset;
-}
-UnknownDBException& UnknownDBException::operator=(const UnknownDBException& other686) {
+UnknownDBException::UnknownDBException(const UnknownDBException& other686) : TException() {
   message = other686.message;
   __isset = other686.__isset;
+}
+UnknownDBException& UnknownDBException::operator=(const UnknownDBException& other687) {
+  message = other687.message;
+  __isset = other687.__isset;
   return *this;
 }
 void UnknownDBException::printTo(std::ostream& out) const {
@@ -15485,13 +15517,13 @@ void swap(AlreadyExistsException &a, AlreadyExistsException &b) {
   swap(a.__isset, b.__isset);
 }
 
-AlreadyExistsException::AlreadyExistsException(const AlreadyExistsException& other687) : TException() {
-  message = other687.message;
-  __isset = other687.__isset;
-}
-AlreadyExistsException& AlreadyExistsException::operator=(const AlreadyExistsException& other688) {
+AlreadyExistsException::AlreadyExistsException(const AlreadyExistsException& other688) : TException() {
   message = other688.message;
   __isset = other688.__isset;
+}
+AlreadyExistsException& AlreadyExistsException::operator=(const AlreadyExistsException& other689) {
+  message = other689.message;
+  __isset = other689.__isset;
   return *this;
 }
 void AlreadyExistsException::printTo(std::ostream& out) const {
@@ -15582,13 +15614,13 @@ void swap(InvalidPartitionException &a, InvalidPartitionException &b) {
   swap(a.__isset, b.__isset);
 }
 
-InvalidPartitionException::InvalidPartitionException(const InvalidPartitionException& other689) : TException() {
-  message = other689.message;
-  __isset = other689.__isset;
-}
-InvalidPartitionException& InvalidPartitionException::operator=(const InvalidPartitionException& other690) {
+InvalidPartitionException::InvalidPartitionException(const InvalidPartitionException& other690) : TException() {
   message = other690.message;
   __isset = other690.__isset;
+}
+InvalidPartitionException& InvalidPartitionException::operator=(const InvalidPartitionException& other691) {
+  message = other691.message;
+  __isset = other691.__isset;
   return *this;
 }
 void InvalidPartitionException::printTo(std::ostream& out) const {
@@ -15679,13 +15711,13 @@ void swap(UnknownPartitionException &a, UnknownPartitionException &b) {
   swap(a.__isset, b.__isset);
 }
 
-UnknownPartitionException::UnknownPartitionException(const UnknownPartitionException& other691) : TException() {
-  message = other691.message;
-  __isset = other691.__isset;
-}
-UnknownPartitionException& UnknownPartitionException::operator=(const UnknownPartitionException& other692) {
+UnknownPartitionException::UnknownPartitionException(const UnknownPartitionException& other692) : TException() {
   message = other692.message;
   __isset = other692.__isset;
+}
+UnknownPartitionException& UnknownPartitionException::operator=(const UnknownPartitionException& other693) {
+  message = other693.message;
+  __isset = other693.__isset;
   return *this;
 }
 void UnknownPartitionException::printTo(std::ostream& out) const {
@@ -15776,13 +15808,13 @@ void swap(InvalidObjectException &a, InvalidObjectException &b) {
   swap(a.__isset, b.__isset);
 }
 
-InvalidObjectException::InvalidObjectException(const InvalidObjectException& other693) : TException() {
-  message = other693.message;
-  __isset = other693.__isset;
-}
-InvalidObjectException& InvalidObjectException::operator=(const InvalidObjectException& other694) {
+InvalidObjectException::InvalidObjectException(const InvalidObjectException& other694) : TException() {
   message = other694.message;
   __isset = other694.__isset;
+}
+InvalidObjectException& InvalidObjectException::operator=(const InvalidObjectException& other695) {
+  message = other695.message;
+  __isset = other695.__isset;
   return *this;
 }
 void InvalidObjectException::printTo(std::ostream& out) const {
@@ -15873,13 +15905,13 @@ void swap(NoSuchObjectException &a, NoSuchObjectException &b) {
   swap(a.__isset, b.__isset);
 }
 
-NoSuchObjectException::NoSuchObjectException(const NoSuchObjectException& other695) : TException() {
-  message = other695.message;
-  __isset = other695.__isset;
-}
-NoSuchObjectException& NoSuchObjectException::operator=(const NoSuchObjectException& other696) {
+NoSuchObjectException::NoSuchObjectException(const NoSuchObjectException& other696) : TException() {
   message = other696.message;
   __isset = other696.__isset;
+}
+NoSuchObjectException& NoSuchObjectException::operator=(const NoSuchObjectException& other697) {
+  message = other697.message;
+  __isset = other697.__isset;
   return *this;
 }
 void NoSuchObjectException::printTo(std::ostream& out) const {
@@ -15970,13 +16002,13 @@ void swap(IndexAlreadyExistsException &a, IndexAlreadyExistsException &b) {
   swap(a.__isset, b.__isset);
 }
 
-IndexAlreadyExistsException::IndexAlreadyExistsException(const IndexAlreadyExistsException& other697) : TException() {
-  message = other697.message;
-  __isset = other697.__isset;
-}
-IndexAlreadyExistsException& IndexAlreadyExistsException::operator=(const IndexAlreadyExistsException& other698) {
+IndexAlreadyExistsException::IndexAlreadyExistsException(const IndexAlreadyExistsException& other698) : TException() {
   message = other698.message;
   __isset = other698.__isset;
+}
+IndexAlreadyExistsException& IndexAlreadyExistsException::operator=(const IndexAlreadyExistsException& other699) {
+  message = other699.message;
+  __isset = other699.__isset;
   return *this;
 }
 void IndexAlreadyExistsException::printTo(std::ostream& out) const {
@@ -16067,13 +16099,13 @@ void swap(InvalidOperationException &a, InvalidOperationException &b) {
   swap(a.__isset, b.__isset);
 }
 
-InvalidOperationException::InvalidOperationException(const InvalidOperationException& other699) : TException() {
-  message = other699.message;
-  __isset = other699.__isset;
-}
-InvalidOperationException& InvalidOperationException::operator=(const InvalidOperationException& other700) {
+InvalidOperationException::InvalidOperationException(const InvalidOperationException& other700) : TException() {
   message = other700.message;
   __isset = other700.__isset;
+}
+InvalidOperationException& InvalidOperationException::operator=(const InvalidOperationException& other701) {
+  message = other701.message;
+  __isset = other701.__isset;
   return *this;
 }
 void InvalidOperationException::printTo(std::ostream& out) const {
@@ -16164,13 +16196,13 @@ void swap(ConfigValSecurityException &a, ConfigValSecurityException &b) {
   swap(a.__isset, b.__isset);
 }
 
-ConfigValSecurityException::ConfigValSecurityException(const ConfigValSecurityException& other701) : TException() {
-  message = other701.message;
-  __isset = other701.__isset;
-}
-ConfigValSecurityException& ConfigValSecurityException::operator=(const ConfigValSecurityException& other702) {
+ConfigValSecurityException::ConfigValSecurityException(const ConfigValSecurityException& other702) : TException() {
   message = other702.message;
   __isset = other702.__isset;
+}
+ConfigValSecurityException& ConfigValSecurityException::operator=(const ConfigValSecurityException& other703) {
+  message = other703.message;
+  __isset = other703.__isset;
   return *this;
 }
 void ConfigValSecurityException::printTo(std::ostream& out) const {
@@ -16261,13 +16293,13 @@ void swap(InvalidInputException &a, InvalidInputException &b) {
   swap(a.__isset, b.__isset);
 }
 
-InvalidInputException::InvalidInputException(const InvalidInputException& other703) : TException() {
-  message = other703.message;
-  __isset = other703.__isset;
-}
-InvalidInputException& InvalidInputException::operator=(const InvalidInputException& other704) {
+InvalidInputException::InvalidInputException(const InvalidInputException& other704) : TException() {
   message = other704.message;
   __isset = other704.__isset;
+}
+InvalidInputException& InvalidInputException::operator=(const InvalidInputException& other705) {
+  message = other705.message;
+  __isset = other705.__isset;
   return *this;
 }
 void InvalidInputException::printTo(std::ostream& out) const {
@@ -16358,13 +16390,13 @@ void swap(NoSuchTxnException &a, NoSuchTxnException &b) {
   swap(a.__isset, b.__isset);
 }
 
-NoSuchTxnException::NoSuchTxnException(const NoSuchTxnException& other705) : TException() {
-  message = other705.message;
-  __isset = other705.__isset;
-}
-NoSuchTxnException& NoSuchTxnException::operator=(const NoSuchTxnException& other706) {
+NoSuchTxnException::NoSuchTxnException(const NoSuchTxnException& other706) : TException() {
   message = other706.message;
   __isset = other706.__isset;
+}
+NoSuchTxnException& NoSuchTxnException::operator=(const NoSuchTxnException& other707) {
+  message = other707.message;
+  __isset = other707.__isset;
   return *this;
 }
 void NoSuchTxnException::printTo(std::ostream& out) const {
@@ -16455,13 +16487,13 @@ void swap(TxnAbortedException &a, TxnAbortedException &b) {
   swap(a.__isset, b.__isset);
 }
 
-TxnAbortedException::TxnAbortedException(const TxnAbortedException& other707) : TException() {
-  message = other707.message;
-  __isset = other707.__isset;
-}
-TxnAbortedException& TxnAbortedException::operator=(const TxnAbortedException& other708) {
+TxnAbortedException::TxnAbortedException(const TxnAbortedException& other708) : TException() {
   message = other708.message;
   __isset = other708.__isset;
+}
+TxnAbortedException& TxnAbortedException::operator=(const TxnAbortedException& other709) {
+  message = other709.message;
+  __isset = other709.__isset;
   return *this;
 }
 void TxnAbortedException::printTo(std::ostream& out) const {
@@ -16552,13 +16584,13 @@ void swap(TxnOpenException &a, TxnOpenException &b) {
   swap(a.__isset, b.__isset);
 }
 
-TxnOpenException::TxnOpenException(const TxnOpenException& other709) : TException() {
-  message = other709.message;
-  __isset = other709.__isset;
-}
-TxnOpenException& TxnOpenException::operator=(const TxnOpenException& other710) {
+TxnOpenException::TxnOpenException(const TxnOpenException& other710) : TException() {
   message = other710.message;
   __isset = other710.__isset;
+}
+TxnOpenException& TxnOpenException::operator=(const TxnOpenException& other711) {
+  message = other711.message;
+  __isset = other711.__isset;
   return *this;
 }
 void TxnOpenException::printTo(std::ostream& out) const {
@@ -16649,13 +16681,13 @@ void swap(NoSuchLockException &a, NoSuchLockException &b) {
   swap(a.__isset, b.__isset);
 }
 
-NoSuchLockException::NoSuchLockException(const NoSuchLockException& other711) : TException() {
-  message = other711.message;
-  __isset = other711.__isset;
-}
-NoSuchLockException& NoSuchLockException::operator=(const NoSuchLockException& other712) {
+NoSuchLockException::NoSuchLockException(const NoSuchLockException& other712) : TException() {
   message = other712.message;
   __isset = other712.__isset;
+}
+NoSuchLockException& NoSuchLockException::operator=(const NoSuchLockException& other713) {
+  message = other713.message;
+  __isset = other713.__isset;
   return *this;
 }
 void NoSuchLockException::printTo(std::ostream& out) const {

http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h
----------------------------------------------------------------------
diff --git a/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h b/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h
index c20badd..53ab272 100644
--- a/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h
+++ b/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h
@@ -137,6 +137,14 @@ struct ResourceType {
 
 extern const std::map<int, const char*> _ResourceType_VALUES_TO_NAMES;
 
+struct FileMetadataExprType {
+  enum type {
+    ORC_SARG = 1
+  };
+};
+
+extern const std::map<int, const char*> _FileMetadataExprType_VALUES_TO_NAMES;
+
 class Version;
 
 class FieldSchema;
@@ -5797,8 +5805,9 @@ inline std::ostream& operator<<(std::ostream& out, const GetFileMetadataByExprRe
 }
 
 typedef struct _GetFileMetadataByExprRequest__isset {
-  _GetFileMetadataByExprRequest__isset() : doGetFooters(false) {}
+  _GetFileMetadataByExprRequest__isset() : doGetFooters(false), type(false) {}
   bool doGetFooters :1;
+  bool type :1;
 } _GetFileMetadataByExprRequest__isset;
 
 class GetFileMetadataByExprRequest {
@@ -5806,13 +5815,14 @@ class GetFileMetadataByExprRequest {
 
   GetFileMetadataByExprRequest(const GetFileMetadataByExprRequest&);
   GetFileMetadataByExprRequest& operator=(const GetFileMetadataByExprRequest&);
-  GetFileMetadataByExprRequest() : expr(), doGetFooters(0) {
+  GetFileMetadataByExprRequest() : expr(), doGetFooters(0), type((FileMetadataExprType::type)0) {
   }
 
   virtual ~GetFileMetadataByExprRequest() throw();
   std::vector<int64_t>  fileIds;
   std::string expr;
   bool doGetFooters;
+  FileMetadataExprType::type type;
 
   _GetFileMetadataByExprRequest__isset __isset;
 
@@ -5822,6 +5832,8 @@ class GetFileMetadataByExprRequest {
 
   void __set_doGetFooters(const bool val);
 
+  void __set_type(const FileMetadataExprType::type val);
+
   bool operator == (const GetFileMetadataByExprRequest & rhs) const
   {
     if (!(fileIds == rhs.fileIds))
@@ -5832,6 +5844,10 @@ class GetFileMetadataByExprRequest {
       return false;
     else if (__isset.doGetFooters && !(doGetFooters == rhs.doGetFooters))
       return false;
+    if (__isset.type != rhs.__isset.type)
+      return false;
+    else if (__isset.type && !(type == rhs.type))
+      return false;
     return true;
   }
   bool operator != (const GetFileMetadataByExprRequest &rhs) const {

http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/FileMetadataExprType.java
----------------------------------------------------------------------
diff --git a/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/FileMetadataExprType.java b/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/FileMetadataExprType.java
new file mode 100644
index 0000000..4e393e2
--- /dev/null
+++ b/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/FileMetadataExprType.java
@@ -0,0 +1,42 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.hadoop.hive.metastore.api;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum FileMetadataExprType implements org.apache.thrift.TEnum {
+  ORC_SARG(1);
+
+  private final int value;
+
+  private FileMetadataExprType(int value) {
+    this.value = value;
+  }
+
+  /**
+   * Get the integer value of this enum value, as defined in the Thrift IDL.
+   */
+  public int getValue() {
+    return value;
+  }
+
+  /**
+   * Find a the enum type by its integer value, as defined in the Thrift IDL.
+   * @return null if the value is not found.
+   */
+  public static FileMetadataExprType findByValue(int value) { 
+    switch (value) {
+      case 1:
+        return ORC_SARG;
+      default:
+        return null;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetFileMetadataByExprRequest.java
----------------------------------------------------------------------
diff --git a/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetFileMetadataByExprRequest.java b/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetFileMetadataByExprRequest.java
index b880093..0236b4a 100644
--- a/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetFileMetadataByExprRequest.java
+++ b/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetFileMetadataByExprRequest.java
@@ -41,6 +41,7 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
   private static final org.apache.thrift.protocol.TField FILE_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("fileIds", org.apache.thrift.protocol.TType.LIST, (short)1);
   private static final org.apache.thrift.protocol.TField EXPR_FIELD_DESC = new org.apache.thrift.protocol.TField("expr", org.apache.thrift.protocol.TType.STRING, (short)2);
   private static final org.apache.thrift.protocol.TField DO_GET_FOOTERS_FIELD_DESC = new org.apache.thrift.protocol.TField("doGetFooters", org.apache.thrift.protocol.TType.BOOL, (short)3);
+  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)4);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -51,12 +52,18 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
   private List<Long> fileIds; // required
   private ByteBuffer expr; // required
   private boolean doGetFooters; // optional
+  private FileMetadataExprType type; // optional
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     FILE_IDS((short)1, "fileIds"),
     EXPR((short)2, "expr"),
-    DO_GET_FOOTERS((short)3, "doGetFooters");
+    DO_GET_FOOTERS((short)3, "doGetFooters"),
+    /**
+     * 
+     * @see FileMetadataExprType
+     */
+    TYPE((short)4, "type");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -77,6 +84,8 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
           return EXPR;
         case 3: // DO_GET_FOOTERS
           return DO_GET_FOOTERS;
+        case 4: // TYPE
+          return TYPE;
         default:
           return null;
       }
@@ -119,7 +128,7 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
   // isset id assignments
   private static final int __DOGETFOOTERS_ISSET_ID = 0;
   private byte __isset_bitfield = 0;
-  private static final _Fields optionals[] = {_Fields.DO_GET_FOOTERS};
+  private static final _Fields optionals[] = {_Fields.DO_GET_FOOTERS,_Fields.TYPE};
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -130,6 +139,8 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
     tmpMap.put(_Fields.DO_GET_FOOTERS, new org.apache.thrift.meta_data.FieldMetaData("doGetFooters", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, FileMetadataExprType.class)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetFileMetadataByExprRequest.class, metaDataMap);
   }
@@ -159,6 +170,9 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
       this.expr = org.apache.thrift.TBaseHelper.copyBinary(other.expr);
     }
     this.doGetFooters = other.doGetFooters;
+    if (other.isSetType()) {
+      this.type = other.type;
+    }
   }
 
   public GetFileMetadataByExprRequest deepCopy() {
@@ -171,6 +185,7 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
     this.expr = null;
     setDoGetFootersIsSet(false);
     this.doGetFooters = false;
+    this.type = null;
   }
 
   public int getFileIdsSize() {
@@ -265,6 +280,37 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DOGETFOOTERS_ISSET_ID, value);
   }
 
+  /**
+   * 
+   * @see FileMetadataExprType
+   */
+  public FileMetadataExprType getType() {
+    return this.type;
+  }
+
+  /**
+   * 
+   * @see FileMetadataExprType
+   */
+  public void setType(FileMetadataExprType type) {
+    this.type = type;
+  }
+
+  public void unsetType() {
+    this.type = null;
+  }
+
+  /** Returns true if field type is set (has been assigned a value) and false otherwise */
+  public boolean isSetType() {
+    return this.type != null;
+  }
+
+  public void setTypeIsSet(boolean value) {
+    if (!value) {
+      this.type = null;
+    }
+  }
+
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case FILE_IDS:
@@ -291,6 +337,14 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
       }
       break;
 
+    case TYPE:
+      if (value == null) {
+        unsetType();
+      } else {
+        setType((FileMetadataExprType)value);
+      }
+      break;
+
     }
   }
 
@@ -305,6 +359,9 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
     case DO_GET_FOOTERS:
       return isDoGetFooters();
 
+    case TYPE:
+      return getType();
+
     }
     throw new IllegalStateException();
   }
@@ -322,6 +379,8 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
       return isSetExpr();
     case DO_GET_FOOTERS:
       return isSetDoGetFooters();
+    case TYPE:
+      return isSetType();
     }
     throw new IllegalStateException();
   }
@@ -366,6 +425,15 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
         return false;
     }
 
+    boolean this_present_type = true && this.isSetType();
+    boolean that_present_type = true && that.isSetType();
+    if (this_present_type || that_present_type) {
+      if (!(this_present_type && that_present_type))
+        return false;
+      if (!this.type.equals(that.type))
+        return false;
+    }
+
     return true;
   }
 
@@ -388,6 +456,11 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
     if (present_doGetFooters)
       list.add(doGetFooters);
 
+    boolean present_type = true && (isSetType());
+    list.add(present_type);
+    if (present_type)
+      list.add(type.getValue());
+
     return list.hashCode();
   }
 
@@ -429,6 +502,16 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetType()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     return 0;
   }
 
@@ -470,6 +553,16 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
       sb.append(this.doGetFooters);
       first = false;
     }
+    if (isSetType()) {
+      if (!first) sb.append(", ");
+      sb.append("type:");
+      if (this.type == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.type);
+      }
+      first = false;
+    }
     sb.append(")");
     return sb.toString();
   }
@@ -557,6 +650,14 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
+          case 4: // TYPE
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.type = org.apache.hadoop.hive.metastore.api.FileMetadataExprType.findByValue(iprot.readI32());
+              struct.setTypeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
@@ -592,6 +693,13 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
         oprot.writeBool(struct.doGetFooters);
         oprot.writeFieldEnd();
       }
+      if (struct.type != null) {
+        if (struct.isSetType()) {
+          oprot.writeFieldBegin(TYPE_FIELD_DESC);
+          oprot.writeI32(struct.type.getValue());
+          oprot.writeFieldEnd();
+        }
+      }
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -621,10 +729,16 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
       if (struct.isSetDoGetFooters()) {
         optionals.set(0);
       }
-      oprot.writeBitSet(optionals, 1);
+      if (struct.isSetType()) {
+        optionals.set(1);
+      }
+      oprot.writeBitSet(optionals, 2);
       if (struct.isSetDoGetFooters()) {
         oprot.writeBool(struct.doGetFooters);
       }
+      if (struct.isSetType()) {
+        oprot.writeI32(struct.type.getValue());
+      }
     }
 
     @Override
@@ -643,11 +757,15 @@ public class GetFileMetadataByExprRequest implements org.apache.thrift.TBase<Get
       struct.setFileIdsIsSet(true);
       struct.expr = iprot.readBinary();
       struct.setExprIsSet(true);
-      BitSet incoming = iprot.readBitSet(1);
+      BitSet incoming = iprot.readBitSet(2);
       if (incoming.get(0)) {
         struct.doGetFooters = iprot.readBool();
         struct.setDoGetFootersIsSet(true);
       }
+      if (incoming.get(1)) {
+        struct.type = org.apache.hadoop.hive.metastore.api.FileMetadataExprType.findByValue(iprot.readI32());
+        struct.setTypeIsSet(true);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/gen/thrift/gen-php/metastore/Types.php
----------------------------------------------------------------------
diff --git a/metastore/src/gen/thrift/gen-php/metastore/Types.php b/metastore/src/gen/thrift/gen-php/metastore/Types.php
index 3ec2b1c..e63213d 100644
--- a/metastore/src/gen/thrift/gen-php/metastore/Types.php
+++ b/metastore/src/gen/thrift/gen-php/metastore/Types.php
@@ -143,6 +143,13 @@ final class ResourceType {
   );
 }
 
+final class FileMetadataExprType {
+  const ORC_SARG = 1;
+  static public $__names = array(
+    1 => 'ORC_SARG',
+  );
+}
+
 class Version {
   static $_TSPEC;
 
@@ -14108,6 +14115,10 @@ class GetFileMetadataByExprRequest {
    * @var bool
    */
   public $doGetFooters = null;
+  /**
+   * @var int
+   */
+  public $type = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -14128,6 +14139,10 @@ class GetFileMetadataByExprRequest {
           'var' => 'doGetFooters',
           'type' => TType::BOOL,
           ),
+        4 => array(
+          'var' => 'type',
+          'type' => TType::I32,
+          ),
         );
     }
     if (is_array($vals)) {
@@ -14140,6 +14155,9 @@ class GetFileMetadataByExprRequest {
       if (isset($vals['doGetFooters'])) {
         $this->doGetFooters = $vals['doGetFooters'];
       }
+      if (isset($vals['type'])) {
+        $this->type = $vals['type'];
+      }
     }
   }
 
@@ -14193,6 +14211,13 @@ class GetFileMetadataByExprRequest {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 4:
+          if ($ftype == TType::I32) {
+            $xfer += $input->readI32($this->type);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -14233,6 +14258,11 @@ class GetFileMetadataByExprRequest {
       $xfer += $output->writeBool($this->doGetFooters);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->type !== null) {
+      $xfer += $output->writeFieldBegin('type', TType::I32, 4);
+      $xfer += $output->writeI32($this->type);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;

http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py
----------------------------------------------------------------------
diff --git a/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py b/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py
index 221d602..8940dff 100644
--- a/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py
+++ b/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py
@@ -213,6 +213,17 @@ class ResourceType:
     "ARCHIVE": 3,
   }
 
+class FileMetadataExprType:
+  ORC_SARG = 1
+
+  _VALUES_TO_NAMES = {
+    1: "ORC_SARG",
+  }
+
+  _NAMES_TO_VALUES = {
+    "ORC_SARG": 1,
+  }
+
 
 class Version:
   """
@@ -9927,6 +9938,7 @@ class GetFileMetadataByExprRequest:
    - fileIds
    - expr
    - doGetFooters
+   - type
   """
 
   thrift_spec = (
@@ -9934,12 +9946,14 @@ class GetFileMetadataByExprRequest:
     (1, TType.LIST, 'fileIds', (TType.I64,None), None, ), # 1
     (2, TType.STRING, 'expr', None, None, ), # 2
     (3, TType.BOOL, 'doGetFooters', None, None, ), # 3
+    (4, TType.I32, 'type', None, None, ), # 4
   )
 
-  def __init__(self, fileIds=None, expr=None, doGetFooters=None,):
+  def __init__(self, fileIds=None, expr=None, doGetFooters=None, type=None,):
     self.fileIds = fileIds
     self.expr = expr
     self.doGetFooters = doGetFooters
+    self.type = type
 
   def read(self, iprot):
     if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -9970,6 +9984,11 @@ class GetFileMetadataByExprRequest:
           self.doGetFooters = iprot.readBool()
         else:
           iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.I32:
+          self.type = iprot.readI32()
+        else:
+          iprot.skip(ftype)
       else:
         iprot.skip(ftype)
       iprot.readFieldEnd()
@@ -9995,6 +10014,10 @@ class GetFileMetadataByExprRequest:
       oprot.writeFieldBegin('doGetFooters', TType.BOOL, 3)
       oprot.writeBool(self.doGetFooters)
       oprot.writeFieldEnd()
+    if self.type is not None:
+      oprot.writeFieldBegin('type', TType.I32, 4)
+      oprot.writeI32(self.type)
+      oprot.writeFieldEnd()
     oprot.writeFieldStop()
     oprot.writeStructEnd()
 
@@ -10011,6 +10034,7 @@ class GetFileMetadataByExprRequest:
     value = (value * 31) ^ hash(self.fileIds)
     value = (value * 31) ^ hash(self.expr)
     value = (value * 31) ^ hash(self.doGetFooters)
+    value = (value * 31) ^ hash(self.type)
     return value
 
   def __repr__(self):

http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb
----------------------------------------------------------------------
diff --git a/metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb b/metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb
index cfabbb8..08b9b06 100644
--- a/metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb
+++ b/metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb
@@ -101,6 +101,12 @@ module ResourceType
   VALID_VALUES = Set.new([JAR, FILE, ARCHIVE]).freeze
 end
 
+module FileMetadataExprType
+  ORC_SARG = 1
+  VALUE_MAP = {1 => "ORC_SARG"}
+  VALID_VALUES = Set.new([ORC_SARG]).freeze
+end
+
 class Version
   include ::Thrift::Struct, ::Thrift::Struct_Union
   VERSION = 1
@@ -2274,11 +2280,13 @@ class GetFileMetadataByExprRequest
   FILEIDS = 1
   EXPR = 2
   DOGETFOOTERS = 3
+  TYPE = 4
 
   FIELDS = {
     FILEIDS => {:type => ::Thrift::Types::LIST, :name => 'fileIds', :element => {:type => ::Thrift::Types::I64}},
     EXPR => {:type => ::Thrift::Types::STRING, :name => 'expr', :binary => true},
-    DOGETFOOTERS => {:type => ::Thrift::Types::BOOL, :name => 'doGetFooters', :optional => true}
+    DOGETFOOTERS => {:type => ::Thrift::Types::BOOL, :name => 'doGetFooters', :optional => true},
+    TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :optional => true, :enum_class => ::FileMetadataExprType}
   }
 
   def struct_fields; FIELDS; end
@@ -2286,6 +2294,9 @@ class GetFileMetadataByExprRequest
   def validate
     raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field fileIds is unset!') unless @fileIds
     raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field expr is unset!') unless @expr
+    unless @type.nil? || ::FileMetadataExprType::VALID_VALUES.include?(@type)
+      raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
+    end
   end
 
   ::Thrift::Struct.generate_accessors self

http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/java/org/apache/hadoop/hive/metastore/FileMetadataHandler.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/FileMetadataHandler.java b/metastore/src/java/org/apache/hadoop/hive/metastore/FileMetadataHandler.java
new file mode 100644
index 0000000..7c3525a
--- /dev/null
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/FileMetadataHandler.java
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.metastore;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.List;
+
+public interface FileMetadataHandler {
+
+  void getFileMetadataByExpr(List<Long> fileIds, byte[] expr,
+      ByteBuffer[] metadatas, ByteBuffer[] results, boolean[] eliminated) throws IOException;
+
+}

http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
index 40e6e62..8ed4310 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
@@ -5617,13 +5617,16 @@ public class HiveMetaStore extends ThriftHiveMetastore {
         return result;
       }
       result.setIsSupported(true);
+
       List<Long> fileIds = req.getFileIds();
-      byte[] expr = req.getExpr();
-      boolean needMetadata = req.isDoGetFooters();
-      ByteBuffer[] metadatas = new ByteBuffer[fileIds.size()];
-      ByteBuffer[] stripeBitsets = new ByteBuffer[fileIds.size()];
+      boolean needMetadata = !req.isSetDoGetFooters() || req.isDoGetFooters();
+      FileMetadataExprType type = req.isSetType() ? req.getType() : FileMetadataExprType.ORC_SARG;
+
+      ByteBuffer[] metadatas = needMetadata ? new ByteBuffer[fileIds.size()] : null;
+      ByteBuffer[] ppdResults = new ByteBuffer[fileIds.size()];
       boolean[] eliminated = new boolean[fileIds.size()];
-      getMS().getFileMetadataByExpr(fileIds, expr, metadatas, stripeBitsets, eliminated);
+
+      getMS().getFileMetadataByExpr(fileIds, type, req.getExpr(), metadatas, ppdResults, eliminated);
       for (int i = 0; i < metadatas.length; ++i) {
         long fileId = fileIds.get(i);
         ByteBuffer metadata = metadatas[i];
@@ -5631,7 +5634,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
         metadata = (eliminated[i] || !needMetadata) ? null
             : handleReadOnlyBufferForThrift(metadata);
         MetadataPpdResult mpr = new MetadataPpdResult();
-        ByteBuffer bitset = eliminated[i] ? null : handleReadOnlyBufferForThrift(stripeBitsets[i]);
+        ByteBuffer bitset = eliminated[i] ? null : handleReadOnlyBufferForThrift(ppdResults[i]);
         mpr.setMetadata(metadata);
         mpr.setIncludeBitset(bitset);
         result.putToMetadata(fileId, mpr);

http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
index f0c1893..0f98963 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
@@ -79,6 +79,7 @@ import org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj;
 import org.apache.hadoop.hive.metastore.api.CurrentNotificationEventId;
 import org.apache.hadoop.hive.metastore.api.Database;
 import org.apache.hadoop.hive.metastore.api.FieldSchema;
+import org.apache.hadoop.hive.metastore.api.FileMetadataExprType;
 import org.apache.hadoop.hive.metastore.api.Function;
 import org.apache.hadoop.hive.metastore.api.FunctionType;
 import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege;
@@ -7666,7 +7667,7 @@ public class ObjectStore implements RawStore, Configurable {
   }
 
   @Override
-  public void getFileMetadataByExpr(List<Long> fileIds, byte[] expr,
+  public void getFileMetadataByExpr(List<Long> fileIds, FileMetadataExprType type, byte[] expr,
       ByteBuffer[] metadatas, ByteBuffer[] stripeBitsets, boolean[] eliminated) {
     throw new UnsupportedOperationException();
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java
index 45428ed..4aa17a5 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java
@@ -31,6 +31,7 @@ import org.apache.hadoop.hive.metastore.api.AggrStats;
 import org.apache.hadoop.hive.metastore.api.ColumnStatistics;
 import org.apache.hadoop.hive.metastore.api.CurrentNotificationEventId;
 import org.apache.hadoop.hive.metastore.api.Database;
+import org.apache.hadoop.hive.metastore.api.FileMetadataExprType;
 import org.apache.hadoop.hive.metastore.api.Function;
 import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege;
 import org.apache.hadoop.hive.metastore.api.Index;
@@ -617,6 +618,7 @@ public interface RawStore extends Configurable {
    * produce additional information based on file metadata and also filter the file list.
    * @param fileIds List of file IDs from the filesystem.
    * @param expr Format-specific serialized expression applicable to the files' metadatas.
+   * @param type Expression type; used to determine the class that handles the metadata.
    * @param metadatas Output parameter; fileIds-sized array to receive the metadatas
    *                  for corresponding files, if any.
    * @param exprResults Output parameter; fileIds-sized array to receive the format-specific
@@ -624,7 +626,7 @@ public interface RawStore extends Configurable {
    * @param eliminated Output parameter; fileIds-sized array to receive the indication of whether
    *                   the corresponding files are entirely eliminated by the expression.
    */
-  void getFileMetadataByExpr(
-      List<Long> fileIds, byte[] expr, ByteBuffer[] metadatas,
-      ByteBuffer[] exprResults, boolean[] eliminated) throws MetaException;
+  void getFileMetadataByExpr(List<Long> fileIds, FileMetadataExprType type, byte[] expr,
+      ByteBuffer[] metadatas, ByteBuffer[] exprResults, boolean[] eliminated)
+          throws MetaException;
 }

http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/java/org/apache/hadoop/hive/metastore/filemeta/OrcFileMetadataHandler.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/filemeta/OrcFileMetadataHandler.java b/metastore/src/java/org/apache/hadoop/hive/metastore/filemeta/OrcFileMetadataHandler.java
new file mode 100644
index 0000000..14189da
--- /dev/null
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/filemeta/OrcFileMetadataHandler.java
@@ -0,0 +1,63 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.metastore.filemeta;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.List;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.FileMetadataHandler;
+import org.apache.hadoop.hive.metastore.PartitionExpressionProxy;
+import org.apache.hadoop.hive.metastore.hbase.HBaseReadWrite;
+import org.apache.hadoop.hive.ql.io.sarg.SearchArgument;
+
+public class OrcFileMetadataHandler implements FileMetadataHandler {
+  private final Configuration conf;
+  private final PartitionExpressionProxy expressionProxy;
+  private final HBaseReadWrite hbase;
+
+  public OrcFileMetadataHandler(Configuration conf,
+      PartitionExpressionProxy expressionProxy, HBaseReadWrite hbase) {
+    this.conf = conf;
+    this.expressionProxy = expressionProxy;
+    this.hbase = hbase;
+  }
+
+  @Override
+  public void getFileMetadataByExpr(List<Long> fileIds, byte[] expr,
+      ByteBuffer[] metadatas, ByteBuffer[] results, boolean[] eliminated) throws IOException {
+    SearchArgument sarg = expressionProxy.createSarg(expr);
+    // For now, don't push anything into HBase, nor store anything special in HBase
+    if (metadatas == null) {
+      // null means don't return metadata; we'd need the array anyway for now.
+      metadatas = new ByteBuffer[results.length];
+    }
+    hbase.getFileMetadata(fileIds, metadatas);
+    for (int i = 0; i < metadatas.length;  ++i) {
+      if (metadatas[i] == null) continue;
+      ByteBuffer result = expressionProxy.applySargToFileMetadata(sarg, metadatas[i]);
+      eliminated[i] = (result == null);
+      if (!eliminated[i]) {
+        results[i] = result;
+      }
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseReadWrite.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseReadWrite.java b/metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseReadWrite.java
index 781f562..ffd3ee5 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseReadWrite.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseReadWrite.java
@@ -1747,7 +1747,7 @@ public class HBaseReadWrite {
    * @param fileIds file ID list.
    * @return Serialized file metadata.
    */
-  void getFileMetadata(List<Long> fileIds, ByteBuffer[] result) throws IOException {
+  public void getFileMetadata(List<Long> fileIds, ByteBuffer[] result) throws IOException {
     byte[][] keys = new byte[fileIds.size()][];
     for (int i = 0; i < fileIds.size(); ++i) {
       keys[i] = HBaseUtils.makeLongKey(fileIds.get(i));

http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseStore.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseStore.java
index 09e57e5..67a02d9 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseStore.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseStore.java
@@ -27,6 +27,7 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hive.common.FileUtils;
 import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.metastore.FileMetadataHandler;
 import org.apache.hadoop.hive.metastore.HiveMetaStore;
 import org.apache.hadoop.hive.metastore.PartFilterExprUtil;
 import org.apache.hadoop.hive.metastore.PartitionExpressionProxy;
@@ -38,6 +39,7 @@ import org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj;
 import org.apache.hadoop.hive.metastore.api.CurrentNotificationEventId;
 import org.apache.hadoop.hive.metastore.api.Database;
 import org.apache.hadoop.hive.metastore.api.FieldSchema;
+import org.apache.hadoop.hive.metastore.api.FileMetadataExprType;
 import org.apache.hadoop.hive.metastore.api.Function;
 import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege;
 import org.apache.hadoop.hive.metastore.api.HiveObjectRef;
@@ -64,6 +66,7 @@ import org.apache.hadoop.hive.metastore.api.Type;
 import org.apache.hadoop.hive.metastore.api.UnknownDBException;
 import org.apache.hadoop.hive.metastore.api.UnknownPartitionException;
 import org.apache.hadoop.hive.metastore.api.UnknownTableException;
+import org.apache.hadoop.hive.metastore.filemeta.OrcFileMetadataHandler;
 import org.apache.hadoop.hive.metastore.hbase.HBaseFilterPlanUtil.PlanResult;
 import org.apache.hadoop.hive.metastore.hbase.HBaseFilterPlanUtil.ScanPlan;
 import org.apache.hadoop.hive.metastore.parser.ExpressionTree;
@@ -96,6 +99,7 @@ public class HBaseStore implements RawStore {
   private Configuration conf;
   private int txnNestLevel = 0;
   private PartitionExpressionProxy expressionProxy = null;
+  private Map<FileMetadataExprType, FileMetadataHandler> fmHandlers = new HashMap<>();
 
   public HBaseStore() {
   }
@@ -2241,10 +2245,24 @@ public class HBaseStore implements RawStore {
     // initialize expressionProxy. Also re-initialize it if
     // setConf is being called with new configuration object (though that
     // is not expected to happen, doing it just for safety)
-    if(expressionProxy == null || conf != configuration) {
+    // TODO: why not re-intialize HBaseReadWrite?
+    if (expressionProxy == null || conf != configuration) {
       expressionProxy = PartFilterExprUtil.createExpressionProxy(configuration);
     }
     conf = configuration;
+    createFileMetadataHandlers();
+  }
+
+  private void createFileMetadataHandlers() {
+    for (FileMetadataExprType v : FileMetadataExprType.values()) {
+      switch (v) {
+      case ORC_SARG:
+        fmHandlers.put(v, new OrcFileMetadataHandler(conf, expressionProxy, getHBase()));
+        break;
+      default:
+        throw new AssertionError("Unsupported type " + v);
+      }
+    }
   }
 
   @Override
@@ -2380,25 +2398,16 @@ public class HBaseStore implements RawStore {
   }
 
   @Override
-  public void getFileMetadataByExpr(List<Long> fileIds, byte[] expr, ByteBuffer[] metadatas,
-      ByteBuffer[] results, boolean[] eliminated) throws MetaException {
-    SearchArgument sarg = expressionProxy.createSarg(expr);
+  public void getFileMetadataByExpr(List<Long> fileIds, FileMetadataExprType type, byte[] expr,
+      ByteBuffer[] metadatas, ByteBuffer[] results, boolean[] eliminated) throws MetaException {
+    FileMetadataHandler fmh = fmHandlers.get(type);
     boolean commit = true;
     try {
-      // For now, don't push anything into HBase, nor store anything special in HBase
-      getHBase().getFileMetadata(fileIds, metadatas);
-      for (int i = 0; i < metadatas.length;  ++i) {
-        if (metadatas[i] == null) continue;
-        ByteBuffer result = expressionProxy.applySargToFileMetadata(sarg, metadatas[i]);
-        eliminated[i] = (result == null);
-        if (!eliminated[i]) {
-          results[i] = result;
-        }
-      }
+      fmh.getFileMetadataByExpr(fileIds, expr, metadatas, results, eliminated);
     } catch (IOException e) {
+      LOG.error("Unable to get file metadata by expr", e);
       commit = false;
-      LOG.error("Unable to get file metadata", e);
-      throw new MetaException("Error reading file metadata " + e.getMessage());
+      throw new MetaException("Error reading file metadata by expr" + e.getMessage());
     } finally {
       commitOrRoleBack(commit);
     }

http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java
----------------------------------------------------------------------
diff --git a/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java b/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java
index d11c0d5..a100e9f 100644
--- a/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java
+++ b/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java
@@ -30,6 +30,7 @@ import org.apache.hadoop.hive.metastore.api.AggrStats;
 import org.apache.hadoop.hive.metastore.api.ColumnStatistics;
 import org.apache.hadoop.hive.metastore.api.CurrentNotificationEventId;
 import org.apache.hadoop.hive.metastore.api.Database;
+import org.apache.hadoop.hive.metastore.api.FileMetadataExprType;
 import org.apache.hadoop.hive.metastore.api.Function;
 import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege;
 import org.apache.hadoop.hive.metastore.api.Index;
@@ -777,7 +778,7 @@ public class DummyRawStoreControlledCommit implements RawStore, Configurable {
 
 
   @Override
-  public void getFileMetadataByExpr(List<Long> fileIds, byte[] expr,
+  public void getFileMetadataByExpr(List<Long> fileIds, FileMetadataExprType type, byte[] expr,
       ByteBuffer[] metadatas, ByteBuffer[] stripeBitsets, boolean[] eliminated) {
   }
 }

http://git-wip-us.apache.org/repos/asf/hive/blob/e5b53032/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java
----------------------------------------------------------------------
diff --git a/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java b/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java
index 2de049a..f6100e6 100644
--- a/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java
+++ b/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java
@@ -31,6 +31,7 @@ import org.apache.hadoop.hive.metastore.api.AggrStats;
 import org.apache.hadoop.hive.metastore.api.ColumnStatistics;
 import org.apache.hadoop.hive.metastore.api.CurrentNotificationEventId;
 import org.apache.hadoop.hive.metastore.api.Database;
+import org.apache.hadoop.hive.metastore.api.FileMetadataExprType;
 import org.apache.hadoop.hive.metastore.api.Function;
 import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege;
 import org.apache.hadoop.hive.metastore.api.Index;
@@ -793,7 +794,7 @@ public class DummyRawStoreForJdoConnection implements RawStore {
   }
 
   @Override
-  public void getFileMetadataByExpr(List<Long> fileIds, byte[] expr,
+  public void getFileMetadataByExpr(List<Long> fileIds, FileMetadataExprType type, byte[] expr,
       ByteBuffer[] metadatas, ByteBuffer[] stripeBitsets, boolean[] eliminated) {
   }
 }


Mime
View raw message