diff --git .gitignore .gitignore index 376cdc6..e54804f 100644 --- .gitignore +++ .gitignore @@ -6,3 +6,4 @@ build-eclipse .settings *.launch *~ +metastore_db diff --git build-common.xml build-common.xml index 7e435ce..f78d11d 100644 --- build-common.xml +++ build-common.xml @@ -428,7 +428,7 @@ + excludes="**/TestSerDe.class,**/TestHiveMetaStore.class,**/*$*.class" /> diff --git eclipse-templates/TestCliDriver.launchtemplate eclipse-templates/TestCliDriver.launchtemplate index 8833251..8984d3c 100644 --- eclipse-templates/TestCliDriver.launchtemplate +++ eclipse-templates/TestCliDriver.launchtemplate @@ -21,6 +21,6 @@ - + diff --git eclipse-templates/TestEmbeddedHiveMetaStore.launchtemplate eclipse-templates/TestEmbeddedHiveMetaStore.launchtemplate new file mode 100644 index 0000000..c4d8e9a --- /dev/null +++ eclipse-templates/TestEmbeddedHiveMetaStore.launchtemplate @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git eclipse-templates/TestHive.launchtemplate eclipse-templates/TestHive.launchtemplate index 4d740ad..e040f38 100644 --- eclipse-templates/TestHive.launchtemplate +++ eclipse-templates/TestHive.launchtemplate @@ -21,6 +21,6 @@ - + diff --git eclipse-templates/TestHiveMetaStoreChecker.launchtemplate eclipse-templates/TestHiveMetaStoreChecker.launchtemplate new file mode 100644 index 0000000..78c022c --- /dev/null +++ eclipse-templates/TestHiveMetaStoreChecker.launchtemplate @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git eclipse-templates/TestRemoteMetaStore.launchtemplate eclipse-templates/TestRemoteMetaStore.launchtemplate new file mode 100644 index 0000000..3600e5c --- /dev/null +++ eclipse-templates/TestRemoteMetaStore.launchtemplate @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git metastore/if/hive_metastore.thrift metastore/if/hive_metastore.thrift index 537c093..f316451 100755 --- metastore/if/hive_metastore.thrift +++ metastore/if/hive_metastore.thrift @@ -33,6 +33,7 @@ struct Type { struct Database { 1: string name, 2: string description, + 3: string locationUri, } // This object holds the information needed by SerDes @@ -148,16 +149,16 @@ exception ConfigValSecurityException { */ service ThriftHiveMetastore extends fb303.FacebookService { - bool create_database(1:string name, 2:string description) - throws(1:AlreadyExistsException o1, 2:MetaException o2) + void create_database(1:Database database) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3) Database get_database(1:string name) throws(1:NoSuchObjectException o1, 2:MetaException o2) - bool drop_database(1:string name) throws(2:MetaException o2) - list get_databases() throws(1:MetaException o1) + void drop_database(1:string name, 2:bool deleteData) throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3) + list get_databases(1:string pattern) throws(1:MetaException o1) + list get_all_databases() throws(1:MetaException o1) // returns the type with given name (make seperate calls for the dependent types if needed) - Type get_type(1:string name) throws(1:MetaException o2) + Type get_type(1:string name) throws(1:MetaException o1, 2:NoSuchObjectException o2) bool create_type(1:Type type) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3) - bool drop_type(1:string type) throws(1:MetaException o2) + bool drop_type(1:string type) throws(1:MetaException o1, 2:NoSuchObjectException o2) map get_type_all(1:string name) throws(1:MetaException o2) @@ -180,8 +181,8 @@ service ThriftHiveMetastore extends fb303.FacebookService // delete data (including partitions) if deleteData is set to true void drop_table(1:string dbname, 2:string name, 3:bool deleteData) throws(1:NoSuchObjectException o1, 2:MetaException o3) - list get_tables(1: string db_name, 2: string pattern) - throws (1: MetaException o1) + list get_tables(1: string db_name, 2: string pattern) throws (1: MetaException o1) + list get_all_tables(1: string db_name) throws (1: MetaException o1) Table get_table(1:string dbname, 2:string tbl_name) throws (1:MetaException o1, 2:NoSuchObjectException o2) diff --git metastore/src/gen-cpp/ThriftHiveMetastore.cpp metastore/src/gen-cpp/ThriftHiveMetastore.cpp index d6eddca..010323c 100644 --- metastore/src/gen-cpp/ThriftHiveMetastore.cpp +++ metastore/src/gen-cpp/ThriftHiveMetastore.cpp @@ -28,17 +28,9 @@ uint32_t ThriftHiveMetastore_create_database_args::read(apache::thrift::protocol switch (fid) { case 1: - if (ftype == apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->name); - this->__isset.name = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->description); - this->__isset.description = true; + if (ftype == apache::thrift::protocol::T_STRUCT) { + xfer += this->database.read(iprot); + this->__isset.database = true; } else { xfer += iprot->skip(ftype); } @@ -58,11 +50,8 @@ uint32_t ThriftHiveMetastore_create_database_args::read(apache::thrift::protocol uint32_t ThriftHiveMetastore_create_database_args::write(apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_database_args"); - xfer += oprot->writeFieldBegin("name", apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString(this->name); - xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldBegin("description", apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->description); + xfer += oprot->writeFieldBegin("database", apache::thrift::protocol::T_STRUCT, 1); + xfer += this->database.write(oprot); xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); @@ -72,11 +61,8 @@ uint32_t ThriftHiveMetastore_create_database_args::write(apache::thrift::protoco uint32_t ThriftHiveMetastore_create_database_pargs::write(apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_database_pargs"); - xfer += oprot->writeFieldBegin("name", apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString((*(this->name))); - xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldBegin("description", apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString((*(this->description))); + xfer += oprot->writeFieldBegin("database", apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->database)).write(oprot); xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); @@ -103,14 +89,6 @@ uint32_t ThriftHiveMetastore_create_database_result::read(apache::thrift::protoc } switch (fid) { - case 0: - if (ftype == apache::thrift::protocol::T_BOOL) { - xfer += iprot->readBool(this->success); - this->__isset.success = true; - } else { - xfer += iprot->skip(ftype); - } - break; case 1: if (ftype == apache::thrift::protocol::T_STRUCT) { xfer += this->o1.read(iprot); @@ -127,6 +105,14 @@ uint32_t ThriftHiveMetastore_create_database_result::read(apache::thrift::protoc 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; @@ -145,11 +131,7 @@ uint32_t ThriftHiveMetastore_create_database_result::write(apache::thrift::proto xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_database_result"); - if (this->__isset.success) { - xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_BOOL, 0); - xfer += oprot->writeBool(this->success); - xfer += oprot->writeFieldEnd(); - } else if (this->__isset.o1) { + if (this->__isset.o1) { xfer += oprot->writeFieldBegin("o1", apache::thrift::protocol::T_STRUCT, 1); xfer += this->o1.write(oprot); xfer += oprot->writeFieldEnd(); @@ -157,6 +139,10 @@ uint32_t ThriftHiveMetastore_create_database_result::write(apache::thrift::proto 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(); @@ -183,14 +169,6 @@ uint32_t ThriftHiveMetastore_create_database_presult::read(apache::thrift::proto } switch (fid) { - case 0: - if (ftype == apache::thrift::protocol::T_BOOL) { - xfer += iprot->readBool((*(this->success))); - this->__isset.success = true; - } else { - xfer += iprot->skip(ftype); - } - break; case 1: if (ftype == apache::thrift::protocol::T_STRUCT) { xfer += this->o1.read(iprot); @@ -207,6 +185,14 @@ uint32_t ThriftHiveMetastore_create_database_presult::read(apache::thrift::proto 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; @@ -445,6 +431,14 @@ uint32_t ThriftHiveMetastore_drop_database_args::read(apache::thrift::protocol:: xfer += iprot->skip(ftype); } break; + case 2: + if (ftype == apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->deleteData); + this->__isset.deleteData = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -463,6 +457,9 @@ uint32_t ThriftHiveMetastore_drop_database_args::write(apache::thrift::protocol: xfer += oprot->writeFieldBegin("name", apache::thrift::protocol::T_STRING, 1); xfer += oprot->writeString(this->name); xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("deleteData", apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->deleteData); + xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -474,6 +471,9 @@ uint32_t ThriftHiveMetastore_drop_database_pargs::write(apache::thrift::protocol xfer += oprot->writeFieldBegin("name", apache::thrift::protocol::T_STRING, 1); xfer += oprot->writeString((*(this->name))); xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("deleteData", apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool((*(this->deleteData))); + xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -499,10 +499,10 @@ uint32_t ThriftHiveMetastore_drop_database_result::read(apache::thrift::protocol } switch (fid) { - case 0: - if (ftype == apache::thrift::protocol::T_BOOL) { - xfer += iprot->readBool(this->success); - this->__isset.success = true; + case 1: + if (ftype == apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; } else { xfer += iprot->skip(ftype); } @@ -515,6 +515,14 @@ uint32_t ThriftHiveMetastore_drop_database_result::read(apache::thrift::protocol 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; @@ -533,14 +541,18 @@ uint32_t ThriftHiveMetastore_drop_database_result::write(apache::thrift::protoco xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_database_result"); - if (this->__isset.success) { - xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_BOOL, 0); - xfer += oprot->writeBool(this->success); + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); xfer += oprot->writeFieldEnd(); } else if (this->__isset.o2) { 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(); @@ -567,10 +579,10 @@ uint32_t ThriftHiveMetastore_drop_database_presult::read(apache::thrift::protoco } switch (fid) { - case 0: - if (ftype == apache::thrift::protocol::T_BOOL) { - xfer += iprot->readBool((*(this->success))); - this->__isset.success = true; + case 1: + if (ftype == apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; } else { xfer += iprot->skip(ftype); } @@ -583,6 +595,14 @@ uint32_t ThriftHiveMetastore_drop_database_presult::read(apache::thrift::protoco 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; @@ -615,6 +635,14 @@ uint32_t ThriftHiveMetastore_get_databases_args::read(apache::thrift::protocol:: } switch (fid) { + case 1: + if (ftype == apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->pattern); + this->__isset.pattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -630,6 +658,9 @@ uint32_t ThriftHiveMetastore_get_databases_args::read(apache::thrift::protocol:: uint32_t ThriftHiveMetastore_get_databases_args::write(apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_databases_args"); + xfer += oprot->writeFieldBegin("pattern", apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->pattern); + xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -638,6 +669,9 @@ uint32_t ThriftHiveMetastore_get_databases_args::write(apache::thrift::protocol: uint32_t ThriftHiveMetastore_get_databases_pargs::write(apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_databases_pargs"); + xfer += oprot->writeFieldBegin("pattern", apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->pattern))); + xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -791,6 +825,202 @@ uint32_t ThriftHiveMetastore_get_databases_presult::read(apache::thrift::protoco return xfer; } +uint32_t ThriftHiveMetastore_get_all_databases_args::read(apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_databases_args::write(apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_databases_args"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_databases_pargs::write(apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_databases_pargs"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_databases_result::read(apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size99; + apache::thrift::protocol::TType _etype102; + iprot->readListBegin(_etype102, _size99); + this->success.resize(_size99); + uint32_t _i103; + for (_i103 = 0; _i103 < _size99; ++_i103) + { + xfer += iprot->readString(this->success[_i103]); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_databases_result::write(apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_databases_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, this->success.size()); + std::vector ::const_iterator _iter104; + for (_iter104 = this->success.begin(); _iter104 != this->success.end(); ++_iter104) + { + xfer += oprot->writeString((*_iter104)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_databases_presult::read(apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size105; + apache::thrift::protocol::TType _etype108; + iprot->readListBegin(_etype108, _size105); + (*(this->success)).resize(_size105); + uint32_t _i109; + for (_i109 = 0; _i109 < _size105; ++_i109) + { + xfer += iprot->readString((*(this->success))[_i109]); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + uint32_t ThriftHiveMetastore_get_type_args::read(apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; @@ -883,6 +1113,14 @@ uint32_t ThriftHiveMetastore_get_type_result::read(apache::thrift::protocol::TPr break; case 1: if (ftype == apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == apache::thrift::protocol::T_STRUCT) { xfer += this->o2.read(iprot); this->__isset.o2 = true; } else { @@ -911,8 +1149,12 @@ uint32_t ThriftHiveMetastore_get_type_result::write(apache::thrift::protocol::TP xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_STRUCT, 0); xfer += this->success.write(oprot); xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); } else if (this->__isset.o2) { - xfer += oprot->writeFieldBegin("o2", apache::thrift::protocol::T_STRUCT, 1); + xfer += oprot->writeFieldBegin("o2", apache::thrift::protocol::T_STRUCT, 2); xfer += this->o2.write(oprot); xfer += oprot->writeFieldEnd(); } @@ -951,6 +1193,14 @@ uint32_t ThriftHiveMetastore_get_type_presult::read(apache::thrift::protocol::TP break; case 1: if (ftype == apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == apache::thrift::protocol::T_STRUCT) { xfer += this->o2.read(iprot); this->__isset.o2 = true; } else { @@ -1279,6 +1529,14 @@ uint32_t ThriftHiveMetastore_drop_type_result::read(apache::thrift::protocol::TP break; case 1: if (ftype == apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == apache::thrift::protocol::T_STRUCT) { xfer += this->o2.read(iprot); this->__isset.o2 = true; } else { @@ -1307,8 +1565,12 @@ uint32_t ThriftHiveMetastore_drop_type_result::write(apache::thrift::protocol::T xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_BOOL, 0); xfer += oprot->writeBool(this->success); xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); } else if (this->__isset.o2) { - xfer += oprot->writeFieldBegin("o2", apache::thrift::protocol::T_STRUCT, 1); + xfer += oprot->writeFieldBegin("o2", apache::thrift::protocol::T_STRUCT, 2); xfer += this->o2.write(oprot); xfer += oprot->writeFieldEnd(); } @@ -1345,7 +1607,15 @@ uint32_t ThriftHiveMetastore_drop_type_presult::read(apache::thrift::protocol::T xfer += iprot->skip(ftype); } break; - case 1: + case 1: + if (ftype == apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: if (ftype == apache::thrift::protocol::T_STRUCT) { xfer += this->o2.read(iprot); this->__isset.o2 = true; @@ -1451,17 +1721,17 @@ uint32_t ThriftHiveMetastore_get_type_all_result::read(apache::thrift::protocol: if (ftype == apache::thrift::protocol::T_MAP) { { this->success.clear(); - uint32_t _size99; - apache::thrift::protocol::TType _ktype100; - apache::thrift::protocol::TType _vtype101; - iprot->readMapBegin(_ktype100, _vtype101, _size99); - uint32_t _i103; - for (_i103 = 0; _i103 < _size99; ++_i103) + uint32_t _size110; + apache::thrift::protocol::TType _ktype111; + apache::thrift::protocol::TType _vtype112; + iprot->readMapBegin(_ktype111, _vtype112, _size110); + uint32_t _i114; + for (_i114 = 0; _i114 < _size110; ++_i114) { - std::string _key104; - xfer += iprot->readString(_key104); - Type& _val105 = this->success[_key104]; - xfer += _val105.read(iprot); + std::string _key115; + xfer += iprot->readString(_key115); + Type& _val116 = this->success[_key115]; + xfer += _val116.read(iprot); } iprot->readMapEnd(); } @@ -1500,11 +1770,11 @@ uint32_t ThriftHiveMetastore_get_type_all_result::write(apache::thrift::protocol xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_MAP, 0); { xfer += oprot->writeMapBegin(apache::thrift::protocol::T_STRING, apache::thrift::protocol::T_STRUCT, this->success.size()); - std::map ::const_iterator _iter106; - for (_iter106 = this->success.begin(); _iter106 != this->success.end(); ++_iter106) + std::map ::const_iterator _iter117; + for (_iter117 = this->success.begin(); _iter117 != this->success.end(); ++_iter117) { - xfer += oprot->writeString(_iter106->first); - xfer += _iter106->second.write(oprot); + xfer += oprot->writeString(_iter117->first); + xfer += _iter117->second.write(oprot); } xfer += oprot->writeMapEnd(); } @@ -1543,17 +1813,17 @@ uint32_t ThriftHiveMetastore_get_type_all_presult::read(apache::thrift::protocol if (ftype == apache::thrift::protocol::T_MAP) { { (*(this->success)).clear(); - uint32_t _size107; - apache::thrift::protocol::TType _ktype108; - apache::thrift::protocol::TType _vtype109; - iprot->readMapBegin(_ktype108, _vtype109, _size107); - uint32_t _i111; - for (_i111 = 0; _i111 < _size107; ++_i111) + uint32_t _size118; + apache::thrift::protocol::TType _ktype119; + apache::thrift::protocol::TType _vtype120; + iprot->readMapBegin(_ktype119, _vtype120, _size118); + uint32_t _i122; + for (_i122 = 0; _i122 < _size118; ++_i122) { - std::string _key112; - xfer += iprot->readString(_key112); - Type& _val113 = (*(this->success))[_key112]; - xfer += _val113.read(iprot); + std::string _key123; + xfer += iprot->readString(_key123); + Type& _val124 = (*(this->success))[_key123]; + xfer += _val124.read(iprot); } iprot->readMapEnd(); } @@ -1682,14 +1952,14 @@ uint32_t ThriftHiveMetastore_get_fields_result::read(apache::thrift::protocol::T if (ftype == apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size114; - apache::thrift::protocol::TType _etype117; - iprot->readListBegin(_etype117, _size114); - this->success.resize(_size114); - uint32_t _i118; - for (_i118 = 0; _i118 < _size114; ++_i118) + uint32_t _size125; + apache::thrift::protocol::TType _etype128; + iprot->readListBegin(_etype128, _size125); + this->success.resize(_size125); + uint32_t _i129; + for (_i129 = 0; _i129 < _size125; ++_i129) { - xfer += this->success[_i118].read(iprot); + xfer += this->success[_i129].read(iprot); } iprot->readListEnd(); } @@ -1744,10 +2014,10 @@ uint32_t ThriftHiveMetastore_get_fields_result::write(apache::thrift::protocol:: xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter119; - for (_iter119 = this->success.begin(); _iter119 != this->success.end(); ++_iter119) + std::vector ::const_iterator _iter130; + for (_iter130 = this->success.begin(); _iter130 != this->success.end(); ++_iter130) { - xfer += (*_iter119).write(oprot); + xfer += (*_iter130).write(oprot); } xfer += oprot->writeListEnd(); } @@ -1794,14 +2064,14 @@ uint32_t ThriftHiveMetastore_get_fields_presult::read(apache::thrift::protocol:: if (ftype == apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size120; - apache::thrift::protocol::TType _etype123; - iprot->readListBegin(_etype123, _size120); - (*(this->success)).resize(_size120); - uint32_t _i124; - for (_i124 = 0; _i124 < _size120; ++_i124) + uint32_t _size131; + apache::thrift::protocol::TType _etype134; + iprot->readListBegin(_etype134, _size131); + (*(this->success)).resize(_size131); + uint32_t _i135; + for (_i135 = 0; _i135 < _size131; ++_i135) { - xfer += (*(this->success))[_i124].read(iprot); + xfer += (*(this->success))[_i135].read(iprot); } iprot->readListEnd(); } @@ -1946,14 +2216,14 @@ uint32_t ThriftHiveMetastore_get_schema_result::read(apache::thrift::protocol::T if (ftype == apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size125; - apache::thrift::protocol::TType _etype128; - iprot->readListBegin(_etype128, _size125); - this->success.resize(_size125); - uint32_t _i129; - for (_i129 = 0; _i129 < _size125; ++_i129) + uint32_t _size136; + apache::thrift::protocol::TType _etype139; + iprot->readListBegin(_etype139, _size136); + this->success.resize(_size136); + uint32_t _i140; + for (_i140 = 0; _i140 < _size136; ++_i140) { - xfer += this->success[_i129].read(iprot); + xfer += this->success[_i140].read(iprot); } iprot->readListEnd(); } @@ -2008,10 +2278,10 @@ uint32_t ThriftHiveMetastore_get_schema_result::write(apache::thrift::protocol:: xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter130; - for (_iter130 = this->success.begin(); _iter130 != this->success.end(); ++_iter130) + std::vector ::const_iterator _iter141; + for (_iter141 = this->success.begin(); _iter141 != this->success.end(); ++_iter141) { - xfer += (*_iter130).write(oprot); + xfer += (*_iter141).write(oprot); } xfer += oprot->writeListEnd(); } @@ -2058,14 +2328,14 @@ uint32_t ThriftHiveMetastore_get_schema_presult::read(apache::thrift::protocol:: if (ftype == apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size131; - apache::thrift::protocol::TType _etype134; - iprot->readListBegin(_etype134, _size131); - (*(this->success)).resize(_size131); - uint32_t _i135; - for (_i135 = 0; _i135 < _size131; ++_i135) + uint32_t _size142; + apache::thrift::protocol::TType _etype145; + iprot->readListBegin(_etype145, _size142); + (*(this->success)).resize(_size142); + uint32_t _i146; + for (_i146 = 0; _i146 < _size142; ++_i146) { - xfer += (*(this->success))[_i135].read(iprot); + xfer += (*(this->success))[_i146].read(iprot); } iprot->readListEnd(); } @@ -2582,35 +2852,245 @@ uint32_t ThriftHiveMetastore_get_tables_args::read(apache::thrift::protocol::TPr return xfer; } -uint32_t ThriftHiveMetastore_get_tables_args::write(apache::thrift::protocol::TProtocol* oprot) const { +uint32_t ThriftHiveMetastore_get_tables_args::write(apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_tables_args"); + xfer += oprot->writeFieldBegin("db_name", apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("pattern", apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->pattern); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_get_tables_pargs::write(apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_tables_pargs"); + xfer += oprot->writeFieldBegin("db_name", apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("pattern", apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->pattern))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_get_tables_result::read(apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size147; + apache::thrift::protocol::TType _etype150; + iprot->readListBegin(_etype150, _size147); + this->success.resize(_size147); + uint32_t _i151; + for (_i151 = 0; _i151 < _size147; ++_i151) + { + xfer += iprot->readString(this->success[_i151]); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_tables_result::write(apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_tables_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, this->success.size()); + std::vector ::const_iterator _iter152; + for (_iter152 = this->success.begin(); _iter152 != this->success.end(); ++_iter152) + { + xfer += oprot->writeString((*_iter152)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_get_tables_presult::read(apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size153; + apache::thrift::protocol::TType _etype156; + iprot->readListBegin(_etype156, _size153); + (*(this->success)).resize(_size153); + uint32_t _i157; + for (_i157 = 0; _i157 < _size153; ++_i157) + { + xfer += iprot->readString((*(this->success))[_i157]); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_tables_args::read(apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_tables_args::write(apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_tables_args"); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_tables_args"); xfer += oprot->writeFieldBegin("db_name", apache::thrift::protocol::T_STRING, 1); xfer += oprot->writeString(this->db_name); xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldBegin("pattern", apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->pattern); - xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; } -uint32_t ThriftHiveMetastore_get_tables_pargs::write(apache::thrift::protocol::TProtocol* oprot) const { +uint32_t ThriftHiveMetastore_get_all_tables_pargs::write(apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_tables_pargs"); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_tables_pargs"); xfer += oprot->writeFieldBegin("db_name", apache::thrift::protocol::T_STRING, 1); xfer += oprot->writeString((*(this->db_name))); xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldBegin("pattern", apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString((*(this->pattern))); - xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; } -uint32_t ThriftHiveMetastore_get_tables_result::read(apache::thrift::protocol::TProtocol* iprot) { +uint32_t ThriftHiveMetastore_get_all_tables_result::read(apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2634,14 +3114,14 @@ uint32_t ThriftHiveMetastore_get_tables_result::read(apache::thrift::protocol::T if (ftype == apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size136; - apache::thrift::protocol::TType _etype139; - iprot->readListBegin(_etype139, _size136); - this->success.resize(_size136); - uint32_t _i140; - for (_i140 = 0; _i140 < _size136; ++_i140) + uint32_t _size158; + apache::thrift::protocol::TType _etype161; + iprot->readListBegin(_etype161, _size158); + this->success.resize(_size158); + uint32_t _i162; + for (_i162 = 0; _i162 < _size158; ++_i162) { - xfer += iprot->readString(this->success[_i140]); + xfer += iprot->readString(this->success[_i162]); } iprot->readListEnd(); } @@ -2670,20 +3150,20 @@ uint32_t ThriftHiveMetastore_get_tables_result::read(apache::thrift::protocol::T return xfer; } -uint32_t ThriftHiveMetastore_get_tables_result::write(apache::thrift::protocol::TProtocol* oprot) const { +uint32_t ThriftHiveMetastore_get_all_tables_result::write(apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_tables_result"); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_tables_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, this->success.size()); - std::vector ::const_iterator _iter141; - for (_iter141 = this->success.begin(); _iter141 != this->success.end(); ++_iter141) + std::vector ::const_iterator _iter163; + for (_iter163 = this->success.begin(); _iter163 != this->success.end(); ++_iter163) { - xfer += oprot->writeString((*_iter141)); + xfer += oprot->writeString((*_iter163)); } xfer += oprot->writeListEnd(); } @@ -2698,7 +3178,7 @@ uint32_t ThriftHiveMetastore_get_tables_result::write(apache::thrift::protocol:: return xfer; } -uint32_t ThriftHiveMetastore_get_tables_presult::read(apache::thrift::protocol::TProtocol* iprot) { +uint32_t ThriftHiveMetastore_get_all_tables_presult::read(apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2722,14 +3202,14 @@ uint32_t ThriftHiveMetastore_get_tables_presult::read(apache::thrift::protocol:: if (ftype == apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size142; - apache::thrift::protocol::TType _etype145; - iprot->readListBegin(_etype145, _size142); - (*(this->success)).resize(_size142); - uint32_t _i146; - for (_i146 = 0; _i146 < _size142; ++_i146) + uint32_t _size164; + apache::thrift::protocol::TType _etype167; + iprot->readListBegin(_etype167, _size164); + (*(this->success)).resize(_size164); + uint32_t _i168; + for (_i168 = 0; _i168 < _size164; ++_i168) { - xfer += iprot->readString((*(this->success))[_i146]); + xfer += iprot->readString((*(this->success))[_i168]); } iprot->readListEnd(); } @@ -3434,14 +3914,14 @@ uint32_t ThriftHiveMetastore_append_partition_args::read(apache::thrift::protoco if (ftype == apache::thrift::protocol::T_LIST) { { this->part_vals.clear(); - uint32_t _size147; - apache::thrift::protocol::TType _etype150; - iprot->readListBegin(_etype150, _size147); - this->part_vals.resize(_size147); - uint32_t _i151; - for (_i151 = 0; _i151 < _size147; ++_i151) + uint32_t _size169; + apache::thrift::protocol::TType _etype172; + iprot->readListBegin(_etype172, _size169); + this->part_vals.resize(_size169); + uint32_t _i173; + for (_i173 = 0; _i173 < _size169; ++_i173) { - xfer += iprot->readString(this->part_vals[_i151]); + xfer += iprot->readString(this->part_vals[_i173]); } iprot->readListEnd(); } @@ -3474,10 +3954,10 @@ uint32_t ThriftHiveMetastore_append_partition_args::write(apache::thrift::protoc xfer += oprot->writeFieldBegin("part_vals", apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, this->part_vals.size()); - std::vector ::const_iterator _iter152; - for (_iter152 = this->part_vals.begin(); _iter152 != this->part_vals.end(); ++_iter152) + std::vector ::const_iterator _iter174; + for (_iter174 = this->part_vals.begin(); _iter174 != this->part_vals.end(); ++_iter174) { - xfer += oprot->writeString((*_iter152)); + xfer += oprot->writeString((*_iter174)); } xfer += oprot->writeListEnd(); } @@ -3499,10 +3979,10 @@ uint32_t ThriftHiveMetastore_append_partition_pargs::write(apache::thrift::proto xfer += oprot->writeFieldBegin("part_vals", apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, (*(this->part_vals)).size()); - std::vector ::const_iterator _iter153; - for (_iter153 = (*(this->part_vals)).begin(); _iter153 != (*(this->part_vals)).end(); ++_iter153) + std::vector ::const_iterator _iter175; + for (_iter175 = (*(this->part_vals)).begin(); _iter175 != (*(this->part_vals)).end(); ++_iter175) { - xfer += oprot->writeString((*_iter153)); + xfer += oprot->writeString((*_iter175)); } xfer += oprot->writeListEnd(); } @@ -3954,14 +4434,14 @@ uint32_t ThriftHiveMetastore_drop_partition_args::read(apache::thrift::protocol: if (ftype == apache::thrift::protocol::T_LIST) { { this->part_vals.clear(); - uint32_t _size154; - apache::thrift::protocol::TType _etype157; - iprot->readListBegin(_etype157, _size154); - this->part_vals.resize(_size154); - uint32_t _i158; - for (_i158 = 0; _i158 < _size154; ++_i158) + uint32_t _size176; + apache::thrift::protocol::TType _etype179; + iprot->readListBegin(_etype179, _size176); + this->part_vals.resize(_size176); + uint32_t _i180; + for (_i180 = 0; _i180 < _size176; ++_i180) { - xfer += iprot->readString(this->part_vals[_i158]); + xfer += iprot->readString(this->part_vals[_i180]); } iprot->readListEnd(); } @@ -4002,10 +4482,10 @@ uint32_t ThriftHiveMetastore_drop_partition_args::write(apache::thrift::protocol xfer += oprot->writeFieldBegin("part_vals", apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, this->part_vals.size()); - std::vector ::const_iterator _iter159; - for (_iter159 = this->part_vals.begin(); _iter159 != this->part_vals.end(); ++_iter159) + std::vector ::const_iterator _iter181; + for (_iter181 = this->part_vals.begin(); _iter181 != this->part_vals.end(); ++_iter181) { - xfer += oprot->writeString((*_iter159)); + xfer += oprot->writeString((*_iter181)); } xfer += oprot->writeListEnd(); } @@ -4030,10 +4510,10 @@ uint32_t ThriftHiveMetastore_drop_partition_pargs::write(apache::thrift::protoco xfer += oprot->writeFieldBegin("part_vals", apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, (*(this->part_vals)).size()); - std::vector ::const_iterator _iter160; - for (_iter160 = (*(this->part_vals)).begin(); _iter160 != (*(this->part_vals)).end(); ++_iter160) + std::vector ::const_iterator _iter182; + for (_iter182 = (*(this->part_vals)).begin(); _iter182 != (*(this->part_vals)).end(); ++_iter182) { - xfer += oprot->writeString((*_iter160)); + xfer += oprot->writeString((*_iter182)); } xfer += oprot->writeListEnd(); } @@ -4462,14 +4942,14 @@ uint32_t ThriftHiveMetastore_get_partition_args::read(apache::thrift::protocol:: if (ftype == apache::thrift::protocol::T_LIST) { { this->part_vals.clear(); - uint32_t _size161; - apache::thrift::protocol::TType _etype164; - iprot->readListBegin(_etype164, _size161); - this->part_vals.resize(_size161); - uint32_t _i165; - for (_i165 = 0; _i165 < _size161; ++_i165) + uint32_t _size183; + apache::thrift::protocol::TType _etype186; + iprot->readListBegin(_etype186, _size183); + this->part_vals.resize(_size183); + uint32_t _i187; + for (_i187 = 0; _i187 < _size183; ++_i187) { - xfer += iprot->readString(this->part_vals[_i165]); + xfer += iprot->readString(this->part_vals[_i187]); } iprot->readListEnd(); } @@ -4502,10 +4982,10 @@ uint32_t ThriftHiveMetastore_get_partition_args::write(apache::thrift::protocol: xfer += oprot->writeFieldBegin("part_vals", apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, this->part_vals.size()); - std::vector ::const_iterator _iter166; - for (_iter166 = this->part_vals.begin(); _iter166 != this->part_vals.end(); ++_iter166) + std::vector ::const_iterator _iter188; + for (_iter188 = this->part_vals.begin(); _iter188 != this->part_vals.end(); ++_iter188) { - xfer += oprot->writeString((*_iter166)); + xfer += oprot->writeString((*_iter188)); } xfer += oprot->writeListEnd(); } @@ -4527,10 +5007,10 @@ uint32_t ThriftHiveMetastore_get_partition_pargs::write(apache::thrift::protocol xfer += oprot->writeFieldBegin("part_vals", apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, (*(this->part_vals)).size()); - std::vector ::const_iterator _iter167; - for (_iter167 = (*(this->part_vals)).begin(); _iter167 != (*(this->part_vals)).end(); ++_iter167) + std::vector ::const_iterator _iter189; + for (_iter189 = (*(this->part_vals)).begin(); _iter189 != (*(this->part_vals)).end(); ++_iter189) { - xfer += oprot->writeString((*_iter167)); + xfer += oprot->writeString((*_iter189)); } xfer += oprot->writeListEnd(); } @@ -5016,14 +5496,14 @@ uint32_t ThriftHiveMetastore_get_partitions_result::read(apache::thrift::protoco if (ftype == apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size168; - apache::thrift::protocol::TType _etype171; - iprot->readListBegin(_etype171, _size168); - this->success.resize(_size168); - uint32_t _i172; - for (_i172 = 0; _i172 < _size168; ++_i172) + uint32_t _size190; + apache::thrift::protocol::TType _etype193; + iprot->readListBegin(_etype193, _size190); + this->success.resize(_size190); + uint32_t _i194; + for (_i194 = 0; _i194 < _size190; ++_i194) { - xfer += this->success[_i172].read(iprot); + xfer += this->success[_i194].read(iprot); } iprot->readListEnd(); } @@ -5070,10 +5550,10 @@ uint32_t ThriftHiveMetastore_get_partitions_result::write(apache::thrift::protoc xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter173; - for (_iter173 = this->success.begin(); _iter173 != this->success.end(); ++_iter173) + std::vector ::const_iterator _iter195; + for (_iter195 = this->success.begin(); _iter195 != this->success.end(); ++_iter195) { - xfer += (*_iter173).write(oprot); + xfer += (*_iter195).write(oprot); } xfer += oprot->writeListEnd(); } @@ -5116,14 +5596,14 @@ uint32_t ThriftHiveMetastore_get_partitions_presult::read(apache::thrift::protoc if (ftype == apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size174; - apache::thrift::protocol::TType _etype177; - iprot->readListBegin(_etype177, _size174); - (*(this->success)).resize(_size174); - uint32_t _i178; - for (_i178 = 0; _i178 < _size174; ++_i178) + uint32_t _size196; + apache::thrift::protocol::TType _etype199; + iprot->readListBegin(_etype199, _size196); + (*(this->success)).resize(_size196); + uint32_t _i200; + for (_i200 = 0; _i200 < _size196; ++_i200) { - xfer += (*(this->success))[_i178].read(iprot); + xfer += (*(this->success))[_i200].read(iprot); } iprot->readListEnd(); } @@ -5274,14 +5754,14 @@ uint32_t ThriftHiveMetastore_get_partition_names_result::read(apache::thrift::pr if (ftype == apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size179; - apache::thrift::protocol::TType _etype182; - iprot->readListBegin(_etype182, _size179); - this->success.resize(_size179); - uint32_t _i183; - for (_i183 = 0; _i183 < _size179; ++_i183) + uint32_t _size201; + apache::thrift::protocol::TType _etype204; + iprot->readListBegin(_etype204, _size201); + this->success.resize(_size201); + uint32_t _i205; + for (_i205 = 0; _i205 < _size201; ++_i205) { - xfer += iprot->readString(this->success[_i183]); + xfer += iprot->readString(this->success[_i205]); } iprot->readListEnd(); } @@ -5320,10 +5800,10 @@ uint32_t ThriftHiveMetastore_get_partition_names_result::write(apache::thrift::p xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, this->success.size()); - std::vector ::const_iterator _iter184; - for (_iter184 = this->success.begin(); _iter184 != this->success.end(); ++_iter184) + std::vector ::const_iterator _iter206; + for (_iter206 = this->success.begin(); _iter206 != this->success.end(); ++_iter206) { - xfer += oprot->writeString((*_iter184)); + xfer += oprot->writeString((*_iter206)); } xfer += oprot->writeListEnd(); } @@ -5362,14 +5842,14 @@ uint32_t ThriftHiveMetastore_get_partition_names_presult::read(apache::thrift::p if (ftype == apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size185; - apache::thrift::protocol::TType _etype188; - iprot->readListBegin(_etype188, _size185); - (*(this->success)).resize(_size185); - uint32_t _i189; - for (_i189 = 0; _i189 < _size185; ++_i189) + uint32_t _size207; + apache::thrift::protocol::TType _etype210; + iprot->readListBegin(_etype210, _size207); + (*(this->success)).resize(_size207); + uint32_t _i211; + for (_i211 = 0; _i211 < _size207; ++_i211) { - xfer += iprot->readString((*(this->success))[_i189]); + xfer += iprot->readString((*(this->success))[_i211]); } iprot->readListEnd(); } @@ -5438,14 +5918,14 @@ uint32_t ThriftHiveMetastore_get_partitions_ps_args::read(apache::thrift::protoc if (ftype == apache::thrift::protocol::T_LIST) { { this->part_vals.clear(); - uint32_t _size190; - apache::thrift::protocol::TType _etype193; - iprot->readListBegin(_etype193, _size190); - this->part_vals.resize(_size190); - uint32_t _i194; - for (_i194 = 0; _i194 < _size190; ++_i194) + uint32_t _size212; + apache::thrift::protocol::TType _etype215; + iprot->readListBegin(_etype215, _size212); + this->part_vals.resize(_size212); + uint32_t _i216; + for (_i216 = 0; _i216 < _size212; ++_i216) { - xfer += iprot->readString(this->part_vals[_i194]); + xfer += iprot->readString(this->part_vals[_i216]); } iprot->readListEnd(); } @@ -5486,10 +5966,10 @@ uint32_t ThriftHiveMetastore_get_partitions_ps_args::write(apache::thrift::proto xfer += oprot->writeFieldBegin("part_vals", apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, this->part_vals.size()); - std::vector ::const_iterator _iter195; - for (_iter195 = this->part_vals.begin(); _iter195 != this->part_vals.end(); ++_iter195) + std::vector ::const_iterator _iter217; + for (_iter217 = this->part_vals.begin(); _iter217 != this->part_vals.end(); ++_iter217) { - xfer += oprot->writeString((*_iter195)); + xfer += oprot->writeString((*_iter217)); } xfer += oprot->writeListEnd(); } @@ -5514,10 +5994,10 @@ uint32_t ThriftHiveMetastore_get_partitions_ps_pargs::write(apache::thrift::prot xfer += oprot->writeFieldBegin("part_vals", apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, (*(this->part_vals)).size()); - std::vector ::const_iterator _iter196; - for (_iter196 = (*(this->part_vals)).begin(); _iter196 != (*(this->part_vals)).end(); ++_iter196) + std::vector ::const_iterator _iter218; + for (_iter218 = (*(this->part_vals)).begin(); _iter218 != (*(this->part_vals)).end(); ++_iter218) { - xfer += oprot->writeString((*_iter196)); + xfer += oprot->writeString((*_iter218)); } xfer += oprot->writeListEnd(); } @@ -5554,14 +6034,14 @@ uint32_t ThriftHiveMetastore_get_partitions_ps_result::read(apache::thrift::prot if (ftype == apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size197; - apache::thrift::protocol::TType _etype200; - iprot->readListBegin(_etype200, _size197); - this->success.resize(_size197); - uint32_t _i201; - for (_i201 = 0; _i201 < _size197; ++_i201) + uint32_t _size219; + apache::thrift::protocol::TType _etype222; + iprot->readListBegin(_etype222, _size219); + this->success.resize(_size219); + uint32_t _i223; + for (_i223 = 0; _i223 < _size219; ++_i223) { - xfer += this->success[_i201].read(iprot); + xfer += this->success[_i223].read(iprot); } iprot->readListEnd(); } @@ -5600,10 +6080,10 @@ uint32_t ThriftHiveMetastore_get_partitions_ps_result::write(apache::thrift::pro xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter202; - for (_iter202 = this->success.begin(); _iter202 != this->success.end(); ++_iter202) + std::vector ::const_iterator _iter224; + for (_iter224 = this->success.begin(); _iter224 != this->success.end(); ++_iter224) { - xfer += (*_iter202).write(oprot); + xfer += (*_iter224).write(oprot); } xfer += oprot->writeListEnd(); } @@ -5642,14 +6122,14 @@ uint32_t ThriftHiveMetastore_get_partitions_ps_presult::read(apache::thrift::pro if (ftype == apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size203; - apache::thrift::protocol::TType _etype206; - iprot->readListBegin(_etype206, _size203); - (*(this->success)).resize(_size203); - uint32_t _i207; - for (_i207 = 0; _i207 < _size203; ++_i207) + uint32_t _size225; + apache::thrift::protocol::TType _etype228; + iprot->readListBegin(_etype228, _size225); + (*(this->success)).resize(_size225); + uint32_t _i229; + for (_i229 = 0; _i229 < _size225; ++_i229) { - xfer += (*(this->success))[_i207].read(iprot); + xfer += (*(this->success))[_i229].read(iprot); } iprot->readListEnd(); } @@ -5718,14 +6198,14 @@ uint32_t ThriftHiveMetastore_get_partition_names_ps_args::read(apache::thrift::p if (ftype == apache::thrift::protocol::T_LIST) { { this->part_vals.clear(); - uint32_t _size208; - apache::thrift::protocol::TType _etype211; - iprot->readListBegin(_etype211, _size208); - this->part_vals.resize(_size208); - uint32_t _i212; - for (_i212 = 0; _i212 < _size208; ++_i212) + uint32_t _size230; + apache::thrift::protocol::TType _etype233; + iprot->readListBegin(_etype233, _size230); + this->part_vals.resize(_size230); + uint32_t _i234; + for (_i234 = 0; _i234 < _size230; ++_i234) { - xfer += iprot->readString(this->part_vals[_i212]); + xfer += iprot->readString(this->part_vals[_i234]); } iprot->readListEnd(); } @@ -5766,10 +6246,10 @@ uint32_t ThriftHiveMetastore_get_partition_names_ps_args::write(apache::thrift:: xfer += oprot->writeFieldBegin("part_vals", apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, this->part_vals.size()); - std::vector ::const_iterator _iter213; - for (_iter213 = this->part_vals.begin(); _iter213 != this->part_vals.end(); ++_iter213) + std::vector ::const_iterator _iter235; + for (_iter235 = this->part_vals.begin(); _iter235 != this->part_vals.end(); ++_iter235) { - xfer += oprot->writeString((*_iter213)); + xfer += oprot->writeString((*_iter235)); } xfer += oprot->writeListEnd(); } @@ -5794,10 +6274,10 @@ uint32_t ThriftHiveMetastore_get_partition_names_ps_pargs::write(apache::thrift: xfer += oprot->writeFieldBegin("part_vals", apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, (*(this->part_vals)).size()); - std::vector ::const_iterator _iter214; - for (_iter214 = (*(this->part_vals)).begin(); _iter214 != (*(this->part_vals)).end(); ++_iter214) + std::vector ::const_iterator _iter236; + for (_iter236 = (*(this->part_vals)).begin(); _iter236 != (*(this->part_vals)).end(); ++_iter236) { - xfer += oprot->writeString((*_iter214)); + xfer += oprot->writeString((*_iter236)); } xfer += oprot->writeListEnd(); } @@ -5834,14 +6314,14 @@ uint32_t ThriftHiveMetastore_get_partition_names_ps_result::read(apache::thrift: if (ftype == apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size215; - apache::thrift::protocol::TType _etype218; - iprot->readListBegin(_etype218, _size215); - this->success.resize(_size215); - uint32_t _i219; - for (_i219 = 0; _i219 < _size215; ++_i219) + uint32_t _size237; + apache::thrift::protocol::TType _etype240; + iprot->readListBegin(_etype240, _size237); + this->success.resize(_size237); + uint32_t _i241; + for (_i241 = 0; _i241 < _size237; ++_i241) { - xfer += iprot->readString(this->success[_i219]); + xfer += iprot->readString(this->success[_i241]); } iprot->readListEnd(); } @@ -5880,10 +6360,10 @@ uint32_t ThriftHiveMetastore_get_partition_names_ps_result::write(apache::thrift xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, this->success.size()); - std::vector ::const_iterator _iter220; - for (_iter220 = this->success.begin(); _iter220 != this->success.end(); ++_iter220) + std::vector ::const_iterator _iter242; + for (_iter242 = this->success.begin(); _iter242 != this->success.end(); ++_iter242) { - xfer += oprot->writeString((*_iter220)); + xfer += oprot->writeString((*_iter242)); } xfer += oprot->writeListEnd(); } @@ -5922,14 +6402,14 @@ uint32_t ThriftHiveMetastore_get_partition_names_ps_presult::read(apache::thrift if (ftype == apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size221; - apache::thrift::protocol::TType _etype224; - iprot->readListBegin(_etype224, _size221); - (*(this->success)).resize(_size221); - uint32_t _i225; - for (_i225 = 0; _i225 < _size221; ++_i225) + uint32_t _size243; + apache::thrift::protocol::TType _etype246; + iprot->readListBegin(_etype246, _size243); + (*(this->success)).resize(_size243); + uint32_t _i247; + for (_i247 = 0; _i247 < _size243; ++_i247) { - xfer += iprot->readString((*(this->success))[_i225]); + xfer += iprot->readString((*(this->success))[_i247]); } iprot->readListEnd(); } @@ -6442,14 +6922,14 @@ uint32_t ThriftHiveMetastore_partition_name_to_vals_result::read(apache::thrift: if (ftype == apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size226; - apache::thrift::protocol::TType _etype229; - iprot->readListBegin(_etype229, _size226); - this->success.resize(_size226); - uint32_t _i230; - for (_i230 = 0; _i230 < _size226; ++_i230) + uint32_t _size248; + apache::thrift::protocol::TType _etype251; + iprot->readListBegin(_etype251, _size248); + this->success.resize(_size248); + uint32_t _i252; + for (_i252 = 0; _i252 < _size248; ++_i252) { - xfer += iprot->readString(this->success[_i230]); + xfer += iprot->readString(this->success[_i252]); } iprot->readListEnd(); } @@ -6488,10 +6968,10 @@ uint32_t ThriftHiveMetastore_partition_name_to_vals_result::write(apache::thrift xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRING, this->success.size()); - std::vector ::const_iterator _iter231; - for (_iter231 = this->success.begin(); _iter231 != this->success.end(); ++_iter231) + std::vector ::const_iterator _iter253; + for (_iter253 = this->success.begin(); _iter253 != this->success.end(); ++_iter253) { - xfer += oprot->writeString((*_iter231)); + xfer += oprot->writeString((*_iter253)); } xfer += oprot->writeListEnd(); } @@ -6530,14 +7010,14 @@ uint32_t ThriftHiveMetastore_partition_name_to_vals_presult::read(apache::thrift if (ftype == apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size232; - apache::thrift::protocol::TType _etype235; - iprot->readListBegin(_etype235, _size232); - (*(this->success)).resize(_size232); - uint32_t _i236; - for (_i236 = 0; _i236 < _size232; ++_i236) + uint32_t _size254; + apache::thrift::protocol::TType _etype257; + iprot->readListBegin(_etype257, _size254); + (*(this->success)).resize(_size254); + uint32_t _i258; + for (_i258 = 0; _i258 < _size254; ++_i258) { - xfer += iprot->readString((*(this->success))[_i236]); + xfer += iprot->readString((*(this->success))[_i258]); } iprot->readListEnd(); } @@ -6652,17 +7132,17 @@ uint32_t ThriftHiveMetastore_partition_name_to_spec_result::read(apache::thrift: if (ftype == apache::thrift::protocol::T_MAP) { { this->success.clear(); - uint32_t _size237; - apache::thrift::protocol::TType _ktype238; - apache::thrift::protocol::TType _vtype239; - iprot->readMapBegin(_ktype238, _vtype239, _size237); - uint32_t _i241; - for (_i241 = 0; _i241 < _size237; ++_i241) + uint32_t _size259; + apache::thrift::protocol::TType _ktype260; + apache::thrift::protocol::TType _vtype261; + iprot->readMapBegin(_ktype260, _vtype261, _size259); + uint32_t _i263; + for (_i263 = 0; _i263 < _size259; ++_i263) { - std::string _key242; - xfer += iprot->readString(_key242); - std::string& _val243 = this->success[_key242]; - xfer += iprot->readString(_val243); + std::string _key264; + xfer += iprot->readString(_key264); + std::string& _val265 = this->success[_key264]; + xfer += iprot->readString(_val265); } iprot->readMapEnd(); } @@ -6701,11 +7181,11 @@ uint32_t ThriftHiveMetastore_partition_name_to_spec_result::write(apache::thrift xfer += oprot->writeFieldBegin("success", apache::thrift::protocol::T_MAP, 0); { xfer += oprot->writeMapBegin(apache::thrift::protocol::T_STRING, apache::thrift::protocol::T_STRING, this->success.size()); - std::map ::const_iterator _iter244; - for (_iter244 = this->success.begin(); _iter244 != this->success.end(); ++_iter244) + std::map ::const_iterator _iter266; + for (_iter266 = this->success.begin(); _iter266 != this->success.end(); ++_iter266) { - xfer += oprot->writeString(_iter244->first); - xfer += oprot->writeString(_iter244->second); + xfer += oprot->writeString(_iter266->first); + xfer += oprot->writeString(_iter266->second); } xfer += oprot->writeMapEnd(); } @@ -6744,17 +7224,17 @@ uint32_t ThriftHiveMetastore_partition_name_to_spec_presult::read(apache::thrift if (ftype == apache::thrift::protocol::T_MAP) { { (*(this->success)).clear(); - uint32_t _size245; - apache::thrift::protocol::TType _ktype246; - apache::thrift::protocol::TType _vtype247; - iprot->readMapBegin(_ktype246, _vtype247, _size245); - uint32_t _i249; - for (_i249 = 0; _i249 < _size245; ++_i249) + uint32_t _size267; + apache::thrift::protocol::TType _ktype268; + apache::thrift::protocol::TType _vtype269; + iprot->readMapBegin(_ktype268, _vtype269, _size267); + uint32_t _i271; + for (_i271 = 0; _i271 < _size267; ++_i271) { - std::string _key250; - xfer += iprot->readString(_key250); - std::string& _val251 = (*(this->success))[_key250]; - xfer += iprot->readString(_val251); + std::string _key272; + xfer += iprot->readString(_key272); + std::string& _val273 = (*(this->success))[_key272]; + xfer += iprot->readString(_val273); } iprot->readMapEnd(); } @@ -6783,20 +7263,19 @@ uint32_t ThriftHiveMetastore_partition_name_to_spec_presult::read(apache::thrift return xfer; } -bool ThriftHiveMetastoreClient::create_database(const std::string& name, const std::string& description) +void ThriftHiveMetastoreClient::create_database(const Database& database) { - send_create_database(name, description); - return recv_create_database(); + send_create_database(database); + recv_create_database(); } -void ThriftHiveMetastoreClient::send_create_database(const std::string& name, const std::string& description) +void ThriftHiveMetastoreClient::send_create_database(const Database& database) { int32_t cseqid = 0; oprot_->writeMessageBegin("create_database", apache::thrift::protocol::T_CALL, cseqid); ThriftHiveMetastore_create_database_pargs args; - args.name = &name; - args.description = &description; + args.database = &database; args.write(oprot_); oprot_->writeMessageEnd(); @@ -6804,7 +7283,7 @@ void ThriftHiveMetastoreClient::send_create_database(const std::string& name, co oprot_->getTransport()->writeEnd(); } -bool ThriftHiveMetastoreClient::recv_create_database() +void ThriftHiveMetastoreClient::recv_create_database() { int32_t rseqid = 0; @@ -6831,23 +7310,21 @@ bool ThriftHiveMetastoreClient::recv_create_database() iprot_->getTransport()->readEnd(); throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - bool _return; ThriftHiveMetastore_create_database_presult result; - result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - if (result.__isset.success) { - return _return; - } if (result.__isset.o1) { throw result.o1; } if (result.__isset.o2) { throw result.o2; } - throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::MISSING_RESULT, "create_database failed: unknown result"); + if (result.__isset.o3) { + throw result.o3; + } + return; } void ThriftHiveMetastoreClient::get_database(Database& _return, const std::string& name) @@ -6916,19 +7393,20 @@ void ThriftHiveMetastoreClient::recv_get_database(Database& _return) throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::MISSING_RESULT, "get_database failed: unknown result"); } -bool ThriftHiveMetastoreClient::drop_database(const std::string& name) +void ThriftHiveMetastoreClient::drop_database(const std::string& name, const bool deleteData) { - send_drop_database(name); - return recv_drop_database(); + send_drop_database(name, deleteData); + recv_drop_database(); } -void ThriftHiveMetastoreClient::send_drop_database(const std::string& name) +void ThriftHiveMetastoreClient::send_drop_database(const std::string& name, const bool deleteData) { int32_t cseqid = 0; oprot_->writeMessageBegin("drop_database", apache::thrift::protocol::T_CALL, cseqid); ThriftHiveMetastore_drop_database_pargs args; args.name = &name; + args.deleteData = &deleteData; args.write(oprot_); oprot_->writeMessageEnd(); @@ -6936,7 +7414,7 @@ void ThriftHiveMetastoreClient::send_drop_database(const std::string& name) oprot_->getTransport()->writeEnd(); } -bool ThriftHiveMetastoreClient::recv_drop_database() +void ThriftHiveMetastoreClient::recv_drop_database() { int32_t rseqid = 0; @@ -6963,34 +7441,36 @@ bool ThriftHiveMetastoreClient::recv_drop_database() iprot_->getTransport()->readEnd(); throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - bool _return; ThriftHiveMetastore_drop_database_presult result; - result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - if (result.__isset.success) { - return _return; + if (result.__isset.o1) { + throw result.o1; } if (result.__isset.o2) { throw result.o2; } - throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::MISSING_RESULT, "drop_database failed: unknown result"); + if (result.__isset.o3) { + throw result.o3; + } + return; } -void ThriftHiveMetastoreClient::get_databases(std::vector & _return) +void ThriftHiveMetastoreClient::get_databases(std::vector & _return, const std::string& pattern) { - send_get_databases(); + send_get_databases(pattern); recv_get_databases(_return); } -void ThriftHiveMetastoreClient::send_get_databases() +void ThriftHiveMetastoreClient::send_get_databases(const std::string& pattern) { int32_t cseqid = 0; oprot_->writeMessageBegin("get_databases", apache::thrift::protocol::T_CALL, cseqid); ThriftHiveMetastore_get_databases_pargs args; + args.pattern = &pattern; args.write(oprot_); oprot_->writeMessageEnd(); @@ -7041,6 +7521,68 @@ void ThriftHiveMetastoreClient::recv_get_databases(std::vector & _r throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::MISSING_RESULT, "get_databases failed: unknown result"); } +void ThriftHiveMetastoreClient::get_all_databases(std::vector & _return) +{ + send_get_all_databases(); + recv_get_all_databases(_return); +} + +void ThriftHiveMetastoreClient::send_get_all_databases() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_all_databases", apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_databases_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->flush(); + oprot_->getTransport()->writeEnd(); +} + +void ThriftHiveMetastoreClient::recv_get_all_databases(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == apache::thrift::protocol::T_EXCEPTION) { + apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != apache::thrift::protocol::T_REPLY) { + iprot_->skip(apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); + } + if (fname.compare("get_all_databases") != 0) { + iprot_->skip(apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::WRONG_METHOD_NAME); + } + ThriftHiveMetastore_get_all_databases_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::MISSING_RESULT, "get_all_databases failed: unknown result"); +} + void ThriftHiveMetastoreClient::get_type(Type& _return, const std::string& name) { send_get_type(name); @@ -7098,6 +7640,9 @@ void ThriftHiveMetastoreClient::recv_get_type(Type& _return) // _return pointer has now been filled return; } + if (result.__isset.o1) { + throw result.o1; + } if (result.__isset.o2) { throw result.o2; } @@ -7230,6 +7775,9 @@ bool ThriftHiveMetastoreClient::recv_drop_type() if (result.__isset.success) { return _return; } + if (result.__isset.o1) { + throw result.o1; + } if (result.__isset.o2) { throw result.o2; } @@ -7633,6 +8181,69 @@ void ThriftHiveMetastoreClient::recv_get_tables(std::vector & _retu throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::MISSING_RESULT, "get_tables failed: unknown result"); } +void ThriftHiveMetastoreClient::get_all_tables(std::vector & _return, const std::string& db_name) +{ + send_get_all_tables(db_name); + recv_get_all_tables(_return); +} + +void ThriftHiveMetastoreClient::send_get_all_tables(const std::string& db_name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_all_tables", apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_tables_pargs args; + args.db_name = &db_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->flush(); + oprot_->getTransport()->writeEnd(); +} + +void ThriftHiveMetastoreClient::recv_get_all_tables(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == apache::thrift::protocol::T_EXCEPTION) { + apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != apache::thrift::protocol::T_REPLY) { + iprot_->skip(apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); + } + if (fname.compare("get_all_tables") != 0) { + iprot_->skip(apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::WRONG_METHOD_NAME); + } + ThriftHiveMetastore_get_all_tables_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::MISSING_RESULT, "get_all_tables failed: unknown result"); +} + void ThriftHiveMetastoreClient::get_table(Table& _return, const std::string& dbname, const std::string& tbl_name) { send_get_table(dbname, tbl_name); @@ -8811,14 +9422,16 @@ void ThriftHiveMetastoreProcessor::process_create_database(int32_t seqid, apache ThriftHiveMetastore_create_database_result result; try { - result.success = iface_->create_database(args.name, args.description); - result.__isset.success = true; + iface_->create_database(args.database); } catch (AlreadyExistsException &o1) { result.o1 = o1; result.__isset.o1 = true; - } catch (MetaException &o2) { + } catch (InvalidObjectException &o2) { result.o2 = o2; result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = o3; + result.__isset.o3 = true; } catch (const std::exception& e) { apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("create_database", apache::thrift::protocol::T_EXCEPTION, seqid); @@ -8879,11 +9492,16 @@ void ThriftHiveMetastoreProcessor::process_drop_database(int32_t seqid, apache:: ThriftHiveMetastore_drop_database_result result; try { - result.success = iface_->drop_database(args.name); - result.__isset.success = true; - } catch (MetaException &o2) { + iface_->drop_database(args.name, args.deleteData); + } catch (NoSuchObjectException &o1) { + result.o1 = o1; + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { result.o2 = o2; result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = o3; + result.__isset.o3 = true; } catch (const std::exception& e) { apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("drop_database", apache::thrift::protocol::T_EXCEPTION, seqid); @@ -8910,7 +9528,7 @@ void ThriftHiveMetastoreProcessor::process_get_databases(int32_t seqid, apache:: ThriftHiveMetastore_get_databases_result result; try { - iface_->get_databases(result.success); + iface_->get_databases(result.success, args.pattern); result.__isset.success = true; } catch (MetaException &o1) { result.o1 = o1; @@ -8932,6 +9550,37 @@ void ThriftHiveMetastoreProcessor::process_get_databases(int32_t seqid, apache:: oprot->getTransport()->writeEnd(); } +void ThriftHiveMetastoreProcessor::process_get_all_databases(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot) +{ + ThriftHiveMetastore_get_all_databases_args args; + args.read(iprot); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + + ThriftHiveMetastore_get_all_databases_result result; + try { + iface_->get_all_databases(result.success); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = o1; + result.__isset.o1 = true; + } catch (const std::exception& e) { + apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_all_databases", apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); + return; + } + + oprot->writeMessageBegin("get_all_databases", apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); +} + void ThriftHiveMetastoreProcessor::process_get_type(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot) { ThriftHiveMetastore_get_type_args args; @@ -8943,7 +9592,10 @@ void ThriftHiveMetastoreProcessor::process_get_type(int32_t seqid, apache::thrif try { iface_->get_type(result.success, args.name); result.__isset.success = true; - } catch (MetaException &o2) { + } catch (MetaException &o1) { + result.o1 = o1; + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { result.o2 = o2; result.__isset.o2 = true; } catch (const std::exception& e) { @@ -9011,7 +9663,10 @@ void ThriftHiveMetastoreProcessor::process_drop_type(int32_t seqid, apache::thri try { result.success = iface_->drop_type(args.type); result.__isset.success = true; - } catch (MetaException &o2) { + } catch (MetaException &o1) { + result.o1 = o1; + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { result.o2 = o2; result.__isset.o2 = true; } catch (const std::exception& e) { @@ -9239,6 +9894,37 @@ void ThriftHiveMetastoreProcessor::process_get_tables(int32_t seqid, apache::thr oprot->getTransport()->writeEnd(); } +void ThriftHiveMetastoreProcessor::process_get_all_tables(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot) +{ + ThriftHiveMetastore_get_all_tables_args args; + args.read(iprot); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + + ThriftHiveMetastore_get_all_tables_result result; + try { + iface_->get_all_tables(result.success, args.db_name); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = o1; + result.__isset.o1 = true; + } catch (const std::exception& e) { + apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_all_tables", apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); + return; + } + + oprot->writeMessageBegin("get_all_tables", apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); +} + void ThriftHiveMetastoreProcessor::process_get_table(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot) { ThriftHiveMetastore_get_table_args args; diff --git metastore/src/gen-cpp/ThriftHiveMetastore.h metastore/src/gen-cpp/ThriftHiveMetastore.h index aae1c2e..1b7cbdc 100644 --- metastore/src/gen-cpp/ThriftHiveMetastore.h +++ metastore/src/gen-cpp/ThriftHiveMetastore.h @@ -15,10 +15,11 @@ namespace Apache { namespace Hadoop { namespace Hive { class ThriftHiveMetastoreIf : virtual public facebook::fb303::FacebookServiceIf { public: virtual ~ThriftHiveMetastoreIf() {} - virtual bool create_database(const std::string& name, const std::string& description) = 0; + virtual void create_database(const Database& database) = 0; virtual void get_database(Database& _return, const std::string& name) = 0; - virtual bool drop_database(const std::string& name) = 0; - virtual void get_databases(std::vector & _return) = 0; + virtual void drop_database(const std::string& name, const bool deleteData) = 0; + virtual void get_databases(std::vector & _return, const std::string& pattern) = 0; + virtual void get_all_databases(std::vector & _return) = 0; virtual void get_type(Type& _return, const std::string& name) = 0; virtual bool create_type(const Type& type) = 0; virtual bool drop_type(const std::string& type) = 0; @@ -28,6 +29,7 @@ class ThriftHiveMetastoreIf : virtual public facebook::fb303::FacebookServiceIf virtual void create_table(const Table& tbl) = 0; virtual void drop_table(const std::string& dbname, const std::string& name, const bool deleteData) = 0; virtual void get_tables(std::vector & _return, const std::string& db_name, const std::string& pattern) = 0; + virtual void get_all_tables(std::vector & _return, const std::string& db_name) = 0; virtual void get_table(Table& _return, const std::string& dbname, const std::string& tbl_name) = 0; virtual void alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl) = 0; virtual void add_partition(Partition& _return, const Partition& new_part) = 0; @@ -50,18 +52,19 @@ class ThriftHiveMetastoreIf : virtual public facebook::fb303::FacebookServiceIf class ThriftHiveMetastoreNull : virtual public ThriftHiveMetastoreIf , virtual public facebook::fb303::FacebookServiceNull { public: virtual ~ThriftHiveMetastoreNull() {} - bool create_database(const std::string& /* name */, const std::string& /* description */) { - bool _return = false; - return _return; + void create_database(const Database& /* database */) { + return; } void get_database(Database& /* _return */, const std::string& /* name */) { return; } - bool drop_database(const std::string& /* name */) { - bool _return = false; - return _return; + void drop_database(const std::string& /* name */, const bool /* deleteData */) { + return; + } + void get_databases(std::vector & /* _return */, const std::string& /* pattern */) { + return; } - void get_databases(std::vector & /* _return */) { + void get_all_databases(std::vector & /* _return */) { return; } void get_type(Type& /* _return */, const std::string& /* name */) { @@ -93,6 +96,9 @@ class ThriftHiveMetastoreNull : virtual public ThriftHiveMetastoreIf , virtual p void get_tables(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* pattern */) { return; } + void get_all_tables(std::vector & /* _return */, const std::string& /* db_name */) { + return; + } void get_table(Table& /* _return */, const std::string& /* dbname */, const std::string& /* tbl_name */) { return; } @@ -151,25 +157,21 @@ class ThriftHiveMetastoreNull : virtual public ThriftHiveMetastoreIf , virtual p class ThriftHiveMetastore_create_database_args { public: - ThriftHiveMetastore_create_database_args() : name(""), description("") { + ThriftHiveMetastore_create_database_args() { } virtual ~ThriftHiveMetastore_create_database_args() throw() {} - std::string name; - std::string description; + Database database; struct __isset { - __isset() : name(false), description(false) {} - bool name; - bool description; + __isset() : database(false) {} + bool database; } __isset; bool operator == (const ThriftHiveMetastore_create_database_args & rhs) const { - if (!(name == rhs.name)) - return false; - if (!(description == rhs.description)) + if (!(database == rhs.database)) return false; return true; } @@ -190,8 +192,7 @@ class ThriftHiveMetastore_create_database_pargs { virtual ~ThriftHiveMetastore_create_database_pargs() throw() {} - const std::string* name; - const std::string* description; + const Database* database; uint32_t write(apache::thrift::protocol::TProtocol* oprot) const; @@ -200,30 +201,30 @@ class ThriftHiveMetastore_create_database_pargs { class ThriftHiveMetastore_create_database_result { public: - ThriftHiveMetastore_create_database_result() : success(0) { + ThriftHiveMetastore_create_database_result() { } virtual ~ThriftHiveMetastore_create_database_result() throw() {} - bool success; AlreadyExistsException o1; - MetaException o2; + InvalidObjectException o2; + MetaException o3; struct __isset { - __isset() : success(false), o1(false), o2(false) {} - bool success; + __isset() : o1(false), o2(false), o3(false) {} bool o1; bool o2; + bool o3; } __isset; bool operator == (const ThriftHiveMetastore_create_database_result & rhs) const { - if (!(success == rhs.success)) - return false; if (!(o1 == rhs.o1)) return false; if (!(o2 == rhs.o2)) return false; + if (!(o3 == rhs.o3)) + return false; return true; } bool operator != (const ThriftHiveMetastore_create_database_result &rhs) const { @@ -243,15 +244,15 @@ class ThriftHiveMetastore_create_database_presult { virtual ~ThriftHiveMetastore_create_database_presult() throw() {} - bool* success; AlreadyExistsException o1; - MetaException o2; + InvalidObjectException o2; + MetaException o3; struct __isset { - __isset() : success(false), o1(false), o2(false) {} - bool success; + __isset() : o1(false), o2(false), o3(false) {} bool o1; bool o2; + bool o3; } __isset; uint32_t read(apache::thrift::protocol::TProtocol* iprot); @@ -366,22 +367,26 @@ class ThriftHiveMetastore_get_database_presult { class ThriftHiveMetastore_drop_database_args { public: - ThriftHiveMetastore_drop_database_args() : name("") { + ThriftHiveMetastore_drop_database_args() : name(""), deleteData(0) { } virtual ~ThriftHiveMetastore_drop_database_args() throw() {} std::string name; + bool deleteData; struct __isset { - __isset() : name(false) {} + __isset() : name(false), deleteData(false) {} bool name; + bool deleteData; } __isset; bool operator == (const ThriftHiveMetastore_drop_database_args & rhs) const { if (!(name == rhs.name)) return false; + if (!(deleteData == rhs.deleteData)) + return false; return true; } bool operator != (const ThriftHiveMetastore_drop_database_args &rhs) const { @@ -402,6 +407,7 @@ class ThriftHiveMetastore_drop_database_pargs { virtual ~ThriftHiveMetastore_drop_database_pargs() throw() {} const std::string* name; + const bool* deleteData; uint32_t write(apache::thrift::protocol::TProtocol* oprot) const; @@ -410,26 +416,30 @@ class ThriftHiveMetastore_drop_database_pargs { class ThriftHiveMetastore_drop_database_result { public: - ThriftHiveMetastore_drop_database_result() : success(0) { + ThriftHiveMetastore_drop_database_result() { } virtual ~ThriftHiveMetastore_drop_database_result() throw() {} - bool success; - MetaException o2; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; struct __isset { - __isset() : success(false), o2(false) {} - bool success; + __isset() : o1(false), o2(false), o3(false) {} + bool o1; bool o2; + bool o3; } __isset; bool operator == (const ThriftHiveMetastore_drop_database_result & rhs) const { - if (!(success == rhs.success)) + if (!(o1 == rhs.o1)) return false; if (!(o2 == rhs.o2)) return false; + if (!(o3 == rhs.o3)) + return false; return true; } bool operator != (const ThriftHiveMetastore_drop_database_result &rhs) const { @@ -449,13 +459,15 @@ class ThriftHiveMetastore_drop_database_presult { virtual ~ThriftHiveMetastore_drop_database_presult() throw() {} - bool* success; - MetaException o2; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; struct __isset { - __isset() : success(false), o2(false) {} - bool success; + __isset() : o1(false), o2(false), o3(false) {} + bool o1; bool o2; + bool o3; } __isset; uint32_t read(apache::thrift::protocol::TProtocol* iprot); @@ -465,14 +477,22 @@ class ThriftHiveMetastore_drop_database_presult { class ThriftHiveMetastore_get_databases_args { public: - ThriftHiveMetastore_get_databases_args() { + ThriftHiveMetastore_get_databases_args() : pattern("") { } virtual ~ThriftHiveMetastore_get_databases_args() throw() {} + std::string pattern; - bool operator == (const ThriftHiveMetastore_get_databases_args & /* rhs */) const + struct __isset { + __isset() : pattern(false) {} + bool pattern; + } __isset; + + bool operator == (const ThriftHiveMetastore_get_databases_args & rhs) const { + if (!(pattern == rhs.pattern)) + return false; return true; } bool operator != (const ThriftHiveMetastore_get_databases_args &rhs) const { @@ -492,6 +512,7 @@ class ThriftHiveMetastore_get_databases_pargs { virtual ~ThriftHiveMetastore_get_databases_pargs() throw() {} + const std::string* pattern; uint32_t write(apache::thrift::protocol::TProtocol* oprot) const; @@ -552,6 +573,96 @@ class ThriftHiveMetastore_get_databases_presult { }; +class ThriftHiveMetastore_get_all_databases_args { + public: + + ThriftHiveMetastore_get_all_databases_args() { + } + + virtual ~ThriftHiveMetastore_get_all_databases_args() throw() {} + + + bool operator == (const ThriftHiveMetastore_get_all_databases_args & /* rhs */) const + { + return true; + } + bool operator != (const ThriftHiveMetastore_get_all_databases_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_databases_args & ) const; + + uint32_t read(apache::thrift::protocol::TProtocol* iprot); + uint32_t write(apache::thrift::protocol::TProtocol* oprot) const; + +}; + +class ThriftHiveMetastore_get_all_databases_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_all_databases_pargs() throw() {} + + + uint32_t write(apache::thrift::protocol::TProtocol* oprot) const; + +}; + +class ThriftHiveMetastore_get_all_databases_result { + public: + + ThriftHiveMetastore_get_all_databases_result() { + } + + virtual ~ThriftHiveMetastore_get_all_databases_result() throw() {} + + std::vector success; + MetaException o1; + + struct __isset { + __isset() : success(false), o1(false) {} + bool success; + bool o1; + } __isset; + + bool operator == (const ThriftHiveMetastore_get_all_databases_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(o1 == rhs.o1)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_get_all_databases_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_databases_result & ) const; + + uint32_t read(apache::thrift::protocol::TProtocol* iprot); + uint32_t write(apache::thrift::protocol::TProtocol* oprot) const; + +}; + +class ThriftHiveMetastore_get_all_databases_presult { + public: + + + virtual ~ThriftHiveMetastore_get_all_databases_presult() throw() {} + + std::vector * success; + MetaException o1; + + struct __isset { + __isset() : success(false), o1(false) {} + bool success; + bool o1; + } __isset; + + uint32_t read(apache::thrift::protocol::TProtocol* iprot); + +}; + class ThriftHiveMetastore_get_type_args { public: @@ -605,11 +716,13 @@ class ThriftHiveMetastore_get_type_result { virtual ~ThriftHiveMetastore_get_type_result() throw() {} Type success; - MetaException o2; + MetaException o1; + NoSuchObjectException o2; struct __isset { - __isset() : success(false), o2(false) {} + __isset() : success(false), o1(false), o2(false) {} bool success; + bool o1; bool o2; } __isset; @@ -617,6 +730,8 @@ class ThriftHiveMetastore_get_type_result { { if (!(success == rhs.success)) return false; + if (!(o1 == rhs.o1)) + return false; if (!(o2 == rhs.o2)) return false; return true; @@ -639,11 +754,13 @@ class ThriftHiveMetastore_get_type_presult { virtual ~ThriftHiveMetastore_get_type_presult() throw() {} Type* success; - MetaException o2; + MetaException o1; + NoSuchObjectException o2; struct __isset { - __isset() : success(false), o2(false) {} + __isset() : success(false), o1(false), o2(false) {} bool success; + bool o1; bool o2; } __isset; @@ -815,11 +932,13 @@ class ThriftHiveMetastore_drop_type_result { virtual ~ThriftHiveMetastore_drop_type_result() throw() {} bool success; - MetaException o2; + MetaException o1; + NoSuchObjectException o2; struct __isset { - __isset() : success(false), o2(false) {} + __isset() : success(false), o1(false), o2(false) {} bool success; + bool o1; bool o2; } __isset; @@ -827,6 +946,8 @@ class ThriftHiveMetastore_drop_type_result { { if (!(success == rhs.success)) return false; + if (!(o1 == rhs.o1)) + return false; if (!(o2 == rhs.o2)) return false; return true; @@ -849,11 +970,13 @@ class ThriftHiveMetastore_drop_type_presult { virtual ~ThriftHiveMetastore_drop_type_presult() throw() {} bool* success; - MetaException o2; + MetaException o1; + NoSuchObjectException o2; struct __isset { - __isset() : success(false), o2(false) {} + __isset() : success(false), o1(false), o2(false) {} bool success; + bool o1; bool o2; } __isset; @@ -1516,6 +1639,105 @@ class ThriftHiveMetastore_get_tables_presult { }; +class ThriftHiveMetastore_get_all_tables_args { + public: + + ThriftHiveMetastore_get_all_tables_args() : db_name("") { + } + + virtual ~ThriftHiveMetastore_get_all_tables_args() throw() {} + + std::string db_name; + + struct __isset { + __isset() : db_name(false) {} + bool db_name; + } __isset; + + bool operator == (const ThriftHiveMetastore_get_all_tables_args & rhs) const + { + if (!(db_name == rhs.db_name)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_get_all_tables_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_tables_args & ) const; + + uint32_t read(apache::thrift::protocol::TProtocol* iprot); + uint32_t write(apache::thrift::protocol::TProtocol* oprot) const; + +}; + +class ThriftHiveMetastore_get_all_tables_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_all_tables_pargs() throw() {} + + const std::string* db_name; + + uint32_t write(apache::thrift::protocol::TProtocol* oprot) const; + +}; + +class ThriftHiveMetastore_get_all_tables_result { + public: + + ThriftHiveMetastore_get_all_tables_result() { + } + + virtual ~ThriftHiveMetastore_get_all_tables_result() throw() {} + + std::vector success; + MetaException o1; + + struct __isset { + __isset() : success(false), o1(false) {} + bool success; + bool o1; + } __isset; + + bool operator == (const ThriftHiveMetastore_get_all_tables_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(o1 == rhs.o1)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_get_all_tables_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_tables_result & ) const; + + uint32_t read(apache::thrift::protocol::TProtocol* iprot); + uint32_t write(apache::thrift::protocol::TProtocol* oprot) const; + +}; + +class ThriftHiveMetastore_get_all_tables_presult { + public: + + + virtual ~ThriftHiveMetastore_get_all_tables_presult() throw() {} + + std::vector * success; + MetaException o1; + + struct __isset { + __isset() : success(false), o1(false) {} + bool success; + bool o1; + } __isset; + + uint32_t read(apache::thrift::protocol::TProtocol* iprot); + +}; + class ThriftHiveMetastore_get_table_args { public: @@ -3433,18 +3655,21 @@ class ThriftHiveMetastoreClient : virtual public ThriftHiveMetastoreIf, public f boost::shared_ptr getOutputProtocol() { return poprot_; } - bool create_database(const std::string& name, const std::string& description); - void send_create_database(const std::string& name, const std::string& description); - bool recv_create_database(); + void create_database(const Database& database); + void send_create_database(const Database& database); + void recv_create_database(); void get_database(Database& _return, const std::string& name); void send_get_database(const std::string& name); void recv_get_database(Database& _return); - bool drop_database(const std::string& name); - void send_drop_database(const std::string& name); - bool recv_drop_database(); - void get_databases(std::vector & _return); - void send_get_databases(); + void drop_database(const std::string& name, const bool deleteData); + void send_drop_database(const std::string& name, const bool deleteData); + void recv_drop_database(); + void get_databases(std::vector & _return, const std::string& pattern); + void send_get_databases(const std::string& pattern); void recv_get_databases(std::vector & _return); + void get_all_databases(std::vector & _return); + void send_get_all_databases(); + void recv_get_all_databases(std::vector & _return); void get_type(Type& _return, const std::string& name); void send_get_type(const std::string& name); void recv_get_type(Type& _return); @@ -3472,6 +3697,9 @@ class ThriftHiveMetastoreClient : virtual public ThriftHiveMetastoreIf, public f void get_tables(std::vector & _return, const std::string& db_name, const std::string& pattern); void send_get_tables(const std::string& db_name, const std::string& pattern); void recv_get_tables(std::vector & _return); + void get_all_tables(std::vector & _return, const std::string& db_name); + void send_get_all_tables(const std::string& db_name); + void recv_get_all_tables(std::vector & _return); void get_table(Table& _return, const std::string& dbname, const std::string& tbl_name); void send_get_table(const std::string& dbname, const std::string& tbl_name); void recv_get_table(Table& _return); @@ -3535,6 +3763,7 @@ class ThriftHiveMetastoreProcessor : virtual public apache::thrift::TProcessor, void process_get_database(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot); void process_drop_database(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot); void process_get_databases(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot); + void process_get_all_databases(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot); void process_get_type(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot); void process_create_type(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot); void process_drop_type(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot); @@ -3544,6 +3773,7 @@ class ThriftHiveMetastoreProcessor : virtual public apache::thrift::TProcessor, void process_create_table(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot); void process_drop_table(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot); void process_get_tables(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot); + void process_get_all_tables(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot); void process_get_table(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot); void process_alter_table(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot); void process_add_partition(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot); @@ -3569,6 +3799,7 @@ class ThriftHiveMetastoreProcessor : virtual public apache::thrift::TProcessor, processMap_["get_database"] = &ThriftHiveMetastoreProcessor::process_get_database; processMap_["drop_database"] = &ThriftHiveMetastoreProcessor::process_drop_database; processMap_["get_databases"] = &ThriftHiveMetastoreProcessor::process_get_databases; + processMap_["get_all_databases"] = &ThriftHiveMetastoreProcessor::process_get_all_databases; processMap_["get_type"] = &ThriftHiveMetastoreProcessor::process_get_type; processMap_["create_type"] = &ThriftHiveMetastoreProcessor::process_create_type; processMap_["drop_type"] = &ThriftHiveMetastoreProcessor::process_drop_type; @@ -3578,6 +3809,7 @@ class ThriftHiveMetastoreProcessor : virtual public apache::thrift::TProcessor, processMap_["create_table"] = &ThriftHiveMetastoreProcessor::process_create_table; processMap_["drop_table"] = &ThriftHiveMetastoreProcessor::process_drop_table; processMap_["get_tables"] = &ThriftHiveMetastoreProcessor::process_get_tables; + processMap_["get_all_tables"] = &ThriftHiveMetastoreProcessor::process_get_all_tables; processMap_["get_table"] = &ThriftHiveMetastoreProcessor::process_get_table; processMap_["alter_table"] = &ThriftHiveMetastoreProcessor::process_alter_table; processMap_["add_partition"] = &ThriftHiveMetastoreProcessor::process_add_partition; @@ -3618,14 +3850,10 @@ class ThriftHiveMetastoreMultiface : virtual public ThriftHiveMetastoreIf, publi ifaces_.push_back(iface); } public: - bool create_database(const std::string& name, const std::string& description) { + void create_database(const Database& database) { uint32_t sz = ifaces_.size(); for (uint32_t i = 0; i < sz; ++i) { - if (i == sz - 1) { - return ifaces_[i]->create_database(name, description); - } else { - ifaces_[i]->create_database(name, description); - } + ifaces_[i]->create_database(database); } } @@ -3641,25 +3869,33 @@ class ThriftHiveMetastoreMultiface : virtual public ThriftHiveMetastoreIf, publi } } - bool drop_database(const std::string& name) { + void drop_database(const std::string& name, const bool deleteData) { + uint32_t sz = ifaces_.size(); + for (uint32_t i = 0; i < sz; ++i) { + ifaces_[i]->drop_database(name, deleteData); + } + } + + void get_databases(std::vector & _return, const std::string& pattern) { uint32_t sz = ifaces_.size(); for (uint32_t i = 0; i < sz; ++i) { if (i == sz - 1) { - return ifaces_[i]->drop_database(name); + ifaces_[i]->get_databases(_return, pattern); + return; } else { - ifaces_[i]->drop_database(name); + ifaces_[i]->get_databases(_return, pattern); } } } - void get_databases(std::vector & _return) { + void get_all_databases(std::vector & _return) { uint32_t sz = ifaces_.size(); for (uint32_t i = 0; i < sz; ++i) { if (i == sz - 1) { - ifaces_[i]->get_databases(_return); + ifaces_[i]->get_all_databases(_return); return; } else { - ifaces_[i]->get_databases(_return); + ifaces_[i]->get_all_databases(_return); } } } @@ -3760,6 +3996,18 @@ class ThriftHiveMetastoreMultiface : virtual public ThriftHiveMetastoreIf, publi } } + void get_all_tables(std::vector & _return, const std::string& db_name) { + uint32_t sz = ifaces_.size(); + for (uint32_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->get_all_tables(_return, db_name); + return; + } else { + ifaces_[i]->get_all_tables(_return, db_name); + } + } + } + void get_table(Table& _return, const std::string& dbname, const std::string& tbl_name) { uint32_t sz = ifaces_.size(); for (uint32_t i = 0; i < sz; ++i) { diff --git metastore/src/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp metastore/src/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp index 903090b..360acdc 100644 --- metastore/src/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp +++ metastore/src/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp @@ -22,7 +22,7 @@ class ThriftHiveMetastoreHandler : virtual public ThriftHiveMetastoreIf { // Your initialization goes here } - bool create_database(const std::string& name, const std::string& description) { + void create_database(const Database& database) { // Your implementation goes here printf("create_database\n"); } @@ -32,16 +32,21 @@ class ThriftHiveMetastoreHandler : virtual public ThriftHiveMetastoreIf { printf("get_database\n"); } - bool drop_database(const std::string& name) { + void drop_database(const std::string& name, const bool deleteData) { // Your implementation goes here printf("drop_database\n"); } - void get_databases(std::vector & _return) { + void get_databases(std::vector & _return, const std::string& pattern) { // Your implementation goes here printf("get_databases\n"); } + void get_all_databases(std::vector & _return) { + // Your implementation goes here + printf("get_all_databases\n"); + } + void get_type(Type& _return, const std::string& name) { // Your implementation goes here printf("get_type\n"); @@ -87,6 +92,11 @@ class ThriftHiveMetastoreHandler : virtual public ThriftHiveMetastoreIf { printf("get_tables\n"); } + void get_all_tables(std::vector & _return, const std::string& db_name) { + // Your implementation goes here + printf("get_all_tables\n"); + } + void get_table(Table& _return, const std::string& dbname, const std::string& tbl_name) { // Your implementation goes here printf("get_table\n"); diff --git metastore/src/gen-cpp/hive_metastore_types.cpp metastore/src/gen-cpp/hive_metastore_types.cpp index 5ca3b9f..5e277d4 100644 --- metastore/src/gen-cpp/hive_metastore_types.cpp +++ metastore/src/gen-cpp/hive_metastore_types.cpp @@ -261,8 +261,8 @@ uint32_t Type::write(apache::thrift::protocol::TProtocol* oprot) const { return xfer; } -const char* Database::ascii_fingerprint = "07A9615F837F7D0A952B595DD3020972"; -const uint8_t Database::binary_fingerprint[16] = {0x07,0xA9,0x61,0x5F,0x83,0x7F,0x7D,0x0A,0x95,0x2B,0x59,0x5D,0xD3,0x02,0x09,0x72}; +const char* Database::ascii_fingerprint = "AB879940BD15B6B25691265F7384B271"; +const uint8_t Database::binary_fingerprint[16] = {0xAB,0x87,0x99,0x40,0xBD,0x15,0xB6,0xB2,0x56,0x91,0x26,0x5F,0x73,0x84,0xB2,0x71}; uint32_t Database::read(apache::thrift::protocol::TProtocol* iprot) { @@ -300,6 +300,14 @@ uint32_t Database::read(apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->skip(ftype); } break; + case 3: + if (ftype == apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->locationUri); + this->__isset.locationUri = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -321,6 +329,9 @@ uint32_t Database::write(apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeFieldBegin("description", apache::thrift::protocol::T_STRING, 2); xfer += oprot->writeString(this->description); xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("locationUri", apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->locationUri); + xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; diff --git metastore/src/gen-cpp/hive_metastore_types.h metastore/src/gen-cpp/hive_metastore_types.h index 5b9e0b3..2a01e48 100644 --- metastore/src/gen-cpp/hive_metastore_types.h +++ metastore/src/gen-cpp/hive_metastore_types.h @@ -153,21 +153,23 @@ class Type { class Database { public: - static const char* ascii_fingerprint; // = "07A9615F837F7D0A952B595DD3020972"; - static const uint8_t binary_fingerprint[16]; // = {0x07,0xA9,0x61,0x5F,0x83,0x7F,0x7D,0x0A,0x95,0x2B,0x59,0x5D,0xD3,0x02,0x09,0x72}; + static const char* ascii_fingerprint; // = "AB879940BD15B6B25691265F7384B271"; + static const uint8_t binary_fingerprint[16]; // = {0xAB,0x87,0x99,0x40,0xBD,0x15,0xB6,0xB2,0x56,0x91,0x26,0x5F,0x73,0x84,0xB2,0x71}; - Database() : name(""), description("") { + Database() : name(""), description(""), locationUri("") { } virtual ~Database() throw() {} std::string name; std::string description; + std::string locationUri; struct __isset { - __isset() : name(false), description(false) {} + __isset() : name(false), description(false), locationUri(false) {} bool name; bool description; + bool locationUri; } __isset; bool operator == (const Database & rhs) const @@ -176,6 +178,8 @@ class Database { return false; if (!(description == rhs.description)) return false; + if (!(locationUri == rhs.locationUri)) + return false; return true; } bool operator != (const Database &rhs) const { diff --git metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java index 78c78d9..e916cb8 100644 --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java @@ -22,11 +22,14 @@ public class Database implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("Database"); private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); private static final TField DESCRIPTION_FIELD_DESC = new TField("description", TType.STRING, (short)2); + private static final TField LOCATION_URI_FIELD_DESC = new TField("locationUri", TType.STRING, (short)3); private String name; public static final int NAME = 1; private String description; public static final int DESCRIPTION = 2; + private String locationUri; + public static final int LOCATIONURI = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -37,6 +40,8 @@ public class Database implements TBase, java.io.Serializable, Cloneable { new FieldValueMetaData(TType.STRING))); put(DESCRIPTION, new FieldMetaData("description", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); + put(LOCATIONURI, new FieldMetaData("locationUri", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); }}); static { @@ -48,11 +53,13 @@ public class Database implements TBase, java.io.Serializable, Cloneable { public Database( String name, - String description) + String description, + String locationUri) { this(); this.name = name; this.description = description; + this.locationUri = locationUri; } /** @@ -65,6 +72,9 @@ public class Database implements TBase, java.io.Serializable, Cloneable { if (other.isSetDescription()) { this.description = other.description; } + if (other.isSetLocationUri()) { + this.locationUri = other.locationUri; + } } @Override @@ -106,6 +116,23 @@ public class Database implements TBase, java.io.Serializable, Cloneable { return this.description != null; } + public String getLocationUri() { + return this.locationUri; + } + + public void setLocationUri(String locationUri) { + this.locationUri = locationUri; + } + + public void unsetLocationUri() { + this.locationUri = null; + } + + // Returns true if field locationUri is set (has been asigned a value) and false otherwise + public boolean isSetLocationUri() { + return this.locationUri != null; + } + public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case NAME: @@ -124,6 +151,14 @@ public class Database implements TBase, java.io.Serializable, Cloneable { } break; + case LOCATIONURI: + if (value == null) { + unsetLocationUri(); + } else { + setLocationUri((String)value); + } + break; + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -137,6 +172,9 @@ public class Database implements TBase, java.io.Serializable, Cloneable { case DESCRIPTION: return getDescription(); + case LOCATIONURI: + return getLocationUri(); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -149,6 +187,8 @@ public class Database implements TBase, java.io.Serializable, Cloneable { return isSetName(); case DESCRIPTION: return isSetDescription(); + case LOCATIONURI: + return isSetLocationUri(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -185,6 +225,15 @@ public class Database implements TBase, java.io.Serializable, Cloneable { return false; } + boolean this_present_locationUri = true && this.isSetLocationUri(); + boolean that_present_locationUri = true && that.isSetLocationUri(); + if (this_present_locationUri || that_present_locationUri) { + if (!(this_present_locationUri && that_present_locationUri)) + return false; + if (!this.locationUri.equals(that.locationUri)) + return false; + } + return true; } @@ -218,6 +267,13 @@ public class Database implements TBase, java.io.Serializable, Cloneable { TProtocolUtil.skip(iprot, field.type); } break; + case LOCATIONURI: + if (field.type == TType.STRING) { + this.locationUri = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -243,6 +299,11 @@ public class Database implements TBase, java.io.Serializable, Cloneable { oprot.writeString(this.description); oprot.writeFieldEnd(); } + if (this.locationUri != null) { + oprot.writeFieldBegin(LOCATION_URI_FIELD_DESC); + oprot.writeString(this.locationUri); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -267,6 +328,14 @@ public class Database implements TBase, java.io.Serializable, Cloneable { sb.append(this.description); } first = false; + if (!first) sb.append(", "); + sb.append("locationUri:"); + if (this.locationUri == null) { + sb.append("null"); + } else { + sb.append(this.locationUri); + } + first = false; sb.append(")"); return sb.toString(); } diff --git metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java index c99e0ed..054167d 100644 --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java @@ -25,19 +25,21 @@ public class ThriftHiveMetastore { */ public interface Iface extends com.facebook.fb303.FacebookService.Iface { - public boolean create_database(String name, String description) throws AlreadyExistsException, MetaException, TException; + public void create_database(Database database) throws AlreadyExistsException, InvalidObjectException, MetaException, TException; public Database get_database(String name) throws NoSuchObjectException, MetaException, TException; - public boolean drop_database(String name) throws MetaException, TException; + public void drop_database(String name, boolean deleteData) throws NoSuchObjectException, InvalidOperationException, MetaException, TException; - public List get_databases() throws MetaException, TException; + public List get_databases(String pattern) throws MetaException, TException; - public Type get_type(String name) throws MetaException, TException; + public List get_all_databases() throws MetaException, TException; + + public Type get_type(String name) throws MetaException, NoSuchObjectException, TException; public boolean create_type(Type type) throws AlreadyExistsException, InvalidObjectException, MetaException, TException; - public boolean drop_type(String type) throws MetaException, TException; + public boolean drop_type(String type) throws MetaException, NoSuchObjectException, TException; public Map get_type_all(String name) throws MetaException, TException; @@ -51,6 +53,8 @@ public class ThriftHiveMetastore { public List get_tables(String db_name, String pattern) throws MetaException, TException; + public List get_all_tables(String db_name) throws MetaException, TException; + public Table get_table(String dbname, String tbl_name) throws MetaException, NoSuchObjectException, TException; public void alter_table(String dbname, String tbl_name, Table new_tbl) throws InvalidOperationException, MetaException, TException; @@ -98,24 +102,23 @@ public class ThriftHiveMetastore { super(iprot, oprot); } - public boolean create_database(String name, String description) throws AlreadyExistsException, MetaException, TException + public void create_database(Database database) throws AlreadyExistsException, InvalidObjectException, MetaException, TException { - send_create_database(name, description); - return recv_create_database(); + send_create_database(database); + recv_create_database(); } - public void send_create_database(String name, String description) throws TException + public void send_create_database(Database database) throws TException { oprot_.writeMessageBegin(new TMessage("create_database", TMessageType.CALL, seqid_)); create_database_args args = new create_database_args(); - args.name = name; - args.description = description; + args.database = database; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } - public boolean recv_create_database() throws AlreadyExistsException, MetaException, TException + public void recv_create_database() throws AlreadyExistsException, InvalidObjectException, MetaException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { @@ -126,16 +129,16 @@ public class ThriftHiveMetastore { create_database_result result = new create_database_result(); result.read(iprot_); iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } if (result.o1 != null) { throw result.o1; } if (result.o2 != null) { throw result.o2; } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "create_database failed: unknown result"); + if (result.o3 != null) { + throw result.o3; + } + return; } public Database get_database(String name) throws NoSuchObjectException, MetaException, TException @@ -177,23 +180,24 @@ public class ThriftHiveMetastore { throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_database failed: unknown result"); } - public boolean drop_database(String name) throws MetaException, TException + public void drop_database(String name, boolean deleteData) throws NoSuchObjectException, InvalidOperationException, MetaException, TException { - send_drop_database(name); - return recv_drop_database(); + send_drop_database(name, deleteData); + recv_drop_database(); } - public void send_drop_database(String name) throws TException + public void send_drop_database(String name, boolean deleteData) throws TException { oprot_.writeMessageBegin(new TMessage("drop_database", TMessageType.CALL, seqid_)); drop_database_args args = new drop_database_args(); args.name = name; + args.deleteData = deleteData; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } - public boolean recv_drop_database() throws MetaException, TException + public void recv_drop_database() throws NoSuchObjectException, InvalidOperationException, MetaException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { @@ -204,25 +208,29 @@ public class ThriftHiveMetastore { drop_database_result result = new drop_database_result(); result.read(iprot_); iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; + if (result.o1 != null) { + throw result.o1; } if (result.o2 != null) { throw result.o2; } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "drop_database failed: unknown result"); + if (result.o3 != null) { + throw result.o3; + } + return; } - public List get_databases() throws MetaException, TException + public List get_databases(String pattern) throws MetaException, TException { - send_get_databases(); + send_get_databases(pattern); return recv_get_databases(); } - public void send_get_databases() throws TException + public void send_get_databases(String pattern) throws TException { oprot_.writeMessageBegin(new TMessage("get_databases", TMessageType.CALL, seqid_)); get_databases_args args = new get_databases_args(); + args.pattern = pattern; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); @@ -248,7 +256,42 @@ public class ThriftHiveMetastore { throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_databases failed: unknown result"); } - public Type get_type(String name) throws MetaException, TException + public List get_all_databases() throws MetaException, TException + { + send_get_all_databases(); + return recv_get_all_databases(); + } + + public void send_get_all_databases() throws TException + { + oprot_.writeMessageBegin(new TMessage("get_all_databases", TMessageType.CALL, seqid_)); + get_all_databases_args args = new get_all_databases_args(); + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public List recv_get_all_databases() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + get_all_databases_result result = new get_all_databases_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_all_databases failed: unknown result"); + } + + public Type get_type(String name) throws MetaException, NoSuchObjectException, TException { send_get_type(name); return recv_get_type(); @@ -264,7 +307,7 @@ public class ThriftHiveMetastore { oprot_.getTransport().flush(); } - public Type recv_get_type() throws MetaException, TException + public Type recv_get_type() throws MetaException, NoSuchObjectException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { @@ -278,6 +321,9 @@ public class ThriftHiveMetastore { if (result.isSetSuccess()) { return result.success; } + if (result.o1 != null) { + throw result.o1; + } if (result.o2 != null) { throw result.o2; } @@ -326,7 +372,7 @@ public class ThriftHiveMetastore { throw new TApplicationException(TApplicationException.MISSING_RESULT, "create_type failed: unknown result"); } - public boolean drop_type(String type) throws MetaException, TException + public boolean drop_type(String type) throws MetaException, NoSuchObjectException, TException { send_drop_type(type); return recv_drop_type(); @@ -342,7 +388,7 @@ public class ThriftHiveMetastore { oprot_.getTransport().flush(); } - public boolean recv_drop_type() throws MetaException, TException + public boolean recv_drop_type() throws MetaException, NoSuchObjectException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { @@ -356,6 +402,9 @@ public class ThriftHiveMetastore { if (result.isSetSuccess()) { return result.success; } + if (result.o1 != null) { + throw result.o1; + } if (result.o2 != null) { throw result.o2; } @@ -601,6 +650,42 @@ public class ThriftHiveMetastore { throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_tables failed: unknown result"); } + public List get_all_tables(String db_name) throws MetaException, TException + { + send_get_all_tables(db_name); + return recv_get_all_tables(); + } + + public void send_get_all_tables(String db_name) throws TException + { + oprot_.writeMessageBegin(new TMessage("get_all_tables", TMessageType.CALL, seqid_)); + get_all_tables_args args = new get_all_tables_args(); + args.db_name = db_name; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public List recv_get_all_tables() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + get_all_tables_result result = new get_all_tables_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_all_tables failed: unknown result"); + } + public Table get_table(String dbname, String tbl_name) throws MetaException, NoSuchObjectException, TException { send_get_table(dbname, tbl_name); @@ -1290,6 +1375,7 @@ public class ThriftHiveMetastore { processMap_.put("get_database", new get_database()); processMap_.put("drop_database", new drop_database()); processMap_.put("get_databases", new get_databases()); + processMap_.put("get_all_databases", new get_all_databases()); processMap_.put("get_type", new get_type()); processMap_.put("create_type", new create_type()); processMap_.put("drop_type", new drop_type()); @@ -1299,6 +1385,7 @@ public class ThriftHiveMetastore { processMap_.put("create_table", new create_table()); processMap_.put("drop_table", new drop_table()); processMap_.put("get_tables", new get_tables()); + processMap_.put("get_all_tables", new get_all_tables()); processMap_.put("get_table", new get_table()); processMap_.put("alter_table", new alter_table()); processMap_.put("add_partition", new add_partition()); @@ -1346,12 +1433,13 @@ public class ThriftHiveMetastore { iprot.readMessageEnd(); create_database_result result = new create_database_result(); try { - result.success = iface_.create_database(args.name, args.description); - result.__isset.success = true; + iface_.create_database(args.database); } catch (AlreadyExistsException o1) { result.o1 = o1; - } catch (MetaException o2) { + } catch (InvalidObjectException o2) { result.o2 = o2; + } catch (MetaException o3) { + result.o3 = o3; } catch (Throwable th) { LOGGER.error("Internal error processing create_database", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing create_database"); @@ -1407,10 +1495,13 @@ public class ThriftHiveMetastore { iprot.readMessageEnd(); drop_database_result result = new drop_database_result(); try { - result.success = iface_.drop_database(args.name); - result.__isset.success = true; - } catch (MetaException o2) { + iface_.drop_database(args.name, args.deleteData); + } catch (NoSuchObjectException o1) { + result.o1 = o1; + } catch (InvalidOperationException o2) { result.o2 = o2; + } catch (MetaException o3) { + result.o3 = o3; } catch (Throwable th) { LOGGER.error("Internal error processing drop_database", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing drop_database"); @@ -1436,7 +1527,7 @@ public class ThriftHiveMetastore { iprot.readMessageEnd(); get_databases_result result = new get_databases_result(); try { - result.success = iface_.get_databases(); + result.success = iface_.get_databases(args.pattern); } catch (MetaException o1) { result.o1 = o1; } catch (Throwable th) { @@ -1456,6 +1547,34 @@ public class ThriftHiveMetastore { } + private class get_all_databases implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_all_databases_args args = new get_all_databases_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_all_databases_result result = new get_all_databases_result(); + try { + result.success = iface_.get_all_databases(); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_all_databases", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_all_databases"); + oprot.writeMessageBegin(new TMessage("get_all_databases", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_all_databases", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + private class get_type implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { @@ -1465,7 +1584,9 @@ public class ThriftHiveMetastore { get_type_result result = new get_type_result(); try { result.success = iface_.get_type(args.name); - } catch (MetaException o2) { + } catch (MetaException o1) { + result.o1 = o1; + } catch (NoSuchObjectException o2) { result.o2 = o2; } catch (Throwable th) { LOGGER.error("Internal error processing get_type", th); @@ -1527,7 +1648,9 @@ public class ThriftHiveMetastore { try { result.success = iface_.drop_type(args.type); result.__isset.success = true; - } catch (MetaException o2) { + } catch (MetaException o1) { + result.o1 = o1; + } catch (NoSuchObjectException o2) { result.o2 = o2; } catch (Throwable th) { LOGGER.error("Internal error processing drop_type", th); @@ -1730,6 +1853,34 @@ public class ThriftHiveMetastore { } + private class get_all_tables implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_all_tables_args args = new get_all_tables_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_all_tables_result result = new get_all_tables_result(); + try { + result.success = iface_.get_all_tables(args.db_name); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_all_tables", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_all_tables"); + oprot.writeMessageBegin(new TMessage("get_all_tables", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_all_tables", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + private class get_table implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { @@ -2240,23 +2391,18 @@ public class ThriftHiveMetastore { public static class create_database_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("create_database_args"); - private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); - private static final TField DESCRIPTION_FIELD_DESC = new TField("description", TType.STRING, (short)2); + private static final TField DATABASE_FIELD_DESC = new TField("database", TType.STRUCT, (short)1); - private String name; - public static final int NAME = 1; - private String description; - public static final int DESCRIPTION = 2; + private Database database; + public static final int DATABASE = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(DESCRIPTION, new FieldMetaData("description", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); + put(DATABASE, new FieldMetaData("database", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Database.class))); }}); static { @@ -2267,23 +2413,18 @@ public class ThriftHiveMetastore { } public create_database_args( - String name, - String description) + Database database) { this(); - this.name = name; - this.description = description; + this.database = database; } /** * Performs a deep copy on other. */ public create_database_args(create_database_args other) { - if (other.isSetName()) { - this.name = other.name; - } - if (other.isSetDescription()) { - this.description = other.description; + if (other.isSetDatabase()) { + this.database = new Database(other.database); } } @@ -2292,55 +2433,30 @@ public class ThriftHiveMetastore { return new create_database_args(this); } - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public void unsetName() { - this.name = null; - } - - // Returns true if field name is set (has been asigned a value) and false otherwise - public boolean isSetName() { - return this.name != null; - } - - public String getDescription() { - return this.description; + public Database getDatabase() { + return this.database; } - public void setDescription(String description) { - this.description = description; + public void setDatabase(Database database) { + this.database = database; } - public void unsetDescription() { - this.description = null; + public void unsetDatabase() { + this.database = null; } - // Returns true if field description is set (has been asigned a value) and false otherwise - public boolean isSetDescription() { - return this.description != null; + // Returns true if field database is set (has been asigned a value) and false otherwise + public boolean isSetDatabase() { + return this.database != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case NAME: + case DATABASE: if (value == null) { - unsetName(); - } else { - setName((String)value); - } - break; - - case DESCRIPTION: - if (value == null) { - unsetDescription(); + unsetDatabase(); } else { - setDescription((String)value); + setDatabase((Database)value); } break; @@ -2351,11 +2467,8 @@ public class ThriftHiveMetastore { public Object getFieldValue(int fieldID) { switch (fieldID) { - case NAME: - return getName(); - - case DESCRIPTION: - return getDescription(); + case DATABASE: + return getDatabase(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -2365,10 +2478,8 @@ public class ThriftHiveMetastore { // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case NAME: - return isSetName(); - case DESCRIPTION: - return isSetDescription(); + case DATABASE: + return isSetDatabase(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -2387,21 +2498,12 @@ public class ThriftHiveMetastore { if (that == null) return false; - boolean this_present_name = true && this.isSetName(); - boolean that_present_name = true && that.isSetName(); - if (this_present_name || that_present_name) { - if (!(this_present_name && that_present_name)) - return false; - if (!this.name.equals(that.name)) - return false; - } - - boolean this_present_description = true && this.isSetDescription(); - boolean that_present_description = true && that.isSetDescription(); - if (this_present_description || that_present_description) { - if (!(this_present_description && that_present_description)) + boolean this_present_database = true && this.isSetDatabase(); + boolean that_present_database = true && that.isSetDatabase(); + if (this_present_database || that_present_database) { + if (!(this_present_database && that_present_database)) return false; - if (!this.description.equals(that.description)) + if (!this.database.equals(that.database)) return false; } @@ -2424,16 +2526,10 @@ public class ThriftHiveMetastore { } switch (field.id) { - case NAME: - if (field.type == TType.STRING) { - this.name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case DESCRIPTION: - if (field.type == TType.STRING) { - this.description = iprot.readString(); + case DATABASE: + if (field.type == TType.STRUCT) { + this.database = new Database(); + this.database.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -2453,14 +2549,9 @@ public class ThriftHiveMetastore { validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); - oprot.writeFieldEnd(); - } - if (this.description != null) { - oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC); - oprot.writeString(this.description); + if (this.database != null) { + oprot.writeFieldBegin(DATABASE_FIELD_DESC); + this.database.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -2472,19 +2563,11 @@ public class ThriftHiveMetastore { StringBuilder sb = new StringBuilder("create_database_args("); boolean first = true; - sb.append("name:"); - if (this.name == null) { - sb.append("null"); - } else { - sb.append(this.name); - } - first = false; - if (!first) sb.append(", "); - sb.append("description:"); - if (this.description == null) { + sb.append("database:"); + if (this.database == null) { sb.append("null"); } else { - sb.append(this.description); + sb.append(this.database); } first = false; sb.append(")"); @@ -2500,29 +2583,28 @@ public class ThriftHiveMetastore { public static class create_database_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("create_database_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); - private boolean success; - public static final int SUCCESS = 0; private AlreadyExistsException o1; public static final int O1 = 1; - private MetaException o2; + private InvalidObjectException o2; public static final int O2 = 2; + private MetaException o3; + public static final int O3 = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); + put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); }}); static { @@ -2533,28 +2615,28 @@ public class ThriftHiveMetastore { } public create_database_result( - boolean success, AlreadyExistsException o1, - MetaException o2) + InvalidObjectException o2, + MetaException o3) { this(); - this.success = success; - this.__isset.success = true; this.o1 = o1; this.o2 = o2; + this.o3 = o3; } /** * Performs a deep copy on other. */ public create_database_result(create_database_result other) { - __isset.success = other.__isset.success; - this.success = other.success; if (other.isSetO1()) { this.o1 = new AlreadyExistsException(other.o1); } if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + this.o2 = new InvalidObjectException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new MetaException(other.o3); } } @@ -2563,24 +2645,6 @@ public class ThriftHiveMetastore { return new create_database_result(this); } - public boolean isSuccess() { - return this.success; - } - - public void setSuccess(boolean success) { - this.success = success; - this.__isset.success = true; - } - - public void unsetSuccess() { - this.__isset.success = false; - } - - // Returns true if field success is set (has been asigned a value) and false otherwise - public boolean isSetSuccess() { - return this.__isset.success; - } - public AlreadyExistsException getO1() { return this.o1; } @@ -2598,11 +2662,11 @@ public class ThriftHiveMetastore { return this.o1 != null; } - public MetaException getO2() { + public InvalidObjectException getO2() { return this.o2; } - public void setO2(MetaException o2) { + public void setO2(InvalidObjectException o2) { this.o2 = o2; } @@ -2615,16 +2679,25 @@ public class ThriftHiveMetastore { return this.o2 != null; } + public MetaException getO3() { + return this.o3; + } + + public void setO3(MetaException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + // Returns true if field o3 is set (has been asigned a value) and false otherwise + public boolean isSetO3() { + return this.o3 != null; + } + public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - case O1: if (value == null) { unsetO1(); @@ -2637,7 +2710,15 @@ public class ThriftHiveMetastore { if (value == null) { unsetO2(); } else { - setO2((MetaException)value); + setO2((InvalidObjectException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((MetaException)value); } break; @@ -2648,15 +2729,15 @@ public class ThriftHiveMetastore { public Object getFieldValue(int fieldID) { switch (fieldID) { - case SUCCESS: - return new Boolean(isSuccess()); - case O1: return getO1(); case O2: return getO2(); + case O3: + return getO3(); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -2665,12 +2746,12 @@ public class ThriftHiveMetastore { // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case SUCCESS: - return isSetSuccess(); case O1: return isSetO1(); case O2: return isSetO2(); + case O3: + return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -2689,15 +2770,6 @@ public class ThriftHiveMetastore { if (that == null) return false; - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - boolean this_present_o1 = true && this.isSetO1(); boolean that_present_o1 = true && that.isSetO1(); if (this_present_o1 || that_present_o1) { @@ -2716,6 +2788,15 @@ public class ThriftHiveMetastore { 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; } @@ -2735,14 +2816,6 @@ public class ThriftHiveMetastore { } switch (field.id) { - case SUCCESS: - if (field.type == TType.BOOL) { - this.success = iprot.readBool(); - this.__isset.success = true; - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; case O1: if (field.type == TType.STRUCT) { this.o1 = new AlreadyExistsException(); @@ -2753,12 +2826,20 @@ public class ThriftHiveMetastore { break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new MetaException(); + this.o2 = new InvalidObjectException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; + case O3: + if (field.type == TType.STRUCT) { + this.o3 = new MetaException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -2773,11 +2854,7 @@ public class ThriftHiveMetastore { public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetO1()) { + if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); @@ -2785,6 +2862,10 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(O2_FIELD_DESC); this.o2.write(oprot); oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -2795,10 +2876,6 @@ public class ThriftHiveMetastore { StringBuilder sb = new StringBuilder("create_database_result("); boolean first = true; - sb.append("success:"); - sb.append(this.success); - first = false; - if (!first) sb.append(", "); sb.append("o1:"); if (this.o1 == null) { sb.append("null"); @@ -2814,6 +2891,14 @@ public class ThriftHiveMetastore { 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(); } @@ -3348,17 +3433,23 @@ public class ThriftHiveMetastore { public static class drop_database_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("drop_database_args"); private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); + private static final TField DELETE_DATA_FIELD_DESC = new TField("deleteData", TType.BOOL, (short)2); private String name; public static final int NAME = 1; + private boolean deleteData; + public static final int DELETEDATA = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean deleteData = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); + put(DELETEDATA, new FieldMetaData("deleteData", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); }}); static { @@ -3369,10 +3460,13 @@ public class ThriftHiveMetastore { } public drop_database_args( - String name) + String name, + boolean deleteData) { this(); this.name = name; + this.deleteData = deleteData; + this.__isset.deleteData = true; } /** @@ -3382,6 +3476,8 @@ public class ThriftHiveMetastore { if (other.isSetName()) { this.name = other.name; } + __isset.deleteData = other.__isset.deleteData; + this.deleteData = other.deleteData; } @Override @@ -3406,6 +3502,24 @@ public class ThriftHiveMetastore { return this.name != null; } + public boolean isDeleteData() { + return this.deleteData; + } + + public void setDeleteData(boolean deleteData) { + this.deleteData = deleteData; + this.__isset.deleteData = true; + } + + public void unsetDeleteData() { + this.__isset.deleteData = false; + } + + // Returns true if field deleteData is set (has been asigned a value) and false otherwise + public boolean isSetDeleteData() { + return this.__isset.deleteData; + } + public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case NAME: @@ -3416,6 +3530,14 @@ public class ThriftHiveMetastore { } break; + case DELETEDATA: + if (value == null) { + unsetDeleteData(); + } else { + setDeleteData((Boolean)value); + } + break; + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -3426,6 +3548,9 @@ public class ThriftHiveMetastore { case NAME: return getName(); + case DELETEDATA: + return new Boolean(isDeleteData()); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -3436,6 +3561,8 @@ public class ThriftHiveMetastore { switch (fieldID) { case NAME: return isSetName(); + case DELETEDATA: + return isSetDeleteData(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -3463,6 +3590,15 @@ public class ThriftHiveMetastore { return false; } + boolean this_present_deleteData = true; + boolean that_present_deleteData = true; + if (this_present_deleteData || that_present_deleteData) { + if (!(this_present_deleteData && that_present_deleteData)) + return false; + if (this.deleteData != that.deleteData) + return false; + } + return true; } @@ -3489,6 +3625,14 @@ public class ThriftHiveMetastore { TProtocolUtil.skip(iprot, field.type); } break; + case DELETEDATA: + if (field.type == TType.BOOL) { + this.deleteData = iprot.readBool(); + this.__isset.deleteData = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -3509,6 +3653,9 @@ public class ThriftHiveMetastore { oprot.writeString(this.name); oprot.writeFieldEnd(); } + oprot.writeFieldBegin(DELETE_DATA_FIELD_DESC); + oprot.writeBool(this.deleteData); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -3525,6 +3672,10 @@ public class ThriftHiveMetastore { sb.append(this.name); } first = false; + if (!first) sb.append(", "); + sb.append("deleteData:"); + sb.append(this.deleteData); + first = false; sb.append(")"); return sb.toString(); } @@ -3538,24 +3689,28 @@ public class ThriftHiveMetastore { public static class drop_database_result implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("drop_database_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); - private boolean success; - public static final int SUCCESS = 0; - private MetaException o2; + private NoSuchObjectException o1; + public static final int O1 = 1; + private InvalidOperationException o2; public static final int O2 = 2; + private MetaException o3; + public static final int O3 = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); + put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); }}); static { @@ -3566,23 +3721,28 @@ public class ThriftHiveMetastore { } public drop_database_result( - boolean success, - MetaException o2) + NoSuchObjectException o1, + InvalidOperationException o2, + MetaException o3) { this(); - this.success = success; - this.__isset.success = true; + this.o1 = o1; this.o2 = o2; + this.o3 = o3; } /** * Performs a deep copy on other. */ public drop_database_result(drop_database_result other) { - __isset.success = other.__isset.success; - this.success = other.success; + if (other.isSetO1()) { + this.o1 = new NoSuchObjectException(other.o1); + } if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + this.o2 = new InvalidOperationException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new MetaException(other.o3); } } @@ -3591,29 +3751,28 @@ public class ThriftHiveMetastore { return new drop_database_result(this); } - public boolean isSuccess() { - return this.success; + public NoSuchObjectException getO1() { + return this.o1; } - public void setSuccess(boolean success) { - this.success = success; - this.__isset.success = true; + public void setO1(NoSuchObjectException o1) { + this.o1 = o1; } - public void unsetSuccess() { - this.__isset.success = false; + public void unsetO1() { + this.o1 = null; } - // Returns true if field success is set (has been asigned a value) and false otherwise - public boolean isSetSuccess() { - return this.__isset.success; + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; } - public MetaException getO2() { + public InvalidOperationException getO2() { return this.o2; } - public void setO2(MetaException o2) { + public void setO2(InvalidOperationException o2) { this.o2 = o2; } @@ -3626,13 +3785,30 @@ public class ThriftHiveMetastore { return this.o2 != null; } + public MetaException getO3() { + return this.o3; + } + + public void setO3(MetaException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + // Returns true if field o3 is set (has been asigned a value) and false otherwise + public boolean isSetO3() { + return this.o3 != null; + } + public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case SUCCESS: + case O1: if (value == null) { - unsetSuccess(); + unsetO1(); } else { - setSuccess((Boolean)value); + setO1((NoSuchObjectException)value); } break; @@ -3640,23 +3816,34 @@ public class ThriftHiveMetastore { if (value == null) { unsetO2(); } else { - setO2((MetaException)value); + setO2((InvalidOperationException)value); } break; - default: - throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); - } - } + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((MetaException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } public Object getFieldValue(int fieldID) { switch (fieldID) { - case SUCCESS: - return new Boolean(isSuccess()); + case O1: + return getO1(); case O2: return getO2(); + case O3: + return getO3(); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -3665,10 +3852,12 @@ public class ThriftHiveMetastore { // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case SUCCESS: - return isSetSuccess(); + case O1: + return isSetO1(); case O2: return isSetO2(); + case O3: + return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -3687,12 +3876,12 @@ public class ThriftHiveMetastore { if (that == null) return false; - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) return false; - if (this.success != that.success) + if (!this.o1.equals(that.o1)) return false; } @@ -3705,6 +3894,15 @@ public class ThriftHiveMetastore { 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; } @@ -3724,22 +3922,30 @@ public class ThriftHiveMetastore { } switch (field.id) { - case SUCCESS: - if (field.type == TType.BOOL) { - this.success = iprot.readBool(); - this.__isset.success = true; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new NoSuchObjectException(); + this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new MetaException(); + this.o2 = new InvalidOperationException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; + case O3: + if (field.type == TType.STRUCT) { + this.o3 = new MetaException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -3754,14 +3960,18 @@ public class ThriftHiveMetastore { public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(this.success); + if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetO2()) { oprot.writeFieldBegin(O2_FIELD_DESC); this.o2.write(oprot); oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -3772,8 +3982,12 @@ public class ThriftHiveMetastore { StringBuilder sb = new StringBuilder("drop_database_result("); boolean first = true; - sb.append("success:"); - sb.append(this.success); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } first = false; if (!first) sb.append(", "); sb.append("o2:"); @@ -3783,6 +3997,14 @@ public class ThriftHiveMetastore { 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(); } @@ -3796,8 +4018,18 @@ public class ThriftHiveMetastore { public static class get_databases_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("get_databases_args"); + private static final TField PATTERN_FIELD_DESC = new TField("pattern", TType.STRING, (short)1); + + private String pattern; + public static final int PATTERN = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(PATTERN, new FieldMetaData("pattern", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); }}); static { @@ -3807,10 +4039,20 @@ public class ThriftHiveMetastore { public get_databases_args() { } + public get_databases_args( + String pattern) + { + this(); + this.pattern = pattern; + } + /** * Performs a deep copy on other. */ public get_databases_args(get_databases_args other) { + if (other.isSetPattern()) { + this.pattern = other.pattern; + } } @Override @@ -3818,8 +4060,33 @@ public class ThriftHiveMetastore { return new get_databases_args(this); } + public String getPattern() { + return this.pattern; + } + + public void setPattern(String pattern) { + this.pattern = pattern; + } + + public void unsetPattern() { + this.pattern = null; + } + + // Returns true if field pattern is set (has been asigned a value) and false otherwise + public boolean isSetPattern() { + return this.pattern != null; + } + public void setFieldValue(int fieldID, Object value) { switch (fieldID) { + case PATTERN: + if (value == null) { + unsetPattern(); + } else { + setPattern((String)value); + } + break; + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -3827,6 +4094,9 @@ public class ThriftHiveMetastore { public Object getFieldValue(int fieldID) { switch (fieldID) { + case PATTERN: + return getPattern(); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -3835,6 +4105,8 @@ public class ThriftHiveMetastore { // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { + case PATTERN: + return isSetPattern(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -3853,6 +4125,15 @@ public class ThriftHiveMetastore { if (that == null) return false; + boolean this_present_pattern = true && this.isSetPattern(); + boolean that_present_pattern = true && that.isSetPattern(); + if (this_present_pattern || that_present_pattern) { + if (!(this_present_pattern && that_present_pattern)) + return false; + if (!this.pattern.equals(that.pattern)) + return false; + } + return true; } @@ -3872,6 +4153,13 @@ public class ThriftHiveMetastore { } switch (field.id) { + case PATTERN: + if (field.type == TType.STRING) { + this.pattern = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -3887,6 +4175,11 @@ public class ThriftHiveMetastore { validate(); oprot.writeStructBegin(STRUCT_DESC); + if (this.pattern != null) { + oprot.writeFieldBegin(PATTERN_FIELD_DESC); + oprot.writeString(this.pattern); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -3896,6 +4189,13 @@ public class ThriftHiveMetastore { StringBuilder sb = new StringBuilder("get_databases_args("); boolean first = true; + sb.append("pattern:"); + if (this.pattern == null) { + sb.append("null"); + } else { + sb.append(this.pattern); + } + first = false; sb.append(")"); return sb.toString(); } @@ -4202,77 +4502,32 @@ public class ThriftHiveMetastore { } - public static class get_type_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_type_args"); - private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); - - private String name; - public static final int NAME = 1; - - private final Isset __isset = new Isset(); - private static final class Isset implements java.io.Serializable { - } + public static class get_all_databases_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_all_databases_args"); public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(get_type_args.class, metaDataMap); - } - - public get_type_args() { + FieldMetaData.addStructMetaDataMap(get_all_databases_args.class, metaDataMap); } - public get_type_args( - String name) - { - this(); - this.name = name; + public get_all_databases_args() { } /** * Performs a deep copy on other. */ - public get_type_args(get_type_args other) { - if (other.isSetName()) { - this.name = other.name; - } + public get_all_databases_args(get_all_databases_args other) { } @Override - public get_type_args clone() { - return new get_type_args(this); - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public void unsetName() { - this.name = null; - } - - // Returns true if field name is set (has been asigned a value) and false otherwise - public boolean isSetName() { - return this.name != null; + public get_all_databases_args clone() { + return new get_all_databases_args(this); } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case NAME: - if (value == null) { - unsetName(); - } else { - setName((String)value); - } - break; - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -4280,9 +4535,6 @@ public class ThriftHiveMetastore { public Object getFieldValue(int fieldID) { switch (fieldID) { - case NAME: - return getName(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -4291,8 +4543,6 @@ public class ThriftHiveMetastore { // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case NAME: - return isSetName(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -4302,24 +4552,15 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_type_args) - return this.equals((get_type_args)that); + if (that instanceof get_all_databases_args) + return this.equals((get_all_databases_args)that); return false; } - public boolean equals(get_type_args that) { + public boolean equals(get_all_databases_args that) { if (that == null) return false; - boolean this_present_name = true && this.isSetName(); - boolean that_present_name = true && that.isSetName(); - if (this_present_name || that_present_name) { - if (!(this_present_name && that_present_name)) - return false; - if (!this.name.equals(that.name)) - return false; - } - return true; } @@ -4339,13 +4580,6 @@ public class ThriftHiveMetastore { } switch (field.id) { - case NAME: - if (field.type == TType.STRING) { - this.name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -4361,27 +4595,15 @@ public class ThriftHiveMetastore { validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); - oprot.writeFieldEnd(); - } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("get_type_args("); + StringBuilder sb = new StringBuilder("get_all_databases_args("); boolean first = true; - sb.append("name:"); - if (this.name == null) { - sb.append("null"); - } else { - sb.append(this.name); - } - first = false; sb.append(")"); return sb.toString(); } @@ -4393,15 +4615,15 @@ public class ThriftHiveMetastore { } - public static class get_type_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_type_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)1); - - private Type success; + public static class get_all_databases_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_all_databases_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + + private List success; public static final int SUCCESS = 0; - private MetaException o2; - public static final int O2 = 1; + private MetaException o1; + public static final int O1 = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -4409,49 +4631,69 @@ public class ThriftHiveMetastore { public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Type.class))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_type_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_all_databases_result.class, metaDataMap); } - public get_type_result() { + public get_all_databases_result() { } - public get_type_result( - Type success, - MetaException o2) + public get_all_databases_result( + List success, + MetaException o1) { this(); this.success = success; - this.o2 = o2; + this.o1 = o1; } /** * Performs a deep copy on other. */ - public get_type_result(get_type_result other) { + public get_all_databases_result(get_all_databases_result other) { if (other.isSetSuccess()) { - this.success = new Type(other.success); + List __this__success = new ArrayList(); + for (String other_element : other.success) { + __this__success.add(other_element); + } + this.success = __this__success; } - if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); } } @Override - public get_type_result clone() { - return new get_type_result(this); + public get_all_databases_result clone() { + return new get_all_databases_result(this); } - public Type getSuccess() { + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(String elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { return this.success; } - public void setSuccess(Type success) { + public void setSuccess(List success) { this.success = success; } @@ -4464,21 +4706,21 @@ public class ThriftHiveMetastore { return this.success != null; } - public MetaException getO2() { - return this.o2; + public MetaException getO1() { + return this.o1; } - public void setO2(MetaException o2) { - this.o2 = o2; + public void setO1(MetaException o1) { + this.o1 = o1; } - public void unsetO2() { - this.o2 = null; + public void unsetO1() { + this.o1 = null; } - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; } public void setFieldValue(int fieldID, Object value) { @@ -4487,15 +4729,15 @@ public class ThriftHiveMetastore { if (value == null) { unsetSuccess(); } else { - setSuccess((Type)value); + setSuccess((List)value); } break; - case O2: + case O1: if (value == null) { - unsetO2(); + unsetO1(); } else { - setO2((MetaException)value); + setO1((MetaException)value); } break; @@ -4509,8 +4751,8 @@ public class ThriftHiveMetastore { case SUCCESS: return getSuccess(); - case O2: - return getO2(); + case O1: + return getO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -4522,8 +4764,8 @@ public class ThriftHiveMetastore { switch (fieldID) { case SUCCESS: return isSetSuccess(); - case O2: - return isSetO2(); + case O1: + return isSetO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -4533,12 +4775,12 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_type_result) - return this.equals((get_type_result)that); + if (that instanceof get_all_databases_result) + return this.equals((get_all_databases_result)that); return false; } - public boolean equals(get_type_result that) { + public boolean equals(get_all_databases_result that) { if (that == null) return false; @@ -4551,12 +4793,12 @@ public class ThriftHiveMetastore { return false; } - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) return false; - if (!this.o2.equals(that.o2)) + if (!this.o1.equals(that.o1)) return false; } @@ -4580,17 +4822,26 @@ public class ThriftHiveMetastore { switch (field.id) { case SUCCESS: - if (field.type == TType.STRUCT) { - this.success = new Type(); - this.success.read(iprot); + if (field.type == TType.LIST) { + { + TList _list61 = iprot.readListBegin(); + this.success = new ArrayList(_list61.size); + for (int _i62 = 0; _i62 < _list61.size; ++_i62) + { + String _elem63; + _elem63 = iprot.readString(); + this.success.add(_elem63); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } break; - case O2: + case O1: if (field.type == TType.STRUCT) { - this.o2 = new MetaException(); - this.o2.read(iprot); + this.o1 = new MetaException(); + this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -4611,11 +4862,17 @@ public class ThriftHiveMetastore { if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); + { + oprot.writeListBegin(new TList(TType.STRING, this.success.size())); + for (String _iter64 : this.success) { + oprot.writeString(_iter64); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -4624,7 +4881,7 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("get_type_result("); + StringBuilder sb = new StringBuilder("get_all_databases_result("); boolean first = true; sb.append("success:"); @@ -4635,11 +4892,11 @@ public class ThriftHiveMetastore { } first = false; if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { + sb.append("o1:"); + if (this.o1 == null) { sb.append("null"); } else { - sb.append(this.o2); + sb.append(this.o1); } first = false; sb.append(")"); @@ -4653,74 +4910,74 @@ public class ThriftHiveMetastore { } - public static class create_type_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("create_type_args"); - private static final TField TYPE_FIELD_DESC = new TField("type", TType.STRUCT, (short)1); + public static class get_type_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_type_args"); + private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); - private Type type; - public static final int TYPE = 1; + private String name; + public static final int NAME = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Type.class))); + put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(create_type_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_type_args.class, metaDataMap); } - public create_type_args() { + public get_type_args() { } - public create_type_args( - Type type) + public get_type_args( + String name) { this(); - this.type = type; + this.name = name; } /** * Performs a deep copy on other. */ - public create_type_args(create_type_args other) { - if (other.isSetType()) { - this.type = new Type(other.type); + public get_type_args(get_type_args other) { + if (other.isSetName()) { + this.name = other.name; } } @Override - public create_type_args clone() { - return new create_type_args(this); + public get_type_args clone() { + return new get_type_args(this); } - public Type getType() { - return this.type; + public String getName() { + return this.name; } - public void setType(Type type) { - this.type = type; + public void setName(String name) { + this.name = name; } - public void unsetType() { - this.type = null; + public void unsetName() { + this.name = null; } - // Returns true if field type is set (has been asigned a value) and false otherwise - public boolean isSetType() { - return this.type != null; + // Returns true if field name is set (has been asigned a value) and false otherwise + public boolean isSetName() { + return this.name != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case TYPE: + case NAME: if (value == null) { - unsetType(); + unsetName(); } else { - setType((Type)value); + setName((String)value); } break; @@ -4731,8 +4988,8 @@ public class ThriftHiveMetastore { public Object getFieldValue(int fieldID) { switch (fieldID) { - case TYPE: - return getType(); + case NAME: + return getName(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -4742,8 +4999,8 @@ public class ThriftHiveMetastore { // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case TYPE: - return isSetType(); + case NAME: + return isSetName(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -4753,21 +5010,21 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof create_type_args) - return this.equals((create_type_args)that); + if (that instanceof get_type_args) + return this.equals((get_type_args)that); return false; } - public boolean equals(create_type_args that) { + public boolean equals(get_type_args that) { if (that == null) 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)) + boolean this_present_name = true && this.isSetName(); + boolean that_present_name = true && that.isSetName(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) return false; - if (!this.type.equals(that.type)) + if (!this.name.equals(that.name)) return false; } @@ -4790,10 +5047,9 @@ public class ThriftHiveMetastore { } switch (field.id) { - case TYPE: - if (field.type == TType.STRUCT) { - this.type = new Type(); - this.type.read(iprot); + case NAME: + if (field.type == TType.STRING) { + this.name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -4813,9 +5069,9 @@ public class ThriftHiveMetastore { validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.type != null) { - oprot.writeFieldBegin(TYPE_FIELD_DESC); - this.type.write(oprot); + if (this.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(this.name); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -4824,14 +5080,14 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("create_type_args("); + StringBuilder sb = new StringBuilder("get_type_args("); boolean first = true; - sb.append("type:"); - if (this.type == null) { + sb.append("name:"); + if (this.name == null) { sb.append("null"); } else { - sb.append(this.type); + sb.append(this.name); } first = false; sb.append(")"); @@ -4845,104 +5101,92 @@ public class ThriftHiveMetastore { } - public static class create_type_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("create_type_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + public static class get_type_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_type_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); - private boolean success; + private Type success; public static final int SUCCESS = 0; - private AlreadyExistsException o1; + private MetaException o1; public static final int O1 = 1; - private InvalidObjectException o2; + private NoSuchObjectException o2; public static final int O2 = 2; - private MetaException o3; - public static final int O3 = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); + new StructMetaData(TType.STRUCT, Type.class))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(create_type_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_type_result.class, metaDataMap); } - public create_type_result() { + public get_type_result() { } - public create_type_result( - boolean success, - AlreadyExistsException o1, - InvalidObjectException o2, - MetaException o3) + public get_type_result( + Type success, + MetaException o1, + NoSuchObjectException o2) { this(); this.success = success; - this.__isset.success = true; this.o1 = o1; this.o2 = o2; - this.o3 = o3; } /** * Performs a deep copy on other. */ - public create_type_result(create_type_result other) { - __isset.success = other.__isset.success; - this.success = other.success; + public get_type_result(get_type_result other) { + if (other.isSetSuccess()) { + this.success = new Type(other.success); + } if (other.isSetO1()) { - this.o1 = new AlreadyExistsException(other.o1); + this.o1 = new MetaException(other.o1); } if (other.isSetO2()) { - this.o2 = new InvalidObjectException(other.o2); - } - if (other.isSetO3()) { - this.o3 = new MetaException(other.o3); + this.o2 = new NoSuchObjectException(other.o2); } } @Override - public create_type_result clone() { - return new create_type_result(this); + public get_type_result clone() { + return new get_type_result(this); } - public boolean isSuccess() { + public Type getSuccess() { return this.success; } - public void setSuccess(boolean success) { + public void setSuccess(Type success) { this.success = success; - this.__isset.success = true; } public void unsetSuccess() { - this.__isset.success = false; + this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { - return this.__isset.success; + return this.success != null; } - public AlreadyExistsException getO1() { + public MetaException getO1() { return this.o1; } - public void setO1(AlreadyExistsException o1) { + public void setO1(MetaException o1) { this.o1 = o1; } @@ -4955,11 +5199,11 @@ public class ThriftHiveMetastore { return this.o1 != null; } - public InvalidObjectException getO2() { + public NoSuchObjectException getO2() { return this.o2; } - public void setO2(InvalidObjectException o2) { + public void setO2(NoSuchObjectException o2) { this.o2 = o2; } @@ -4972,30 +5216,13 @@ public class ThriftHiveMetastore { return this.o2 != null; } - public MetaException getO3() { - return this.o3; - } - - public void setO3(MetaException o3) { - this.o3 = o3; - } - - public void unsetO3() { - this.o3 = null; - } - - // Returns true if field o3 is set (has been asigned a value) and false otherwise - public boolean isSetO3() { - return this.o3 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((Boolean)value); + setSuccess((Type)value); } break; @@ -5003,7 +5230,7 @@ public class ThriftHiveMetastore { if (value == null) { unsetO1(); } else { - setO1((AlreadyExistsException)value); + setO1((MetaException)value); } break; @@ -5011,15 +5238,7 @@ public class ThriftHiveMetastore { if (value == null) { unsetO2(); } else { - setO2((InvalidObjectException)value); - } - break; - - case O3: - if (value == null) { - unsetO3(); - } else { - setO3((MetaException)value); + setO2((NoSuchObjectException)value); } break; @@ -5031,7 +5250,7 @@ public class ThriftHiveMetastore { public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: - return new Boolean(isSuccess()); + return getSuccess(); case O1: return getO1(); @@ -5039,9 +5258,6 @@ public class ThriftHiveMetastore { case O2: return getO2(); - case O3: - return getO3(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -5056,8 +5272,6 @@ public class ThriftHiveMetastore { return isSetO1(); case O2: return isSetO2(); - case O3: - return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -5067,21 +5281,21 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof create_type_result) - return this.equals((create_type_result)that); + if (that instanceof get_type_result) + return this.equals((get_type_result)that); return false; } - public boolean equals(create_type_result that) { + public boolean equals(get_type_result that) { if (that == null) return false; - boolean this_present_success = true; - boolean that_present_success = true; + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (this.success != that.success) + if (!this.success.equals(that.success)) return false; } @@ -5103,15 +5317,6 @@ public class ThriftHiveMetastore { 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; } @@ -5132,16 +5337,16 @@ public class ThriftHiveMetastore { switch (field.id) { case SUCCESS: - if (field.type == TType.BOOL) { - this.success = iprot.readBool(); - this.__isset.success = true; + if (field.type == TType.STRUCT) { + this.success = new Type(); + this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case O1: if (field.type == TType.STRUCT) { - this.o1 = new AlreadyExistsException(); + this.o1 = new MetaException(); this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -5149,20 +5354,12 @@ public class ThriftHiveMetastore { break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new InvalidObjectException(); + this.o2 = new NoSuchObjectException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O3: - if (field.type == TType.STRUCT) { - this.o3 = new MetaException(); - this.o3.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -5179,7 +5376,7 @@ public class ThriftHiveMetastore { if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(this.success); + this.success.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); @@ -5189,10 +5386,6 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(O2_FIELD_DESC); this.o2.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO3()) { - oprot.writeFieldBegin(O3_FIELD_DESC); - this.o3.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -5200,11 +5393,15 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("create_type_result("); + StringBuilder sb = new StringBuilder("get_type_result("); boolean first = true; sb.append("success:"); - sb.append(this.success); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } first = false; if (!first) sb.append(", "); sb.append("o1:"); @@ -5222,14 +5419,6 @@ public class ThriftHiveMetastore { 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(); } @@ -5241,11 +5430,11 @@ public class ThriftHiveMetastore { } - public static class drop_type_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_type_args"); - private static final TField TYPE_FIELD_DESC = new TField("type", TType.STRING, (short)1); + public static class create_type_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("create_type_args"); + private static final TField TYPE_FIELD_DESC = new TField("type", TType.STRUCT, (short)1); - private String type; + private Type type; public static final int TYPE = 1; private final Isset __isset = new Isset(); @@ -5254,18 +5443,18 @@ public class ThriftHiveMetastore { public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); + new StructMetaData(TType.STRUCT, Type.class))); }}); static { - FieldMetaData.addStructMetaDataMap(drop_type_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(create_type_args.class, metaDataMap); } - public drop_type_args() { + public create_type_args() { } - public drop_type_args( - String type) + public create_type_args( + Type type) { this(); this.type = type; @@ -5274,22 +5463,22 @@ public class ThriftHiveMetastore { /** * Performs a deep copy on other. */ - public drop_type_args(drop_type_args other) { + public create_type_args(create_type_args other) { if (other.isSetType()) { - this.type = other.type; + this.type = new Type(other.type); } } @Override - public drop_type_args clone() { - return new drop_type_args(this); + public create_type_args clone() { + return new create_type_args(this); } - public String getType() { + public Type getType() { return this.type; } - public void setType(String type) { + public void setType(Type type) { this.type = type; } @@ -5308,7 +5497,7 @@ public class ThriftHiveMetastore { if (value == null) { unsetType(); } else { - setType((String)value); + setType((Type)value); } break; @@ -5341,12 +5530,12 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_type_args) - return this.equals((drop_type_args)that); + if (that instanceof create_type_args) + return this.equals((create_type_args)that); return false; } - public boolean equals(drop_type_args that) { + public boolean equals(create_type_args that) { if (that == null) return false; @@ -5379,8 +5568,9 @@ public class ThriftHiveMetastore { switch (field.id) { case TYPE: - if (field.type == TType.STRING) { - this.type = iprot.readString(); + if (field.type == TType.STRUCT) { + this.type = new Type(); + this.type.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -5402,7 +5592,7 @@ public class ThriftHiveMetastore { oprot.writeStructBegin(STRUCT_DESC); if (this.type != null) { oprot.writeFieldBegin(TYPE_FIELD_DESC); - oprot.writeString(this.type); + this.type.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -5411,7 +5601,7 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_type_args("); + StringBuilder sb = new StringBuilder("create_type_args("); boolean first = true; sb.append("type:"); @@ -5432,15 +5622,21 @@ public class ThriftHiveMetastore { } - public static class drop_type_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_type_result"); + public static class create_type_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("create_type_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)1); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); private boolean success; public static final int SUCCESS = 0; - private MetaException o2; - public static final int O2 = 1; + private AlreadyExistsException o1; + public static final int O1 = 1; + private InvalidObjectException o2; + public static final int O2 = 2; + private MetaException o3; + public static final int O3 = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -5450,41 +5646,55 @@ public class ThriftHiveMetastore { public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.BOOL))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); + put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(drop_type_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(create_type_result.class, metaDataMap); } - public drop_type_result() { + public create_type_result() { } - public drop_type_result( + public create_type_result( boolean success, - MetaException o2) + AlreadyExistsException o1, + InvalidObjectException o2, + MetaException o3) { this(); this.success = success; this.__isset.success = true; + this.o1 = o1; this.o2 = o2; + this.o3 = o3; } /** * Performs a deep copy on other. */ - public drop_type_result(drop_type_result other) { + public create_type_result(create_type_result other) { __isset.success = other.__isset.success; this.success = other.success; + if (other.isSetO1()) { + this.o1 = new AlreadyExistsException(other.o1); + } if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + this.o2 = new InvalidObjectException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new MetaException(other.o3); } } @Override - public drop_type_result clone() { - return new drop_type_result(this); + public create_type_result clone() { + return new create_type_result(this); } public boolean isSuccess() { @@ -5505,23 +5715,57 @@ public class ThriftHiveMetastore { return this.__isset.success; } - public MetaException getO2() { - return this.o2; + public AlreadyExistsException getO1() { + return this.o1; } - public void setO2(MetaException o2) { - this.o2 = o2; + public void setO1(AlreadyExistsException o1) { + this.o1 = o1; } - public void unsetO2() { - this.o2 = null; - } + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public InvalidObjectException getO2() { + return this.o2; + } + + public void setO2(InvalidObjectException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } // Returns true if field o2 is set (has been asigned a value) and false otherwise public boolean isSetO2() { return this.o2 != null; } + public MetaException getO3() { + return this.o3; + } + + public void setO3(MetaException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + // Returns true if field o3 is set (has been asigned a value) and false otherwise + public boolean isSetO3() { + return this.o3 != null; + } + public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: @@ -5532,11 +5776,27 @@ public class ThriftHiveMetastore { } break; + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((AlreadyExistsException)value); + } + break; + case O2: if (value == null) { unsetO2(); } else { - setO2((MetaException)value); + setO2((InvalidObjectException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((MetaException)value); } break; @@ -5550,9 +5810,15 @@ public class ThriftHiveMetastore { case SUCCESS: return new Boolean(isSuccess()); + case O1: + return getO1(); + case O2: return getO2(); + case O3: + return getO3(); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -5563,8 +5829,12 @@ public class ThriftHiveMetastore { switch (fieldID) { case SUCCESS: return isSetSuccess(); + case O1: + return isSetO1(); case O2: return isSetO2(); + case O3: + return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -5574,12 +5844,12 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_type_result) - return this.equals((drop_type_result)that); + if (that instanceof create_type_result) + return this.equals((create_type_result)that); return false; } - public boolean equals(drop_type_result that) { + public boolean equals(create_type_result that) { if (that == null) return false; @@ -5592,6 +5862,15 @@ public class ThriftHiveMetastore { return false; } + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + boolean this_present_o2 = true && this.isSetO2(); boolean that_present_o2 = true && that.isSetO2(); if (this_present_o2 || that_present_o2) { @@ -5601,6 +5880,15 @@ public class ThriftHiveMetastore { 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; } @@ -5628,14 +5916,30 @@ public class ThriftHiveMetastore { TProtocolUtil.skip(iprot, field.type); } break; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new AlreadyExistsException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new MetaException(); + this.o2 = new InvalidObjectException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; + case O3: + if (field.type == TType.STRUCT) { + this.o3 = new MetaException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -5654,10 +5958,18 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeBool(this.success); oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); } else if (this.isSetO2()) { oprot.writeFieldBegin(O2_FIELD_DESC); this.o2.write(oprot); oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -5665,13 +5977,21 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_type_result("); + StringBuilder sb = new StringBuilder("create_type_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); sb.append("o2:"); if (this.o2 == null) { sb.append("null"); @@ -5679,6 +5999,14 @@ public class ThriftHiveMetastore { 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(); } @@ -5690,74 +6018,74 @@ public class ThriftHiveMetastore { } - public static class get_type_all_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_type_all_args"); - private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); + public static class drop_type_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_type_args"); + private static final TField TYPE_FIELD_DESC = new TField("type", TType.STRING, (short)1); - private String name; - public static final int NAME = 1; + private String type; + public static final int TYPE = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + put(TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(get_type_all_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(drop_type_args.class, metaDataMap); } - public get_type_all_args() { + public drop_type_args() { } - public get_type_all_args( - String name) + public drop_type_args( + String type) { this(); - this.name = name; + this.type = type; } /** * Performs a deep copy on other. */ - public get_type_all_args(get_type_all_args other) { - if (other.isSetName()) { - this.name = other.name; + public drop_type_args(drop_type_args other) { + if (other.isSetType()) { + this.type = other.type; } } @Override - public get_type_all_args clone() { - return new get_type_all_args(this); + public drop_type_args clone() { + return new drop_type_args(this); } - public String getName() { - return this.name; + public String getType() { + return this.type; } - public void setName(String name) { - this.name = name; + public void setType(String type) { + this.type = type; } - public void unsetName() { - this.name = null; + public void unsetType() { + this.type = null; } - // Returns true if field name is set (has been asigned a value) and false otherwise - public boolean isSetName() { - return this.name != null; + // Returns true if field type is set (has been asigned a value) and false otherwise + public boolean isSetType() { + return this.type != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case NAME: + case TYPE: if (value == null) { - unsetName(); + unsetType(); } else { - setName((String)value); + setType((String)value); } break; @@ -5768,8 +6096,8 @@ public class ThriftHiveMetastore { public Object getFieldValue(int fieldID) { switch (fieldID) { - case NAME: - return getName(); + case TYPE: + return getType(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -5779,8 +6107,8 @@ public class ThriftHiveMetastore { // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case NAME: - return isSetName(); + case TYPE: + return isSetType(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -5790,21 +6118,21 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_type_all_args) - return this.equals((get_type_all_args)that); + if (that instanceof drop_type_args) + return this.equals((drop_type_args)that); return false; } - public boolean equals(get_type_all_args that) { + public boolean equals(drop_type_args that) { if (that == null) return false; - boolean this_present_name = true && this.isSetName(); - boolean that_present_name = true && that.isSetName(); - if (this_present_name || that_present_name) { - if (!(this_present_name && that_present_name)) + 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.name.equals(that.name)) + if (!this.type.equals(that.type)) return false; } @@ -5827,9 +6155,9 @@ public class ThriftHiveMetastore { } switch (field.id) { - case NAME: + case TYPE: if (field.type == TType.STRING) { - this.name = iprot.readString(); + this.type = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -5849,9 +6177,9 @@ public class ThriftHiveMetastore { validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); + if (this.type != null) { + oprot.writeFieldBegin(TYPE_FIELD_DESC); + oprot.writeString(this.type); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -5860,14 +6188,14 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("get_type_all_args("); + StringBuilder sb = new StringBuilder("drop_type_args("); boolean first = true; - sb.append("name:"); - if (this.name == null) { + sb.append("type:"); + if (this.type == null) { sb.append("null"); } else { - sb.append(this.name); + sb.append(this.type); } first = false; sb.append(")"); @@ -5881,107 +6209,111 @@ public class ThriftHiveMetastore { } - public static class get_type_all_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_type_all_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.MAP, (short)0); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)1); + public static class drop_type_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_type_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private Map success; + private boolean success; public static final int SUCCESS = 0; - private MetaException o2; - public static final int O2 = 1; + private MetaException o1; + public static final int O1 = 1; + private NoSuchObjectException o2; + public static final int O2 = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new MapMetaData(TType.MAP, - new FieldValueMetaData(TType.STRING), - new StructMetaData(TType.STRUCT, Type.class)))); + new FieldValueMetaData(TType.BOOL))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_type_all_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(drop_type_result.class, metaDataMap); } - public get_type_all_result() { + public drop_type_result() { } - public get_type_all_result( - Map success, - MetaException o2) + public drop_type_result( + boolean success, + MetaException o1, + NoSuchObjectException o2) { this(); this.success = success; + this.__isset.success = true; + this.o1 = o1; this.o2 = o2; } /** * Performs a deep copy on other. */ - public get_type_all_result(get_type_all_result other) { - if (other.isSetSuccess()) { - Map __this__success = new HashMap(); - for (Map.Entry other_element : other.success.entrySet()) { - - String other_element_key = other_element.getKey(); - Type other_element_value = other_element.getValue(); - - String __this__success_copy_key = other_element_key; - - Type __this__success_copy_value = new Type(other_element_value); - - __this__success.put(__this__success_copy_key, __this__success_copy_value); - } - this.success = __this__success; + public drop_type_result(drop_type_result other) { + __isset.success = other.__isset.success; + this.success = other.success; + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); } if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + this.o2 = new NoSuchObjectException(other.o2); } } @Override - public get_type_all_result clone() { - return new get_type_all_result(this); - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public void putToSuccess(String key, Type val) { - if (this.success == null) { - this.success = new HashMap(); - } - this.success.put(key, val); + public drop_type_result clone() { + return new drop_type_result(this); } - public Map getSuccess() { + public boolean isSuccess() { return this.success; } - public void setSuccess(Map success) { + public void setSuccess(boolean success) { this.success = success; + this.__isset.success = true; } public void unsetSuccess() { - this.success = null; + this.__isset.success = false; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { - return this.success != null; + return this.__isset.success; } - public MetaException getO2() { + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public NoSuchObjectException getO2() { return this.o2; } - public void setO2(MetaException o2) { + public void setO2(NoSuchObjectException o2) { this.o2 = o2; } @@ -6000,7 +6332,15 @@ public class ThriftHiveMetastore { if (value == null) { unsetSuccess(); } else { - setSuccess((Map)value); + setSuccess((Boolean)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); } break; @@ -6008,7 +6348,7 @@ public class ThriftHiveMetastore { if (value == null) { unsetO2(); } else { - setO2((MetaException)value); + setO2((NoSuchObjectException)value); } break; @@ -6020,7 +6360,10 @@ public class ThriftHiveMetastore { public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: - return getSuccess(); + return new Boolean(isSuccess()); + + case O1: + return getO1(); case O2: return getO2(); @@ -6035,6 +6378,8 @@ public class ThriftHiveMetastore { switch (fieldID) { case SUCCESS: return isSetSuccess(); + case O1: + return isSetO1(); case O2: return isSetO2(); default: @@ -6046,21 +6391,30 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_type_all_result) - return this.equals((get_type_all_result)that); + if (that instanceof drop_type_result) + return this.equals((drop_type_result)that); return false; } - public boolean equals(get_type_all_result that) { + public boolean equals(drop_type_result that) { if (that == null) return false; - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); + boolean this_present_success = true; + boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (!this.success.equals(that.success)) + if (this.success != that.success) + return false; + } + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) return false; } @@ -6093,28 +6447,24 @@ public class ThriftHiveMetastore { switch (field.id) { case SUCCESS: - if (field.type == TType.MAP) { - { - TMap _map61 = iprot.readMapBegin(); - this.success = new HashMap(2*_map61.size); - for (int _i62 = 0; _i62 < _map61.size; ++_i62) - { - String _key63; - Type _val64; - _key63 = iprot.readString(); - _val64 = new Type(); - _val64.read(iprot); - this.success.put(_key63, _val64); - } - iprot.readMapEnd(); - } + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + this.__isset.success = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new MetaException(); + this.o2 = new NoSuchObjectException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -6136,14 +6486,11 @@ public class ThriftHiveMetastore { if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new TMap(TType.STRING, TType.STRUCT, this.success.size())); - for (Map.Entry _iter65 : this.success.entrySet()) { - oprot.writeString(_iter65.getKey()); - _iter65.getValue().write(oprot); - } - oprot.writeMapEnd(); - } + oprot.writeBool(this.success); + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetO2()) { oprot.writeFieldBegin(O2_FIELD_DESC); @@ -6156,14 +6503,18 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("get_type_all_result("); + StringBuilder sb = new StringBuilder("drop_type_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { sb.append("null"); } else { - sb.append(this.success); + sb.append(this.o1); } first = false; if (!first) sb.append(", "); @@ -6185,109 +6536,74 @@ public class ThriftHiveMetastore { } - public static class get_fields_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_fields_args"); - private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TABLE_NAME_FIELD_DESC = new TField("table_name", TType.STRING, (short)2); + public static class get_type_all_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_type_all_args"); + private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); - private String db_name; - public static final int DB_NAME = 1; - private String table_name; - public static final int TABLE_NAME = 2; + private String name; + public static final int NAME = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(TABLE_NAME, new FieldMetaData("table_name", TFieldRequirementType.DEFAULT, + put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(get_fields_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_type_all_args.class, metaDataMap); } - public get_fields_args() { + public get_type_all_args() { } - public get_fields_args( - String db_name, - String table_name) + public get_type_all_args( + String name) { this(); - this.db_name = db_name; - this.table_name = table_name; + this.name = name; } /** * Performs a deep copy on other. */ - public get_fields_args(get_fields_args other) { - if (other.isSetDb_name()) { - this.db_name = other.db_name; - } - if (other.isSetTable_name()) { - this.table_name = other.table_name; + public get_type_all_args(get_type_all_args other) { + if (other.isSetName()) { + this.name = other.name; } } @Override - public get_fields_args clone() { - return new get_fields_args(this); - } - - public String getDb_name() { - return this.db_name; - } - - public void setDb_name(String db_name) { - this.db_name = db_name; - } - - public void unsetDb_name() { - this.db_name = null; - } - - // Returns true if field db_name is set (has been asigned a value) and false otherwise - public boolean isSetDb_name() { - return this.db_name != null; + public get_type_all_args clone() { + return new get_type_all_args(this); } - public String getTable_name() { - return this.table_name; + public String getName() { + return this.name; } - public void setTable_name(String table_name) { - this.table_name = table_name; + public void setName(String name) { + this.name = name; } - public void unsetTable_name() { - this.table_name = null; + public void unsetName() { + this.name = null; } - // Returns true if field table_name is set (has been asigned a value) and false otherwise - public boolean isSetTable_name() { - return this.table_name != null; + // Returns true if field name is set (has been asigned a value) and false otherwise + public boolean isSetName() { + return this.name != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DB_NAME: - if (value == null) { - unsetDb_name(); - } else { - setDb_name((String)value); - } - break; - - case TABLE_NAME: + case NAME: if (value == null) { - unsetTable_name(); + unsetName(); } else { - setTable_name((String)value); + setName((String)value); } break; @@ -6298,11 +6614,8 @@ public class ThriftHiveMetastore { public Object getFieldValue(int fieldID) { switch (fieldID) { - case DB_NAME: - return getDb_name(); - - case TABLE_NAME: - return getTable_name(); + case NAME: + return getName(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -6312,10 +6625,8 @@ public class ThriftHiveMetastore { // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DB_NAME: - return isSetDb_name(); - case TABLE_NAME: - return isSetTable_name(); + case NAME: + return isSetName(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -6325,30 +6636,21 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_fields_args) - return this.equals((get_fields_args)that); + if (that instanceof get_type_all_args) + return this.equals((get_type_all_args)that); return false; } - public boolean equals(get_fields_args that) { + public boolean equals(get_type_all_args that) { if (that == null) return false; - boolean this_present_db_name = true && this.isSetDb_name(); - boolean that_present_db_name = true && that.isSetDb_name(); - if (this_present_db_name || that_present_db_name) { - if (!(this_present_db_name && that_present_db_name)) - return false; - if (!this.db_name.equals(that.db_name)) - return false; - } - - boolean this_present_table_name = true && this.isSetTable_name(); - boolean that_present_table_name = true && that.isSetTable_name(); - if (this_present_table_name || that_present_table_name) { - if (!(this_present_table_name && that_present_table_name)) + boolean this_present_name = true && this.isSetName(); + boolean that_present_name = true && that.isSetName(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) return false; - if (!this.table_name.equals(that.table_name)) + if (!this.name.equals(that.name)) return false; } @@ -6371,16 +6673,9 @@ public class ThriftHiveMetastore { } switch (field.id) { - case DB_NAME: - if (field.type == TType.STRING) { - this.db_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case TABLE_NAME: + case NAME: if (field.type == TType.STRING) { - this.table_name = iprot.readString(); + this.name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -6400,14 +6695,9 @@ public class ThriftHiveMetastore { validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.db_name != null) { - oprot.writeFieldBegin(DB_NAME_FIELD_DESC); - oprot.writeString(this.db_name); - oprot.writeFieldEnd(); - } - if (this.table_name != null) { - oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); - oprot.writeString(this.table_name); + if (this.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(this.name); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -6416,22 +6706,14 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("get_fields_args("); + StringBuilder sb = new StringBuilder("get_type_all_args("); boolean first = true; - sb.append("db_name:"); - if (this.db_name == null) { - sb.append("null"); - } else { - sb.append(this.db_name); - } - first = false; - if (!first) sb.append(", "); - sb.append("table_name:"); - if (this.table_name == null) { + sb.append("name:"); + if (this.name == null) { sb.append("null"); } else { - sb.append(this.table_name); + sb.append(this.name); } first = false; sb.append(")"); @@ -6445,21 +6727,15 @@ public class ThriftHiveMetastore { } - public static class get_fields_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_fields_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); - private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); + public static class get_type_all_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_type_all_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.MAP, (short)0); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)1); - private List success; + private Map success; public static final int SUCCESS = 0; - private MetaException o1; - public static final int O1 = 1; - private UnknownTableException o2; - public static final int O2 = 2; - private UnknownDBException o3; - public static final int O3 = 3; + private MetaException o2; + public static final int O2 = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -6467,83 +6743,74 @@ public class ThriftHiveMetastore { public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new StructMetaData(TType.STRUCT, FieldSchema.class)))); - put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), + new StructMetaData(TType.STRUCT, Type.class)))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_fields_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_type_all_result.class, metaDataMap); } - public get_fields_result() { + public get_type_all_result() { } - public get_fields_result( - List success, - MetaException o1, - UnknownTableException o2, - UnknownDBException o3) + public get_type_all_result( + Map success, + MetaException o2) { this(); this.success = success; - this.o1 = o1; this.o2 = o2; - this.o3 = o3; } /** * Performs a deep copy on other. */ - public get_fields_result(get_fields_result other) { + public get_type_all_result(get_type_all_result other) { if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (FieldSchema other_element : other.success) { - __this__success.add(new FieldSchema(other_element)); + Map __this__success = new HashMap(); + for (Map.Entry other_element : other.success.entrySet()) { + + String other_element_key = other_element.getKey(); + Type other_element_value = other_element.getValue(); + + String __this__success_copy_key = other_element_key; + + Type __this__success_copy_value = new Type(other_element_value); + + __this__success.put(__this__success_copy_key, __this__success_copy_value); } this.success = __this__success; } - if (other.isSetO1()) { - this.o1 = new MetaException(other.o1); - } if (other.isSetO2()) { - this.o2 = new UnknownTableException(other.o2); - } - if (other.isSetO3()) { - this.o3 = new UnknownDBException(other.o3); + this.o2 = new MetaException(other.o2); } } @Override - public get_fields_result clone() { - return new get_fields_result(this); + public get_type_all_result clone() { + return new get_type_all_result(this); } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(FieldSchema elem) { + public void putToSuccess(String key, Type val) { if (this.success == null) { - this.success = new ArrayList(); + this.success = new HashMap(); } - this.success.add(elem); + this.success.put(key, val); } - public List getSuccess() { + public Map getSuccess() { return this.success; } - public void setSuccess(List success) { + public void setSuccess(Map success) { this.success = success; } @@ -6556,28 +6823,11 @@ public class ThriftHiveMetastore { return this.success != null; } - public MetaException getO1() { - return this.o1; - } - - public void setO1(MetaException o1) { - this.o1 = o1; - } - - public void unsetO1() { - this.o1 = null; - } - - // Returns true if field o1 is set (has been asigned a value) and false otherwise - public boolean isSetO1() { - return this.o1 != null; - } - - public UnknownTableException getO2() { + public MetaException getO2() { return this.o2; } - public void setO2(UnknownTableException o2) { + public void setO2(MetaException o2) { this.o2 = o2; } @@ -6590,38 +6840,13 @@ public class ThriftHiveMetastore { return this.o2 != null; } - public UnknownDBException getO3() { - return this.o3; - } - - public void setO3(UnknownDBException o3) { - this.o3 = o3; - } - - public void unsetO3() { - this.o3 = null; - } - - // Returns true if field o3 is set (has been asigned a value) and false otherwise - public boolean isSetO3() { - return this.o3 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); - } - break; - - case O1: - if (value == null) { - unsetO1(); - } else { - setO1((MetaException)value); + setSuccess((Map)value); } break; @@ -6629,15 +6854,7 @@ public class ThriftHiveMetastore { if (value == null) { unsetO2(); } else { - setO2((UnknownTableException)value); - } - break; - - case O3: - if (value == null) { - unsetO3(); - } else { - setO3((UnknownDBException)value); + setO2((MetaException)value); } break; @@ -6651,15 +6868,9 @@ public class ThriftHiveMetastore { case SUCCESS: return getSuccess(); - case O1: - return getO1(); - case O2: return getO2(); - case O3: - return getO3(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -6670,12 +6881,8 @@ public class ThriftHiveMetastore { switch (fieldID) { case SUCCESS: return isSetSuccess(); - case O1: - return isSetO1(); case O2: return isSetO2(); - case O3: - return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -6685,12 +6892,12 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_fields_result) - return this.equals((get_fields_result)that); + if (that instanceof get_type_all_result) + return this.equals((get_type_all_result)that); return false; } - public boolean equals(get_fields_result that) { + public boolean equals(get_type_all_result that) { if (that == null) return false; @@ -6703,15 +6910,6 @@ public class ThriftHiveMetastore { return false; } - boolean this_present_o1 = true && this.isSetO1(); - boolean that_present_o1 = true && that.isSetO1(); - if (this_present_o1 || that_present_o1) { - if (!(this_present_o1 && that_present_o1)) - return false; - if (!this.o1.equals(that.o1)) - return false; - } - boolean this_present_o2 = true && this.isSetO2(); boolean that_present_o2 = true && that.isSetO2(); if (this_present_o2 || that_present_o2) { @@ -6721,15 +6919,6 @@ public class ThriftHiveMetastore { 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; } @@ -6750,43 +6939,29 @@ public class ThriftHiveMetastore { switch (field.id) { case SUCCESS: - if (field.type == TType.LIST) { + if (field.type == TType.MAP) { { - TList _list66 = iprot.readListBegin(); - this.success = new ArrayList(_list66.size); - for (int _i67 = 0; _i67 < _list66.size; ++_i67) + TMap _map65 = iprot.readMapBegin(); + this.success = new HashMap(2*_map65.size); + for (int _i66 = 0; _i66 < _map65.size; ++_i66) { - FieldSchema _elem68; - _elem68 = new FieldSchema(); - _elem68.read(iprot); - this.success.add(_elem68); + String _key67; + Type _val68; + _key67 = iprot.readString(); + _val68 = new Type(); + _val68.read(iprot); + this.success.put(_key67, _val68); } - iprot.readListEnd(); + iprot.readMapEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; - case O1: + case O2: if (field.type == TType.STRUCT) { - this.o1 = new MetaException(); - this.o1.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case O2: - if (field.type == TType.STRUCT) { - this.o2 = new UnknownTableException(); - this.o2.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case O3: - if (field.type == TType.STRUCT) { - this.o3 = new UnknownDBException(); - this.o3.read(iprot); + this.o2 = new MetaException(); + this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -6808,25 +6983,18 @@ public class ThriftHiveMetastore { if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { - oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (FieldSchema _iter69 : this.success) { - _iter69.write(oprot); + oprot.writeMapBegin(new TMap(TType.STRING, TType.STRUCT, this.success.size())); + for (Map.Entry _iter69 : this.success.entrySet()) { + oprot.writeString(_iter69.getKey()); + _iter69.getValue().write(oprot); } - oprot.writeListEnd(); + oprot.writeMapEnd(); } oprot.writeFieldEnd(); - } else if (this.isSetO1()) { - oprot.writeFieldBegin(O1_FIELD_DESC); - this.o1.write(oprot); - oprot.writeFieldEnd(); } else if (this.isSetO2()) { oprot.writeFieldBegin(O2_FIELD_DESC); this.o2.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO3()) { - oprot.writeFieldBegin(O3_FIELD_DESC); - this.o3.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -6834,7 +7002,7 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("get_fields_result("); + StringBuilder sb = new StringBuilder("get_type_all_result("); boolean first = true; sb.append("success:"); @@ -6845,14 +7013,6 @@ public class ThriftHiveMetastore { } first = false; if (!first) sb.append(", "); - sb.append("o1:"); - if (this.o1 == null) { - sb.append("null"); - } else { - sb.append(this.o1); - } - first = false; - if (!first) sb.append(", "); sb.append("o2:"); if (this.o2 == null) { sb.append("null"); @@ -6860,14 +7020,6 @@ public class ThriftHiveMetastore { 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(); } @@ -6879,8 +7031,8 @@ public class ThriftHiveMetastore { } - public static class get_schema_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_schema_args"); + public static class get_fields_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_fields_args"); private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); private static final TField TABLE_NAME_FIELD_DESC = new TField("table_name", TType.STRING, (short)2); @@ -6901,13 +7053,13 @@ public class ThriftHiveMetastore { }}); static { - FieldMetaData.addStructMetaDataMap(get_schema_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_fields_args.class, metaDataMap); } - public get_schema_args() { + public get_fields_args() { } - public get_schema_args( + public get_fields_args( String db_name, String table_name) { @@ -6919,7 +7071,7 @@ public class ThriftHiveMetastore { /** * Performs a deep copy on other. */ - public get_schema_args(get_schema_args other) { + public get_fields_args(get_fields_args other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } @@ -6929,8 +7081,8 @@ public class ThriftHiveMetastore { } @Override - public get_schema_args clone() { - return new get_schema_args(this); + public get_fields_args clone() { + return new get_fields_args(this); } public String getDb_name() { @@ -7019,12 +7171,12 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_schema_args) - return this.equals((get_schema_args)that); + if (that instanceof get_fields_args) + return this.equals((get_fields_args)that); return false; } - public boolean equals(get_schema_args that) { + public boolean equals(get_fields_args that) { if (that == null) return false; @@ -7110,7 +7262,7 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("get_schema_args("); + StringBuilder sb = new StringBuilder("get_fields_args("); boolean first = true; sb.append("db_name:"); @@ -7139,8 +7291,8 @@ public class ThriftHiveMetastore { } - public static class get_schema_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_schema_result"); + public static class get_fields_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_fields_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); @@ -7172,13 +7324,13 @@ public class ThriftHiveMetastore { }}); static { - FieldMetaData.addStructMetaDataMap(get_schema_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_fields_result.class, metaDataMap); } - public get_schema_result() { + public get_fields_result() { } - public get_schema_result( + public get_fields_result( List success, MetaException o1, UnknownTableException o2, @@ -7194,7 +7346,7 @@ public class ThriftHiveMetastore { /** * Performs a deep copy on other. */ - public get_schema_result(get_schema_result other) { + public get_fields_result(get_fields_result other) { if (other.isSetSuccess()) { List __this__success = new ArrayList(); for (FieldSchema other_element : other.success) { @@ -7214,8 +7366,8 @@ public class ThriftHiveMetastore { } @Override - public get_schema_result clone() { - return new get_schema_result(this); + public get_fields_result clone() { + return new get_fields_result(this); } public int getSuccessSize() { @@ -7379,12 +7531,12 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_schema_result) - return this.equals((get_schema_result)that); + if (that instanceof get_fields_result) + return this.equals((get_fields_result)that); return false; } - public boolean equals(get_schema_result that) { + public boolean equals(get_fields_result that) { if (that == null) return false; @@ -7528,7 +7680,7 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("get_schema_result("); + StringBuilder sb = new StringBuilder("get_fields_result("); boolean first = true; sb.append("success:"); @@ -7573,74 +7725,109 @@ public class ThriftHiveMetastore { } - public static class create_table_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("create_table_args"); - private static final TField TBL_FIELD_DESC = new TField("tbl", TType.STRUCT, (short)1); + public static class get_schema_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_schema_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TABLE_NAME_FIELD_DESC = new TField("table_name", TType.STRING, (short)2); - private Table tbl; - public static final int TBL = 1; + private String db_name; + public static final int DB_NAME = 1; + private String table_name; + public static final int TABLE_NAME = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(TBL, new FieldMetaData("tbl", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Table.class))); + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TABLE_NAME, new FieldMetaData("table_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(create_table_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_schema_args.class, metaDataMap); } - public create_table_args() { + public get_schema_args() { } - public create_table_args( - Table tbl) + public get_schema_args( + String db_name, + String table_name) { this(); - this.tbl = tbl; + this.db_name = db_name; + this.table_name = table_name; } /** * Performs a deep copy on other. */ - public create_table_args(create_table_args other) { - if (other.isSetTbl()) { - this.tbl = new Table(other.tbl); + public get_schema_args(get_schema_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTable_name()) { + this.table_name = other.table_name; } } @Override - public create_table_args clone() { - return new create_table_args(this); + public get_schema_args clone() { + return new get_schema_args(this); } - public Table getTbl() { - return this.tbl; + public String getDb_name() { + return this.db_name; } - public void setTbl(Table tbl) { - this.tbl = tbl; + public void setDb_name(String db_name) { + this.db_name = db_name; } - public void unsetTbl() { - this.tbl = null; + public void unsetDb_name() { + this.db_name = null; } - // Returns true if field tbl is set (has been asigned a value) and false otherwise - public boolean isSetTbl() { - return this.tbl != null; + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getTable_name() { + return this.table_name; + } + + public void setTable_name(String table_name) { + this.table_name = table_name; + } + + public void unsetTable_name() { + this.table_name = null; + } + + // Returns true if field table_name is set (has been asigned a value) and false otherwise + public boolean isSetTable_name() { + return this.table_name != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case TBL: + case DB_NAME: if (value == null) { - unsetTbl(); + unsetDb_name(); } else { - setTbl((Table)value); + setDb_name((String)value); + } + break; + + case TABLE_NAME: + if (value == null) { + unsetTable_name(); + } else { + setTable_name((String)value); } break; @@ -7651,8 +7838,11 @@ public class ThriftHiveMetastore { public Object getFieldValue(int fieldID) { switch (fieldID) { - case TBL: - return getTbl(); + case DB_NAME: + return getDb_name(); + + case TABLE_NAME: + return getTable_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -7662,8 +7852,10 @@ public class ThriftHiveMetastore { // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case TBL: - return isSetTbl(); + case DB_NAME: + return isSetDb_name(); + case TABLE_NAME: + return isSetTable_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -7673,21 +7865,30 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof create_table_args) - return this.equals((create_table_args)that); + if (that instanceof get_schema_args) + return this.equals((get_schema_args)that); return false; } - public boolean equals(create_table_args that) { + public boolean equals(get_schema_args that) { if (that == null) return false; - boolean this_present_tbl = true && this.isSetTbl(); - boolean that_present_tbl = true && that.isSetTbl(); - if (this_present_tbl || that_present_tbl) { - if (!(this_present_tbl && that_present_tbl)) + boolean this_present_db_name = true && this.isSetDb_name(); + boolean that_present_db_name = true && that.isSetDb_name(); + if (this_present_db_name || that_present_db_name) { + if (!(this_present_db_name && that_present_db_name)) return false; - if (!this.tbl.equals(that.tbl)) + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_table_name = true && this.isSetTable_name(); + boolean that_present_table_name = true && that.isSetTable_name(); + if (this_present_table_name || that_present_table_name) { + if (!(this_present_table_name && that_present_table_name)) + return false; + if (!this.table_name.equals(that.table_name)) return false; } @@ -7710,10 +7911,16 @@ public class ThriftHiveMetastore { } switch (field.id) { - case TBL: - if (field.type == TType.STRUCT) { - this.tbl = new Table(); - this.tbl.read(iprot); + case DB_NAME: + if (field.type == TType.STRING) { + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TABLE_NAME: + if (field.type == TType.STRING) { + this.table_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -7733,9 +7940,14 @@ public class ThriftHiveMetastore { validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.tbl != null) { - oprot.writeFieldBegin(TBL_FIELD_DESC); - this.tbl.write(oprot); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.table_name != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(this.table_name); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -7744,14 +7956,22 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("create_table_args("); + StringBuilder sb = new StringBuilder("get_schema_args("); boolean first = true; - sb.append("tbl:"); - if (this.tbl == null) { + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.tbl); + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("table_name:"); + if (this.table_name == null) { + sb.append("null"); + } else { + sb.append(this.table_name); } first = false; sb.append(")"); @@ -7765,85 +7985,122 @@ public class ThriftHiveMetastore { } - public static class create_table_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("create_table_result"); + public static class get_schema_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_schema_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); - private static final TField O4_FIELD_DESC = new TField("o4", TType.STRUCT, (short)4); - private AlreadyExistsException o1; + private List success; + public static final int SUCCESS = 0; + private MetaException o1; public static final int O1 = 1; - private InvalidObjectException o2; + private UnknownTableException o2; public static final int O2 = 2; - private MetaException o3; + private UnknownDBException o3; public static final int O3 = 3; - private NoSuchObjectException o4; - public static final int O4 = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, FieldSchema.class)))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O4, new FieldMetaData("o4", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(create_table_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_schema_result.class, metaDataMap); } - public create_table_result() { + public get_schema_result() { } - public create_table_result( - AlreadyExistsException o1, - InvalidObjectException o2, - MetaException o3, - NoSuchObjectException o4) + public get_schema_result( + List success, + MetaException o1, + UnknownTableException o2, + UnknownDBException o3) { this(); + this.success = success; this.o1 = o1; this.o2 = o2; this.o3 = o3; - this.o4 = o4; } /** * Performs a deep copy on other. */ - public create_table_result(create_table_result other) { + public get_schema_result(get_schema_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (FieldSchema other_element : other.success) { + __this__success.add(new FieldSchema(other_element)); + } + this.success = __this__success; + } if (other.isSetO1()) { - this.o1 = new AlreadyExistsException(other.o1); + this.o1 = new MetaException(other.o1); } if (other.isSetO2()) { - this.o2 = new InvalidObjectException(other.o2); + this.o2 = new UnknownTableException(other.o2); } if (other.isSetO3()) { - this.o3 = new MetaException(other.o3); - } - if (other.isSetO4()) { - this.o4 = new NoSuchObjectException(other.o4); + this.o3 = new UnknownDBException(other.o3); } } @Override - public create_table_result clone() { - return new create_table_result(this); + public get_schema_result clone() { + return new get_schema_result(this); } - public AlreadyExistsException getO1() { + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(FieldSchema elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public MetaException getO1() { return this.o1; } - public void setO1(AlreadyExistsException o1) { + public void setO1(MetaException o1) { this.o1 = o1; } @@ -7856,11 +8113,11 @@ public class ThriftHiveMetastore { return this.o1 != null; } - public InvalidObjectException getO2() { + public UnknownTableException getO2() { return this.o2; } - public void setO2(InvalidObjectException o2) { + public void setO2(UnknownTableException o2) { this.o2 = o2; } @@ -7873,11 +8130,11 @@ public class ThriftHiveMetastore { return this.o2 != null; } - public MetaException getO3() { + public UnknownDBException getO3() { return this.o3; } - public void setO3(MetaException o3) { + public void setO3(UnknownDBException o3) { this.o3 = o3; } @@ -7890,30 +8147,21 @@ public class ThriftHiveMetastore { return this.o3 != null; } - public NoSuchObjectException getO4() { - return this.o4; - } - - public void setO4(NoSuchObjectException o4) { - this.o4 = o4; - } - - public void unsetO4() { - this.o4 = null; - } - - // Returns true if field o4 is set (has been asigned a value) and false otherwise - public boolean isSetO4() { - return this.o4 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + case O1: if (value == null) { unsetO1(); } else { - setO1((AlreadyExistsException)value); + setO1((MetaException)value); } break; @@ -7921,7 +8169,7 @@ public class ThriftHiveMetastore { if (value == null) { unsetO2(); } else { - setO2((InvalidObjectException)value); + setO2((UnknownTableException)value); } break; @@ -7929,15 +8177,7 @@ public class ThriftHiveMetastore { if (value == null) { unsetO3(); } else { - setO3((MetaException)value); - } - break; - - case O4: - if (value == null) { - unsetO4(); - } else { - setO4((NoSuchObjectException)value); + setO3((UnknownDBException)value); } break; @@ -7948,6 +8188,9 @@ public class ThriftHiveMetastore { public Object getFieldValue(int fieldID) { switch (fieldID) { + case SUCCESS: + return getSuccess(); + case O1: return getO1(); @@ -7957,9 +8200,6 @@ public class ThriftHiveMetastore { case O3: return getO3(); - case O4: - return getO4(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -7968,14 +8208,14 @@ public class ThriftHiveMetastore { // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { + case SUCCESS: + return isSetSuccess(); case O1: return isSetO1(); case O2: return isSetO2(); case O3: return isSetO3(); - case O4: - return isSetO4(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -7985,15 +8225,24 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof create_table_result) - return this.equals((create_table_result)that); + if (that instanceof get_schema_result) + return this.equals((get_schema_result)that); return false; } - public boolean equals(create_table_result that) { + public boolean equals(get_schema_result that) { if (that == null) return false; + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + boolean this_present_o1 = true && this.isSetO1(); boolean that_present_o1 = true && that.isSetO1(); if (this_present_o1 || that_present_o1) { @@ -8021,15 +8270,6 @@ public class ThriftHiveMetastore { return false; } - boolean this_present_o4 = true && this.isSetO4(); - boolean that_present_o4 = true && that.isSetO4(); - if (this_present_o4 || that_present_o4) { - if (!(this_present_o4 && that_present_o4)) - return false; - if (!this.o4.equals(that.o4)) - return false; - } - return true; } @@ -8049,9 +8289,27 @@ public class ThriftHiveMetastore { } switch (field.id) { + case SUCCESS: + if (field.type == TType.LIST) { + { + TList _list74 = iprot.readListBegin(); + this.success = new ArrayList(_list74.size); + for (int _i75 = 0; _i75 < _list74.size; ++_i75) + { + FieldSchema _elem76; + _elem76 = new FieldSchema(); + _elem76.read(iprot); + this.success.add(_elem76); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; case O1: if (field.type == TType.STRUCT) { - this.o1 = new AlreadyExistsException(); + this.o1 = new MetaException(); this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -8059,7 +8317,7 @@ public class ThriftHiveMetastore { break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new InvalidObjectException(); + this.o2 = new UnknownTableException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -8067,20 +8325,12 @@ public class ThriftHiveMetastore { break; case O3: if (field.type == TType.STRUCT) { - this.o3 = new MetaException(); + this.o3 = new UnknownDBException(); this.o3.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O4: - if (field.type == TType.STRUCT) { - this.o4 = new NoSuchObjectException(); - this.o4.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -8095,7 +8345,17 @@ public class ThriftHiveMetastore { public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); - if (this.isSetO1()) { + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); + for (FieldSchema _iter77 : this.success) { + _iter77.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); @@ -8107,10 +8367,6 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(O3_FIELD_DESC); this.o3.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO4()) { - oprot.writeFieldBegin(O4_FIELD_DESC); - this.o4.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -8118,9 +8374,17 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("create_table_result("); + StringBuilder sb = new StringBuilder("get_schema_result("); boolean first = true; + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); sb.append("o1:"); if (this.o1 == null) { sb.append("null"); @@ -8144,14 +8408,6 @@ public class ThriftHiveMetastore { sb.append(this.o3); } first = false; - if (!first) sb.append(", "); - sb.append("o4:"); - if (this.o4 == null) { - sb.append("null"); - } else { - sb.append(this.o4); - } - first = false; sb.append(")"); return sb.toString(); } @@ -8163,146 +8419,1285 @@ public class ThriftHiveMetastore { } - public static class drop_table_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_table_args"); - private static final TField DBNAME_FIELD_DESC = new TField("dbname", TType.STRING, (short)1); - private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)2); - private static final TField DELETE_DATA_FIELD_DESC = new TField("deleteData", TType.BOOL, (short)3); + public static class create_table_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("create_table_args"); + private static final TField TBL_FIELD_DESC = new TField("tbl", TType.STRUCT, (short)1); - private String dbname; - public static final int DBNAME = 1; - private String name; - public static final int NAME = 2; - private boolean deleteData; - public static final int DELETEDATA = 3; + private Table tbl; + public static final int TBL = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean deleteData = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DBNAME, new FieldMetaData("dbname", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(DELETEDATA, new FieldMetaData("deleteData", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); + put(TBL, new FieldMetaData("tbl", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Table.class))); }}); static { - FieldMetaData.addStructMetaDataMap(drop_table_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(create_table_args.class, metaDataMap); } - public drop_table_args() { + public create_table_args() { } - public drop_table_args( - String dbname, - String name, - boolean deleteData) + public create_table_args( + Table tbl) { this(); - this.dbname = dbname; - this.name = name; - this.deleteData = deleteData; - this.__isset.deleteData = true; + this.tbl = tbl; } /** * Performs a deep copy on other. */ - public drop_table_args(drop_table_args other) { - if (other.isSetDbname()) { - this.dbname = other.dbname; + public create_table_args(create_table_args other) { + if (other.isSetTbl()) { + this.tbl = new Table(other.tbl); } - if (other.isSetName()) { - this.name = other.name; + } + + @Override + public create_table_args clone() { + return new create_table_args(this); + } + + public Table getTbl() { + return this.tbl; + } + + public void setTbl(Table tbl) { + this.tbl = tbl; + } + + public void unsetTbl() { + this.tbl = null; + } + + // Returns true if field tbl is set (has been asigned a value) and false otherwise + public boolean isSetTbl() { + return this.tbl != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TBL: + if (value == null) { + unsetTbl(); + } else { + setTbl((Table)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TBL: + return getTbl(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TBL: + return isSetTbl(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } - __isset.deleteData = other.__isset.deleteData; - this.deleteData = other.deleteData; } @Override - public drop_table_args clone() { - return new drop_table_args(this); + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof create_table_args) + return this.equals((create_table_args)that); + return false; } - public String getDbname() { - return this.dbname; + public boolean equals(create_table_args that) { + if (that == null) + return false; + + boolean this_present_tbl = true && this.isSetTbl(); + boolean that_present_tbl = true && that.isSetTbl(); + if (this_present_tbl || that_present_tbl) { + if (!(this_present_tbl && that_present_tbl)) + return false; + if (!this.tbl.equals(that.tbl)) + return false; + } + + return true; } - public void setDbname(String dbname) { - this.dbname = dbname; + @Override + public int hashCode() { + return 0; } - public void unsetDbname() { - this.dbname = null; + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case TBL: + if (field.type == TType.STRUCT) { + this.tbl = new Table(); + this.tbl.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); } - // Returns true if field dbname is set (has been asigned a value) and false otherwise - public boolean isSetDbname() { - return this.dbname != null; + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.tbl != null) { + oprot.writeFieldBegin(TBL_FIELD_DESC); + this.tbl.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); } - public String getName() { - return this.name; + @Override + public String toString() { + StringBuilder sb = new StringBuilder("create_table_args("); + boolean first = true; + + sb.append("tbl:"); + if (this.tbl == null) { + sb.append("null"); + } else { + sb.append(this.tbl); + } + first = false; + sb.append(")"); + return sb.toString(); } - public void setName(String name) { - this.name = name; + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values } - public void unsetName() { - this.name = null; + } + + public static class create_table_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("create_table_result"); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); + private static final TField O4_FIELD_DESC = new TField("o4", TType.STRUCT, (short)4); + + private AlreadyExistsException o1; + public static final int O1 = 1; + private InvalidObjectException o2; + public static final int O2 = 2; + private MetaException o3; + public static final int O3 = 3; + private NoSuchObjectException o4; + public static final int O4 = 4; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { } - // Returns true if field name is set (has been asigned a value) and false otherwise - public boolean isSetName() { - return this.name != null; + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O4, new FieldMetaData("o4", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(create_table_result.class, metaDataMap); } - public boolean isDeleteData() { - return this.deleteData; + public create_table_result() { } - public void setDeleteData(boolean deleteData) { - this.deleteData = deleteData; - this.__isset.deleteData = true; + public create_table_result( + AlreadyExistsException o1, + InvalidObjectException o2, + MetaException o3, + NoSuchObjectException o4) + { + this(); + this.o1 = o1; + this.o2 = o2; + this.o3 = o3; + this.o4 = o4; } - public void unsetDeleteData() { - this.__isset.deleteData = false; + /** + * Performs a deep copy on other. + */ + public create_table_result(create_table_result other) { + if (other.isSetO1()) { + this.o1 = new AlreadyExistsException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new InvalidObjectException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new MetaException(other.o3); + } + if (other.isSetO4()) { + this.o4 = new NoSuchObjectException(other.o4); + } + } + + @Override + public create_table_result clone() { + return new create_table_result(this); + } + + public AlreadyExistsException getO1() { + return this.o1; + } + + public void setO1(AlreadyExistsException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public InvalidObjectException getO2() { + return this.o2; + } + + public void setO2(InvalidObjectException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; + } + + public MetaException getO3() { + return this.o3; + } + + public void setO3(MetaException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + // Returns true if field o3 is set (has been asigned a value) and false otherwise + public boolean isSetO3() { + return this.o3 != null; + } + + public NoSuchObjectException getO4() { + return this.o4; + } + + public void setO4(NoSuchObjectException o4) { + this.o4 = o4; + } + + public void unsetO4() { + this.o4 = null; + } + + // Returns true if field o4 is set (has been asigned a value) and false otherwise + public boolean isSetO4() { + return this.o4 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((AlreadyExistsException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((InvalidObjectException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((MetaException)value); + } + break; + + case O4: + if (value == null) { + unsetO4(); + } else { + setO4((NoSuchObjectException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case O1: + return getO1(); + + case O2: + return getO2(); + + case O3: + return getO3(); + + case O4: + return getO4(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case O1: + return isSetO1(); + case O2: + return isSetO2(); + case O3: + return isSetO3(); + case O4: + return isSetO4(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof create_table_result) + return this.equals((create_table_result)that); + return false; + } + + public boolean equals(create_table_result that) { + if (that == null) + return false; + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + 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; + } + + boolean this_present_o4 = true && this.isSetO4(); + boolean that_present_o4 = true && that.isSetO4(); + if (this_present_o4 || that_present_o4) { + if (!(this_present_o4 && that_present_o4)) + return false; + if (!this.o4.equals(that.o4)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new AlreadyExistsException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new InvalidObjectException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O3: + if (field.type == TType.STRUCT) { + this.o3 = new MetaException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O4: + if (field.type == TType.STRUCT) { + this.o4 = new NoSuchObjectException(); + this.o4.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO4()) { + oprot.writeFieldBegin(O4_FIELD_DESC); + this.o4.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("create_table_result("); + boolean first = true; + + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + 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; + if (!first) sb.append(", "); + sb.append("o4:"); + if (this.o4 == null) { + sb.append("null"); + } else { + sb.append(this.o4); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class drop_table_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_table_args"); + private static final TField DBNAME_FIELD_DESC = new TField("dbname", TType.STRING, (short)1); + private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)2); + private static final TField DELETE_DATA_FIELD_DESC = new TField("deleteData", TType.BOOL, (short)3); + + private String dbname; + public static final int DBNAME = 1; + private String name; + public static final int NAME = 2; + private boolean deleteData; + public static final int DELETEDATA = 3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + public boolean deleteData = false; + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(DBNAME, new FieldMetaData("dbname", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(DELETEDATA, new FieldMetaData("deleteData", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(drop_table_args.class, metaDataMap); + } + + public drop_table_args() { + } + + public drop_table_args( + String dbname, + String name, + boolean deleteData) + { + this(); + this.dbname = dbname; + this.name = name; + this.deleteData = deleteData; + this.__isset.deleteData = true; + } + + /** + * Performs a deep copy on other. + */ + public drop_table_args(drop_table_args other) { + if (other.isSetDbname()) { + this.dbname = other.dbname; + } + if (other.isSetName()) { + this.name = other.name; + } + __isset.deleteData = other.__isset.deleteData; + this.deleteData = other.deleteData; + } + + @Override + public drop_table_args clone() { + return new drop_table_args(this); + } + + public String getDbname() { + return this.dbname; + } + + public void setDbname(String dbname) { + this.dbname = dbname; + } + + public void unsetDbname() { + this.dbname = null; + } + + // Returns true if field dbname is set (has been asigned a value) and false otherwise + public boolean isSetDbname() { + return this.dbname != null; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public void unsetName() { + this.name = null; + } + + // Returns true if field name is set (has been asigned a value) and false otherwise + public boolean isSetName() { + return this.name != null; + } + + public boolean isDeleteData() { + return this.deleteData; + } + + public void setDeleteData(boolean deleteData) { + this.deleteData = deleteData; + this.__isset.deleteData = true; + } + + public void unsetDeleteData() { + this.__isset.deleteData = false; + } + + // Returns true if field deleteData is set (has been asigned a value) and false otherwise + public boolean isSetDeleteData() { + return this.__isset.deleteData; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case DBNAME: + if (value == null) { + unsetDbname(); + } else { + setDbname((String)value); + } + break; + + case NAME: + if (value == null) { + unsetName(); + } else { + setName((String)value); + } + break; + + case DELETEDATA: + if (value == null) { + unsetDeleteData(); + } else { + setDeleteData((Boolean)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case DBNAME: + return getDbname(); + + case NAME: + return getName(); + + case DELETEDATA: + return new Boolean(isDeleteData()); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case DBNAME: + return isSetDbname(); + case NAME: + return isSetName(); + case DELETEDATA: + return isSetDeleteData(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof drop_table_args) + return this.equals((drop_table_args)that); + return false; + } + + public boolean equals(drop_table_args that) { + if (that == null) + return false; + + boolean this_present_dbname = true && this.isSetDbname(); + boolean that_present_dbname = true && that.isSetDbname(); + if (this_present_dbname || that_present_dbname) { + if (!(this_present_dbname && that_present_dbname)) + return false; + if (!this.dbname.equals(that.dbname)) + return false; + } + + boolean this_present_name = true && this.isSetName(); + boolean that_present_name = true && that.isSetName(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + boolean this_present_deleteData = true; + boolean that_present_deleteData = true; + if (this_present_deleteData || that_present_deleteData) { + if (!(this_present_deleteData && that_present_deleteData)) + return false; + if (this.deleteData != that.deleteData) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case DBNAME: + if (field.type == TType.STRING) { + this.dbname = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case NAME: + if (field.type == TType.STRING) { + this.name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case DELETEDATA: + if (field.type == TType.BOOL) { + this.deleteData = iprot.readBool(); + this.__isset.deleteData = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.dbname != null) { + oprot.writeFieldBegin(DBNAME_FIELD_DESC); + oprot.writeString(this.dbname); + oprot.writeFieldEnd(); + } + if (this.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(this.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(DELETE_DATA_FIELD_DESC); + oprot.writeBool(this.deleteData); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("drop_table_args("); + boolean first = true; + + sb.append("dbname:"); + if (this.dbname == null) { + sb.append("null"); + } else { + sb.append(this.dbname); + } + first = false; + if (!first) sb.append(", "); + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + if (!first) sb.append(", "); + sb.append("deleteData:"); + sb.append(this.deleteData); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class drop_table_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_table_result"); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)2); + + private NoSuchObjectException o1; + public static final int O1 = 1; + private MetaException o3; + public static final int O3 = 2; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(drop_table_result.class, metaDataMap); + } + + public drop_table_result() { + } + + public drop_table_result( + NoSuchObjectException o1, + MetaException o3) + { + this(); + this.o1 = o1; + this.o3 = o3; + } + + /** + * Performs a deep copy on other. + */ + public drop_table_result(drop_table_result other) { + if (other.isSetO1()) { + this.o1 = new NoSuchObjectException(other.o1); + } + if (other.isSetO3()) { + this.o3 = new MetaException(other.o3); + } + } + + @Override + public drop_table_result clone() { + return new drop_table_result(this); + } + + public NoSuchObjectException getO1() { + return this.o1; + } + + public void setO1(NoSuchObjectException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public MetaException getO3() { + return this.o3; + } + + public void setO3(MetaException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + // Returns true if field o3 is set (has been asigned a value) and false otherwise + public boolean isSetO3() { + return this.o3 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((NoSuchObjectException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((MetaException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case O1: + return getO1(); + + case O3: + return getO3(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case O1: + return isSetO1(); + case O3: + return isSetO3(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof drop_table_result) + return this.equals((drop_table_result)that); + return false; + } + + public boolean equals(drop_table_result that) { + if (that == null) + return false; + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + 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; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new NoSuchObjectException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O3: + if (field.type == TType.STRUCT) { + this.o3 = new MetaException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("drop_table_result("); + boolean first = true; + + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + 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(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_tables_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_tables_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField PATTERN_FIELD_DESC = new TField("pattern", TType.STRING, (short)2); + + private String db_name; + public static final int DB_NAME = 1; + private String pattern; + public static final int PATTERN = 2; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(PATTERN, new FieldMetaData("pattern", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_tables_args.class, metaDataMap); + } + + public get_tables_args() { + } + + public get_tables_args( + String db_name, + String pattern) + { + this(); + this.db_name = db_name; + this.pattern = pattern; + } + + /** + * Performs a deep copy on other. + */ + public get_tables_args(get_tables_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetPattern()) { + this.pattern = other.pattern; + } + } + + @Override + public get_tables_args clone() { + return new get_tables_args(this); + } + + public String getDb_name() { + return this.db_name; + } + + public void setDb_name(String db_name) { + this.db_name = db_name; + } + + public void unsetDb_name() { + this.db_name = null; + } + + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getPattern() { + return this.pattern; + } + + public void setPattern(String pattern) { + this.pattern = pattern; + } + + public void unsetPattern() { + this.pattern = null; } - // Returns true if field deleteData is set (has been asigned a value) and false otherwise - public boolean isSetDeleteData() { - return this.__isset.deleteData; + // Returns true if field pattern is set (has been asigned a value) and false otherwise + public boolean isSetPattern() { + return this.pattern != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DBNAME: - if (value == null) { - unsetDbname(); - } else { - setDbname((String)value); - } - break; - - case NAME: + case DB_NAME: if (value == null) { - unsetName(); + unsetDb_name(); } else { - setName((String)value); + setDb_name((String)value); } break; - case DELETEDATA: + case PATTERN: if (value == null) { - unsetDeleteData(); + unsetPattern(); } else { - setDeleteData((Boolean)value); + setPattern((String)value); } break; @@ -8313,14 +9708,11 @@ public class ThriftHiveMetastore { public Object getFieldValue(int fieldID) { switch (fieldID) { - case DBNAME: - return getDbname(); - - case NAME: - return getName(); + case DB_NAME: + return getDb_name(); - case DELETEDATA: - return new Boolean(isDeleteData()); + case PATTERN: + return getPattern(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -8330,12 +9722,10 @@ public class ThriftHiveMetastore { // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DBNAME: - return isSetDbname(); - case NAME: - return isSetName(); - case DELETEDATA: - return isSetDeleteData(); + case DB_NAME: + return isSetDb_name(); + case PATTERN: + return isSetPattern(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -8345,39 +9735,30 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_table_args) - return this.equals((drop_table_args)that); + if (that instanceof get_tables_args) + return this.equals((get_tables_args)that); return false; } - public boolean equals(drop_table_args that) { + public boolean equals(get_tables_args that) { if (that == null) return false; - boolean this_present_dbname = true && this.isSetDbname(); - boolean that_present_dbname = true && that.isSetDbname(); - if (this_present_dbname || that_present_dbname) { - if (!(this_present_dbname && that_present_dbname)) - return false; - if (!this.dbname.equals(that.dbname)) - return false; - } - - boolean this_present_name = true && this.isSetName(); - boolean that_present_name = true && that.isSetName(); - if (this_present_name || that_present_name) { - if (!(this_present_name && that_present_name)) + boolean this_present_db_name = true && this.isSetDb_name(); + boolean that_present_db_name = true && that.isSetDb_name(); + if (this_present_db_name || that_present_db_name) { + if (!(this_present_db_name && that_present_db_name)) return false; - if (!this.name.equals(that.name)) + if (!this.db_name.equals(that.db_name)) return false; } - boolean this_present_deleteData = true; - boolean that_present_deleteData = true; - if (this_present_deleteData || that_present_deleteData) { - if (!(this_present_deleteData && that_present_deleteData)) + boolean this_present_pattern = true && this.isSetPattern(); + boolean that_present_pattern = true && that.isSetPattern(); + if (this_present_pattern || that_present_pattern) { + if (!(this_present_pattern && that_present_pattern)) return false; - if (this.deleteData != that.deleteData) + if (!this.pattern.equals(that.pattern)) return false; } @@ -8400,24 +9781,16 @@ public class ThriftHiveMetastore { } switch (field.id) { - case DBNAME: + case DB_NAME: if (field.type == TType.STRING) { - this.dbname = iprot.readString(); + this.db_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case NAME: + case PATTERN: if (field.type == TType.STRING) { - this.name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case DELETEDATA: - if (field.type == TType.BOOL) { - this.deleteData = iprot.readBool(); - this.__isset.deleteData = true; + this.pattern = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -8437,47 +9810,40 @@ public class ThriftHiveMetastore { validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.dbname != null) { - oprot.writeFieldBegin(DBNAME_FIELD_DESC); - oprot.writeString(this.dbname); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); oprot.writeFieldEnd(); } - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); + if (this.pattern != null) { + oprot.writeFieldBegin(PATTERN_FIELD_DESC); + oprot.writeString(this.pattern); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(DELETE_DATA_FIELD_DESC); - oprot.writeBool(this.deleteData); - oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_table_args("); + StringBuilder sb = new StringBuilder("get_tables_args("); boolean first = true; - sb.append("dbname:"); - if (this.dbname == null) { + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.dbname); + sb.append(this.db_name); } first = false; if (!first) sb.append(", "); - sb.append("name:"); - if (this.name == null) { + sb.append("pattern:"); + if (this.pattern == null) { sb.append("null"); } else { - sb.append(this.name); + sb.append(this.pattern); } first = false; - if (!first) sb.append(", "); - sb.append("deleteData:"); - sb.append(this.deleteData); - first = false; sb.append(")"); return sb.toString(); } @@ -8489,109 +9855,129 @@ public class ThriftHiveMetastore { } - public static class drop_table_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_table_result"); + public static class get_tables_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_tables_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)2); - private NoSuchObjectException o1; + private List success; + public static final int SUCCESS = 0; + private MetaException o1; public static final int O1 = 1; - private MetaException o3; - public static final int O3 = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(drop_table_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_tables_result.class, metaDataMap); } - public drop_table_result() { + public get_tables_result() { } - public drop_table_result( - NoSuchObjectException o1, - MetaException o3) + public get_tables_result( + List success, + MetaException o1) { this(); + this.success = success; this.o1 = o1; - this.o3 = o3; } /** * Performs a deep copy on other. */ - public drop_table_result(drop_table_result other) { - if (other.isSetO1()) { - this.o1 = new NoSuchObjectException(other.o1); + public get_tables_result(get_tables_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (String other_element : other.success) { + __this__success.add(other_element); + } + this.success = __this__success; } - if (other.isSetO3()) { - this.o3 = new MetaException(other.o3); + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); } } @Override - public drop_table_result clone() { - return new drop_table_result(this); + public get_tables_result clone() { + return new get_tables_result(this); } - public NoSuchObjectException getO1() { - return this.o1; + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); } - public void setO1(NoSuchObjectException o1) { - this.o1 = o1; + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); } - public void unsetO1() { - this.o1 = null; + public void addToSuccess(String elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); } - // Returns true if field o1 is set (has been asigned a value) and false otherwise - public boolean isSetO1() { - return this.o1 != null; + public List getSuccess() { + return this.success; } - public MetaException getO3() { - return this.o3; + public void setSuccess(List success) { + this.success = success; } - public void setO3(MetaException o3) { - this.o3 = o3; + public void unsetSuccess() { + this.success = null; } - public void unsetO3() { - this.o3 = null; + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; } - // Returns true if field o3 is set (has been asigned a value) and false otherwise - public boolean isSetO3() { - return this.o3 != null; + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case O1: + case SUCCESS: if (value == null) { - unsetO1(); + unsetSuccess(); } else { - setO1((NoSuchObjectException)value); + setSuccess((List)value); } break; - case O3: + case O1: if (value == null) { - unsetO3(); + unsetO1(); } else { - setO3((MetaException)value); + setO1((MetaException)value); } break; @@ -8602,12 +9988,12 @@ public class ThriftHiveMetastore { public Object getFieldValue(int fieldID) { switch (fieldID) { + case SUCCESS: + return getSuccess(); + case O1: return getO1(); - case O3: - return getO3(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -8616,10 +10002,10 @@ public class ThriftHiveMetastore { // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { + case SUCCESS: + return isSetSuccess(); case O1: return isSetO1(); - case O3: - return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -8629,15 +10015,24 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_table_result) - return this.equals((drop_table_result)that); + if (that instanceof get_tables_result) + return this.equals((get_tables_result)that); return false; } - public boolean equals(drop_table_result that) { + public boolean equals(get_tables_result that) { if (that == null) return false; + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + boolean this_present_o1 = true && this.isSetO1(); boolean that_present_o1 = true && that.isSetO1(); if (this_present_o1 || that_present_o1) { @@ -8647,15 +10042,6 @@ public class ThriftHiveMetastore { 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; } @@ -8675,18 +10061,27 @@ public class ThriftHiveMetastore { } switch (field.id) { - case O1: - if (field.type == TType.STRUCT) { - this.o1 = new NoSuchObjectException(); - this.o1.read(iprot); + case SUCCESS: + if (field.type == TType.LIST) { + { + TList _list78 = iprot.readListBegin(); + this.success = new ArrayList(_list78.size); + for (int _i79 = 0; _i79 < _list78.size; ++_i79) + { + String _elem80; + _elem80 = iprot.readString(); + this.success.add(_elem80); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } break; - case O3: + case O1: if (field.type == TType.STRUCT) { - this.o3 = new MetaException(); - this.o3.read(iprot); + this.o1 = new MetaException(); + this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -8705,14 +10100,20 @@ public class ThriftHiveMetastore { public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); - if (this.isSetO1()) { + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.success.size())); + for (String _iter81 : this.success) { + oprot.writeString(_iter81); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO3()) { - oprot.writeFieldBegin(O3_FIELD_DESC); - this.o3.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -8720,22 +10121,22 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_table_result("); + StringBuilder sb = new StringBuilder("get_tables_result("); boolean first = true; - sb.append("o1:"); - if (this.o1 == null) { + sb.append("success:"); + if (this.success == null) { sb.append("null"); } else { - sb.append(this.o1); + sb.append(this.success); } first = false; if (!first) sb.append(", "); - sb.append("o3:"); - if (this.o3 == null) { + sb.append("o1:"); + if (this.o1 == null) { sb.append("null"); } else { - sb.append(this.o3); + sb.append(this.o1); } first = false; sb.append(")"); @@ -8749,15 +10150,12 @@ public class ThriftHiveMetastore { } - public static class get_tables_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_tables_args"); + public static class get_all_tables_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_all_tables_args"); private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField PATTERN_FIELD_DESC = new TField("pattern", TType.STRING, (short)2); private String db_name; public static final int DB_NAME = 1; - private String pattern; - public static final int PATTERN = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -8766,41 +10164,34 @@ public class ThriftHiveMetastore { public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(PATTERN, new FieldMetaData("pattern", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(get_tables_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_all_tables_args.class, metaDataMap); } - public get_tables_args() { + public get_all_tables_args() { } - public get_tables_args( - String db_name, - String pattern) + public get_all_tables_args( + String db_name) { this(); this.db_name = db_name; - this.pattern = pattern; } /** * Performs a deep copy on other. */ - public get_tables_args(get_tables_args other) { + public get_all_tables_args(get_all_tables_args other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } - if (other.isSetPattern()) { - this.pattern = other.pattern; - } } @Override - public get_tables_args clone() { - return new get_tables_args(this); + public get_all_tables_args clone() { + return new get_all_tables_args(this); } public String getDb_name() { @@ -8820,23 +10211,6 @@ public class ThriftHiveMetastore { return this.db_name != null; } - public String getPattern() { - return this.pattern; - } - - public void setPattern(String pattern) { - this.pattern = pattern; - } - - public void unsetPattern() { - this.pattern = null; - } - - // Returns true if field pattern is set (has been asigned a value) and false otherwise - public boolean isSetPattern() { - return this.pattern != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case DB_NAME: @@ -8847,14 +10221,6 @@ public class ThriftHiveMetastore { } break; - case PATTERN: - if (value == null) { - unsetPattern(); - } else { - setPattern((String)value); - } - break; - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -8865,9 +10231,6 @@ public class ThriftHiveMetastore { case DB_NAME: return getDb_name(); - case PATTERN: - return getPattern(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -8878,8 +10241,6 @@ public class ThriftHiveMetastore { switch (fieldID) { case DB_NAME: return isSetDb_name(); - case PATTERN: - return isSetPattern(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -8889,12 +10250,12 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_tables_args) - return this.equals((get_tables_args)that); + if (that instanceof get_all_tables_args) + return this.equals((get_all_tables_args)that); return false; } - public boolean equals(get_tables_args that) { + public boolean equals(get_all_tables_args that) { if (that == null) return false; @@ -8907,15 +10268,6 @@ public class ThriftHiveMetastore { return false; } - boolean this_present_pattern = true && this.isSetPattern(); - boolean that_present_pattern = true && that.isSetPattern(); - if (this_present_pattern || that_present_pattern) { - if (!(this_present_pattern && that_present_pattern)) - return false; - if (!this.pattern.equals(that.pattern)) - return false; - } - return true; } @@ -8942,13 +10294,6 @@ public class ThriftHiveMetastore { TProtocolUtil.skip(iprot, field.type); } break; - case PATTERN: - if (field.type == TType.STRING) { - this.pattern = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -8969,18 +10314,13 @@ public class ThriftHiveMetastore { oprot.writeString(this.db_name); oprot.writeFieldEnd(); } - if (this.pattern != null) { - oprot.writeFieldBegin(PATTERN_FIELD_DESC); - oprot.writeString(this.pattern); - oprot.writeFieldEnd(); - } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("get_tables_args("); + StringBuilder sb = new StringBuilder("get_all_tables_args("); boolean first = true; sb.append("db_name:"); @@ -8990,14 +10330,6 @@ public class ThriftHiveMetastore { sb.append(this.db_name); } first = false; - if (!first) sb.append(", "); - sb.append("pattern:"); - if (this.pattern == null) { - sb.append("null"); - } else { - sb.append(this.pattern); - } - first = false; sb.append(")"); return sb.toString(); } @@ -9009,8 +10341,8 @@ public class ThriftHiveMetastore { } - public static class get_tables_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_tables_result"); + public static class get_all_tables_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_all_tables_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); @@ -9032,13 +10364,13 @@ public class ThriftHiveMetastore { }}); static { - FieldMetaData.addStructMetaDataMap(get_tables_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_all_tables_result.class, metaDataMap); } - public get_tables_result() { + public get_all_tables_result() { } - public get_tables_result( + public get_all_tables_result( List success, MetaException o1) { @@ -9050,7 +10382,7 @@ public class ThriftHiveMetastore { /** * Performs a deep copy on other. */ - public get_tables_result(get_tables_result other) { + public get_all_tables_result(get_all_tables_result other) { if (other.isSetSuccess()) { List __this__success = new ArrayList(); for (String other_element : other.success) { @@ -9064,8 +10396,8 @@ public class ThriftHiveMetastore { } @Override - public get_tables_result clone() { - return new get_tables_result(this); + public get_all_tables_result clone() { + return new get_all_tables_result(this); } public int getSuccessSize() { @@ -9169,12 +10501,12 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_tables_result) - return this.equals((get_tables_result)that); + if (that instanceof get_all_tables_result) + return this.equals((get_all_tables_result)that); return false; } - public boolean equals(get_tables_result that) { + public boolean equals(get_all_tables_result that) { if (that == null) return false; @@ -9218,13 +10550,13 @@ public class ThriftHiveMetastore { case SUCCESS: if (field.type == TType.LIST) { { - TList _list74 = iprot.readListBegin(); - this.success = new ArrayList(_list74.size); - for (int _i75 = 0; _i75 < _list74.size; ++_i75) + TList _list82 = iprot.readListBegin(); + this.success = new ArrayList(_list82.size); + for (int _i83 = 0; _i83 < _list82.size; ++_i83) { - String _elem76; - _elem76 = iprot.readString(); - this.success.add(_elem76); + String _elem84; + _elem84 = iprot.readString(); + this.success.add(_elem84); } iprot.readListEnd(); } @@ -9258,8 +10590,8 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter77 : this.success) { - oprot.writeString(_iter77); + for (String _iter85 : this.success) { + oprot.writeString(_iter85); } oprot.writeListEnd(); } @@ -9275,7 +10607,7 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("get_tables_result("); + StringBuilder sb = new StringBuilder("get_all_tables_result("); boolean first = true; sb.append("success:"); @@ -11345,13 +12677,13 @@ public class ThriftHiveMetastore { case PART_VALS: if (field.type == TType.LIST) { { - TList _list78 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list78.size); - for (int _i79 = 0; _i79 < _list78.size; ++_i79) + TList _list86 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list86.size); + for (int _i87 = 0; _i87 < _list86.size; ++_i87) { - String _elem80; - _elem80 = iprot.readString(); - this.part_vals.add(_elem80); + String _elem88; + _elem88 = iprot.readString(); + this.part_vals.add(_elem88); } iprot.readListEnd(); } @@ -11388,8 +12720,8 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter81 : this.part_vals) { - oprot.writeString(_iter81); + for (String _iter89 : this.part_vals) { + oprot.writeString(_iter89); } oprot.writeListEnd(); } @@ -12886,13 +14218,13 @@ public class ThriftHiveMetastore { case PART_VALS: if (field.type == TType.LIST) { { - TList _list82 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list82.size); - for (int _i83 = 0; _i83 < _list82.size; ++_i83) + TList _list90 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list90.size); + for (int _i91 = 0; _i91 < _list90.size; ++_i91) { - String _elem84; - _elem84 = iprot.readString(); - this.part_vals.add(_elem84); + String _elem92; + _elem92 = iprot.readString(); + this.part_vals.add(_elem92); } iprot.readListEnd(); } @@ -12937,8 +14269,8 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter85 : this.part_vals) { - oprot.writeString(_iter85); + for (String _iter93 : this.part_vals) { + oprot.writeString(_iter93); } oprot.writeListEnd(); } @@ -14315,13 +15647,13 @@ public class ThriftHiveMetastore { case PART_VALS: if (field.type == TType.LIST) { { - TList _list86 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list86.size); - for (int _i87 = 0; _i87 < _list86.size; ++_i87) + TList _list94 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list94.size); + for (int _i95 = 0; _i95 < _list94.size; ++_i95) { - String _elem88; - _elem88 = iprot.readString(); - this.part_vals.add(_elem88); + String _elem96; + _elem96 = iprot.readString(); + this.part_vals.add(_elem96); } iprot.readListEnd(); } @@ -14358,8 +15690,8 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter89 : this.part_vals) { - oprot.writeString(_iter89); + for (String _iter97 : this.part_vals) { + oprot.writeString(_iter97); } oprot.writeListEnd(); } @@ -15981,14 +17313,14 @@ public class ThriftHiveMetastore { case SUCCESS: if (field.type == TType.LIST) { { - TList _list90 = iprot.readListBegin(); - this.success = new ArrayList(_list90.size); - for (int _i91 = 0; _i91 < _list90.size; ++_i91) + TList _list98 = iprot.readListBegin(); + this.success = new ArrayList(_list98.size); + for (int _i99 = 0; _i99 < _list98.size; ++_i99) { - Partition _elem92; - _elem92 = new Partition(); - _elem92.read(iprot); - this.success.add(_elem92); + Partition _elem100; + _elem100 = new Partition(); + _elem100.read(iprot); + this.success.add(_elem100); } iprot.readListEnd(); } @@ -16030,8 +17362,8 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter93 : this.success) { - _iter93.write(oprot); + for (Partition _iter101 : this.success) { + _iter101.write(oprot); } oprot.writeListEnd(); } @@ -16625,13 +17957,13 @@ public class ThriftHiveMetastore { case SUCCESS: if (field.type == TType.LIST) { { - TList _list94 = iprot.readListBegin(); - this.success = new ArrayList(_list94.size); - for (int _i95 = 0; _i95 < _list94.size; ++_i95) + TList _list102 = iprot.readListBegin(); + this.success = new ArrayList(_list102.size); + for (int _i103 = 0; _i103 < _list102.size; ++_i103) { - String _elem96; - _elem96 = iprot.readString(); - this.success.add(_elem96); + String _elem104; + _elem104 = iprot.readString(); + this.success.add(_elem104); } iprot.readListEnd(); } @@ -16665,8 +17997,8 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter97 : this.success) { - oprot.writeString(_iter97); + for (String _iter105 : this.success) { + oprot.writeString(_iter105); } oprot.writeListEnd(); } @@ -17036,13 +18368,13 @@ public class ThriftHiveMetastore { case PART_VALS: if (field.type == TType.LIST) { { - TList _list98 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list98.size); - for (int _i99 = 0; _i99 < _list98.size; ++_i99) + TList _list106 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list106.size); + for (int _i107 = 0; _i107 < _list106.size; ++_i107) { - String _elem100; - _elem100 = iprot.readString(); - this.part_vals.add(_elem100); + String _elem108; + _elem108 = iprot.readString(); + this.part_vals.add(_elem108); } iprot.readListEnd(); } @@ -17087,8 +18419,8 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter101 : this.part_vals) { - oprot.writeString(_iter101); + for (String _iter109 : this.part_vals) { + oprot.writeString(_iter109); } oprot.writeListEnd(); } @@ -17353,14 +18685,14 @@ public class ThriftHiveMetastore { case SUCCESS: if (field.type == TType.LIST) { { - TList _list102 = iprot.readListBegin(); - this.success = new ArrayList(_list102.size); - for (int _i103 = 0; _i103 < _list102.size; ++_i103) + TList _list110 = iprot.readListBegin(); + this.success = new ArrayList(_list110.size); + for (int _i111 = 0; _i111 < _list110.size; ++_i111) { - Partition _elem104; - _elem104 = new Partition(); - _elem104.read(iprot); - this.success.add(_elem104); + Partition _elem112; + _elem112 = new Partition(); + _elem112.read(iprot); + this.success.add(_elem112); } iprot.readListEnd(); } @@ -17394,8 +18726,8 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter105 : this.success) { - _iter105.write(oprot); + for (Partition _iter113 : this.success) { + _iter113.write(oprot); } oprot.writeListEnd(); } @@ -17765,13 +19097,13 @@ public class ThriftHiveMetastore { case PART_VALS: if (field.type == TType.LIST) { { - TList _list106 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list106.size); - for (int _i107 = 0; _i107 < _list106.size; ++_i107) + TList _list114 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list114.size); + for (int _i115 = 0; _i115 < _list114.size; ++_i115) { - String _elem108; - _elem108 = iprot.readString(); - this.part_vals.add(_elem108); + String _elem116; + _elem116 = iprot.readString(); + this.part_vals.add(_elem116); } iprot.readListEnd(); } @@ -17816,8 +19148,8 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter109 : this.part_vals) { - oprot.writeString(_iter109); + for (String _iter117 : this.part_vals) { + oprot.writeString(_iter117); } oprot.writeListEnd(); } @@ -18082,13 +19414,13 @@ public class ThriftHiveMetastore { case SUCCESS: if (field.type == TType.LIST) { { - TList _list110 = iprot.readListBegin(); - this.success = new ArrayList(_list110.size); - for (int _i111 = 0; _i111 < _list110.size; ++_i111) + TList _list118 = iprot.readListBegin(); + this.success = new ArrayList(_list118.size); + for (int _i119 = 0; _i119 < _list118.size; ++_i119) { - String _elem112; - _elem112 = iprot.readString(); - this.success.add(_elem112); + String _elem120; + _elem120 = iprot.readString(); + this.success.add(_elem120); } iprot.readListEnd(); } @@ -18122,8 +19454,8 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter113 : this.success) { - oprot.writeString(_iter113); + for (String _iter121 : this.success) { + oprot.writeString(_iter121); } oprot.writeListEnd(); } @@ -19677,13 +21009,13 @@ public class ThriftHiveMetastore { case SUCCESS: if (field.type == TType.LIST) { { - TList _list114 = iprot.readListBegin(); - this.success = new ArrayList(_list114.size); - for (int _i115 = 0; _i115 < _list114.size; ++_i115) + TList _list122 = iprot.readListBegin(); + this.success = new ArrayList(_list122.size); + for (int _i123 = 0; _i123 < _list122.size; ++_i123) { - String _elem116; - _elem116 = iprot.readString(); - this.success.add(_elem116); + String _elem124; + _elem124 = iprot.readString(); + this.success.add(_elem124); } iprot.readListEnd(); } @@ -19717,8 +21049,8 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter117 : this.success) { - oprot.writeString(_iter117); + for (String _iter125 : this.success) { + oprot.writeString(_iter125); } oprot.writeListEnd(); } @@ -20168,15 +21500,15 @@ public class ThriftHiveMetastore { case SUCCESS: if (field.type == TType.MAP) { { - TMap _map118 = iprot.readMapBegin(); - this.success = new HashMap(2*_map118.size); - for (int _i119 = 0; _i119 < _map118.size; ++_i119) + TMap _map126 = iprot.readMapBegin(); + this.success = new HashMap(2*_map126.size); + for (int _i127 = 0; _i127 < _map126.size; ++_i127) { - String _key120; - String _val121; - _key120 = iprot.readString(); - _val121 = iprot.readString(); - this.success.put(_key120, _val121); + String _key128; + String _val129; + _key128 = iprot.readString(); + _val129 = iprot.readString(); + this.success.put(_key128, _val129); } iprot.readMapEnd(); } @@ -20210,9 +21542,9 @@ public class ThriftHiveMetastore { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.success.size())); - for (Map.Entry _iter122 : this.success.entrySet()) { - oprot.writeString(_iter122.getKey()); - oprot.writeString(_iter122.getValue()); + for (Map.Entry _iter130 : this.success.entrySet()) { + oprot.writeString(_iter130.getKey()); + oprot.writeString(_iter130.getValue()); } oprot.writeMapEnd(); } diff --git metastore/src/gen-php/ThriftHiveMetastore.php metastore/src/gen-php/ThriftHiveMetastore.php index 623aa8a..6b3f6e9 100644 --- metastore/src/gen-php/ThriftHiveMetastore.php +++ metastore/src/gen-php/ThriftHiveMetastore.php @@ -10,10 +10,11 @@ include_once $GLOBALS['THRIFT_ROOT'].'/packages/hive_metastore/hive_metastore_ty include_once $GLOBALS['THRIFT_ROOT'].'/packages/fb303/FacebookService.php'; interface ThriftHiveMetastoreIf extends FacebookServiceIf { - public function create_database($name, $description); + public function create_database($database); public function get_database($name); - public function drop_database($name); - public function get_databases(); + public function drop_database($name, $deleteData); + public function get_databases($pattern); + public function get_all_databases(); public function get_type($name); public function create_type($type); public function drop_type($type); @@ -23,6 +24,7 @@ interface ThriftHiveMetastoreIf extends FacebookServiceIf { public function create_table($tbl); public function drop_table($dbname, $name, $deleteData); public function get_tables($db_name, $pattern); + public function get_all_tables($db_name); public function get_table($dbname, $tbl_name); public function alter_table($dbname, $tbl_name, $new_tbl); public function add_partition($new_part); @@ -47,17 +49,16 @@ class ThriftHiveMetastoreClient extends FacebookServiceClient implements ThriftH parent::__construct($input, $output); } - public function create_database($name, $description) + public function create_database($database) { - $this->send_create_database($name, $description); - return $this->recv_create_database(); + $this->send_create_database($database); + $this->recv_create_database(); } - public function send_create_database($name, $description) + public function send_create_database($database) { $args = new metastore_ThriftHiveMetastore_create_database_args(); - $args->name = $name; - $args->description = $description; + $args->database = $database; $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) { @@ -93,16 +94,16 @@ class ThriftHiveMetastoreClient extends FacebookServiceClient implements ThriftH $result->read($this->input_); $this->input_->readMessageEnd(); } - if ($result->success !== null) { - return $result->success; - } if ($result->o1 !== null) { throw $result->o1; } if ($result->o2 !== null) { throw $result->o2; } - throw new Exception("create_database failed: unknown result"); + if ($result->o3 !== null) { + throw $result->o3; + } + return; } public function get_database($name) @@ -162,16 +163,17 @@ class ThriftHiveMetastoreClient extends FacebookServiceClient implements ThriftH throw new Exception("get_database failed: unknown result"); } - public function drop_database($name) + public function drop_database($name, $deleteData) { - $this->send_drop_database($name); - return $this->recv_drop_database(); + $this->send_drop_database($name, $deleteData); + $this->recv_drop_database(); } - public function send_drop_database($name) + public function send_drop_database($name, $deleteData) { $args = new metastore_ThriftHiveMetastore_drop_database_args(); $args->name = $name; + $args->deleteData = $deleteData; $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) { @@ -207,24 +209,28 @@ class ThriftHiveMetastoreClient extends FacebookServiceClient implements ThriftH $result->read($this->input_); $this->input_->readMessageEnd(); } - if ($result->success !== null) { - return $result->success; + if ($result->o1 !== null) { + throw $result->o1; } if ($result->o2 !== null) { throw $result->o2; } - throw new Exception("drop_database failed: unknown result"); + if ($result->o3 !== null) { + throw $result->o3; + } + return; } - public function get_databases() + public function get_databases($pattern) { - $this->send_get_databases(); + $this->send_get_databases($pattern); return $this->recv_get_databases(); } - public function send_get_databases() + public function send_get_databases($pattern) { $args = new metastore_ThriftHiveMetastore_get_databases_args(); + $args->pattern = $pattern; $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) { @@ -269,6 +275,59 @@ class ThriftHiveMetastoreClient extends FacebookServiceClient implements ThriftH throw new Exception("get_databases failed: unknown result"); } + public function get_all_databases() + { + $this->send_get_all_databases(); + return $this->recv_get_all_databases(); + } + + public function send_get_all_databases() + { + $args = new metastore_ThriftHiveMetastore_get_all_databases_args(); + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_all_databases', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_all_databases', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_all_databases() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_all_databases_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_all_databases_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new Exception("get_all_databases failed: unknown result"); + } + public function get_type($name) { $this->send_get_type($name); @@ -317,6 +376,9 @@ class ThriftHiveMetastoreClient extends FacebookServiceClient implements ThriftH if ($result->success !== null) { return $result->success; } + if ($result->o1 !== null) { + throw $result->o1; + } if ($result->o2 !== null) { throw $result->o2; } @@ -431,6 +493,9 @@ class ThriftHiveMetastoreClient extends FacebookServiceClient implements ThriftH if ($result->success !== null) { return $result->success; } + if ($result->o1 !== null) { + throw $result->o1; + } if ($result->o2 !== null) { throw $result->o2; } @@ -784,6 +849,60 @@ class ThriftHiveMetastoreClient extends FacebookServiceClient implements ThriftH throw new Exception("get_tables failed: unknown result"); } + public function get_all_tables($db_name) + { + $this->send_get_all_tables($db_name); + return $this->recv_get_all_tables(); + } + + public function send_get_all_tables($db_name) + { + $args = new metastore_ThriftHiveMetastore_get_all_tables_args(); + $args->db_name = $db_name; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_all_tables', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_all_tables', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_all_tables() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_all_tables_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_all_tables_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new Exception("get_all_tables failed: unknown result"); + } + public function get_table($dbname, $tbl_name) { $this->send_get_table($dbname, $tbl_name); @@ -1775,28 +1894,21 @@ class ThriftHiveMetastoreClient extends FacebookServiceClient implements ThriftH class metastore_ThriftHiveMetastore_create_database_args { static $_TSPEC; - public $name = null; - public $description = null; + public $database = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array( 1 => array( - 'var' => 'name', - 'type' => TType::STRING, - ), - 2 => array( - 'var' => 'description', - 'type' => TType::STRING, + 'var' => 'database', + 'type' => TType::STRUCT, + 'class' => 'metastore_Database', ), ); } if (is_array($vals)) { - if (isset($vals['name'])) { - $this->name = $vals['name']; - } - if (isset($vals['description'])) { - $this->description = $vals['description']; + if (isset($vals['database'])) { + $this->database = $vals['database']; } } } @@ -1821,15 +1933,9 @@ class metastore_ThriftHiveMetastore_create_database_args { switch ($fid) { case 1: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->name); - } else { - $xfer += $input->skip($ftype); - } - break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->description); + if ($ftype == TType::STRUCT) { + $this->database = new metastore_Database(); + $xfer += $this->database->read($input); } else { $xfer += $input->skip($ftype); } @@ -1847,14 +1953,12 @@ class metastore_ThriftHiveMetastore_create_database_args { public function write($output) { $xfer = 0; $xfer += $output->writeStructBegin('ThriftHiveMetastore_create_database_args'); - if ($this->name !== null) { - $xfer += $output->writeFieldBegin('name', TType::STRING, 1); - $xfer += $output->writeString($this->name); - $xfer += $output->writeFieldEnd(); - } - if ($this->description !== null) { - $xfer += $output->writeFieldBegin('description', TType::STRING, 2); - $xfer += $output->writeString($this->description); + if ($this->database !== null) { + if (!is_object($this->database)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('database', TType::STRUCT, 1); + $xfer += $this->database->write($output); $xfer += $output->writeFieldEnd(); } $xfer += $output->writeFieldStop(); @@ -1867,17 +1971,13 @@ class metastore_ThriftHiveMetastore_create_database_args { class metastore_ThriftHiveMetastore_create_database_result { static $_TSPEC; - public $success = null; public $o1 = null; public $o2 = null; + public $o3 = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array( - 0 => array( - 'var' => 'success', - 'type' => TType::BOOL, - ), 1 => array( 'var' => 'o1', 'type' => TType::STRUCT, @@ -1886,20 +1986,25 @@ class metastore_ThriftHiveMetastore_create_database_result { 2 => array( 'var' => 'o2', 'type' => TType::STRUCT, + 'class' => 'metastore_InvalidObjectException', + ), + 3 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, 'class' => 'metastore_MetaException', ), ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; - } if (isset($vals['o1'])) { $this->o1 = $vals['o1']; } if (isset($vals['o2'])) { $this->o2 = $vals['o2']; } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } } } @@ -1922,13 +2027,6 @@ class metastore_ThriftHiveMetastore_create_database_result { } switch ($fid) { - case 0: - if ($ftype == TType::BOOL) { - $xfer += $input->readBool($this->success); - } else { - $xfer += $input->skip($ftype); - } - break; case 1: if ($ftype == TType::STRUCT) { $this->o1 = new metastore_AlreadyExistsException(); @@ -1939,12 +2037,20 @@ class metastore_ThriftHiveMetastore_create_database_result { break; case 2: if ($ftype == TType::STRUCT) { - $this->o2 = new metastore_MetaException(); + $this->o2 = new metastore_InvalidObjectException(); $xfer += $this->o2->read($input); } else { $xfer += $input->skip($ftype); } break; + case 3: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_MetaException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -1958,11 +2064,6 @@ class metastore_ThriftHiveMetastore_create_database_result { public function write($output) { $xfer = 0; $xfer += $output->writeStructBegin('ThriftHiveMetastore_create_database_result'); - if ($this->success !== null) { - $xfer += $output->writeFieldBegin('success', TType::BOOL, 0); - $xfer += $output->writeBool($this->success); - $xfer += $output->writeFieldEnd(); - } if ($this->o1 !== null) { $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); $xfer += $this->o1->write($output); @@ -1973,6 +2074,11 @@ class metastore_ThriftHiveMetastore_create_database_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; @@ -2177,6 +2283,7 @@ class metastore_ThriftHiveMetastore_drop_database_args { static $_TSPEC; public $name = null; + public $deleteData = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -2185,12 +2292,19 @@ class metastore_ThriftHiveMetastore_drop_database_args { 'var' => 'name', 'type' => TType::STRING, ), + 2 => array( + 'var' => 'deleteData', + 'type' => TType::BOOL, + ), ); } if (is_array($vals)) { if (isset($vals['name'])) { $this->name = $vals['name']; } + if (isset($vals['deleteData'])) { + $this->deleteData = $vals['deleteData']; + } } } @@ -2220,6 +2334,13 @@ class metastore_ThriftHiveMetastore_drop_database_args { $xfer += $input->skip($ftype); } break; + case 2: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->deleteData); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -2238,6 +2359,11 @@ class metastore_ThriftHiveMetastore_drop_database_args { $xfer += $output->writeString($this->name); $xfer += $output->writeFieldEnd(); } + if ($this->deleteData !== null) { + $xfer += $output->writeFieldBegin('deleteData', TType::BOOL, 2); + $xfer += $output->writeBool($this->deleteData); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -2248,30 +2374,40 @@ class metastore_ThriftHiveMetastore_drop_database_args { class metastore_ThriftHiveMetastore_drop_database_result { static $_TSPEC; - public $success = null; + public $o1 = null; public $o2 = null; + public $o3 = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array( - 0 => array( - 'var' => 'success', - 'type' => TType::BOOL, + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', ), 2 => array( 'var' => 'o2', 'type' => TType::STRUCT, + 'class' => 'metastore_InvalidOperationException', + ), + 3 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, 'class' => 'metastore_MetaException', ), ); } if (is_array($vals)) { - if (isset($vals['success'])) { - $this->success = $vals['success']; + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; } if (isset($vals['o2'])) { $this->o2 = $vals['o2']; } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } } } @@ -2294,21 +2430,30 @@ class metastore_ThriftHiveMetastore_drop_database_result { } switch ($fid) { - case 0: - if ($ftype == TType::BOOL) { - $xfer += $input->readBool($this->success); + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_NoSuchObjectException(); + $xfer += $this->o1->read($input); } else { $xfer += $input->skip($ftype); } break; case 2: if ($ftype == TType::STRUCT) { - $this->o2 = new metastore_MetaException(); + $this->o2 = new metastore_InvalidOperationException(); $xfer += $this->o2->read($input); } else { $xfer += $input->skip($ftype); } break; + case 3: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_MetaException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -2322,9 +2467,9 @@ class metastore_ThriftHiveMetastore_drop_database_result { public function write($output) { $xfer = 0; $xfer += $output->writeStructBegin('ThriftHiveMetastore_drop_database_result'); - if ($this->success !== null) { - $xfer += $output->writeFieldBegin('success', TType::BOOL, 0); - $xfer += $output->writeBool($this->success); + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); $xfer += $output->writeFieldEnd(); } if ($this->o2 !== null) { @@ -2332,6 +2477,11 @@ class metastore_ThriftHiveMetastore_drop_database_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; @@ -2342,13 +2492,23 @@ class metastore_ThriftHiveMetastore_drop_database_result { class metastore_ThriftHiveMetastore_get_databases_args { static $_TSPEC; + public $pattern = null; - public function __construct() { + public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array( + 1 => array( + 'var' => 'pattern', + 'type' => TType::STRING, + ), ); } - } + if (is_array($vals)) { + if (isset($vals['pattern'])) { + $this->pattern = $vals['pattern']; + } + } + } public function getName() { return 'ThriftHiveMetastore_get_databases_args'; @@ -2369,6 +2529,13 @@ class metastore_ThriftHiveMetastore_get_databases_args { } switch ($fid) { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->pattern); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -2382,6 +2549,11 @@ class metastore_ThriftHiveMetastore_get_databases_args { public function write($output) { $xfer = 0; $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_databases_args'); + if ($this->pattern !== null) { + $xfer += $output->writeFieldBegin('pattern', TType::STRING, 1); + $xfer += $output->writeString($this->pattern); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -2509,6 +2681,176 @@ class metastore_ThriftHiveMetastore_get_databases_result { } +class metastore_ThriftHiveMetastore_get_all_databases_args { + static $_TSPEC; + + + public function __construct() { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + ); + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_all_databases_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_all_databases_args'); + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_all_databases_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_all_databases_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size108 = 0; + $_etype111 = 0; + $xfer += $input->readListBegin($_etype111, $_size108); + for ($_i112 = 0; $_i112 < $_size108; ++$_i112) + { + $elem113 = null; + $xfer += $input->readString($elem113); + $this->success []= $elem113; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_all_databases_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRING, count($this->success)); + { + foreach ($this->success as $iter114) + { + $xfer += $output->writeString($iter114); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + class metastore_ThriftHiveMetastore_get_type_args { static $_TSPEC; @@ -2585,6 +2927,7 @@ class metastore_ThriftHiveMetastore_get_type_result { static $_TSPEC; public $success = null; + public $o1 = null; public $o2 = null; public function __construct($vals=null) { @@ -2596,16 +2939,24 @@ class metastore_ThriftHiveMetastore_get_type_result { 'class' => 'metastore_Type', ), 1 => array( - 'var' => 'o2', + 'var' => 'o1', 'type' => TType::STRUCT, 'class' => 'metastore_MetaException', ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), ); } if (is_array($vals)) { if (isset($vals['success'])) { $this->success = $vals['success']; } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } if (isset($vals['o2'])) { $this->o2 = $vals['o2']; } @@ -2641,7 +2992,15 @@ class metastore_ThriftHiveMetastore_get_type_result { break; case 1: if ($ftype == TType::STRUCT) { - $this->o2 = new metastore_MetaException(); + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_NoSuchObjectException(); $xfer += $this->o2->read($input); } else { $xfer += $input->skip($ftype); @@ -2668,8 +3027,13 @@ class metastore_ThriftHiveMetastore_get_type_result { $xfer += $this->success->write($output); $xfer += $output->writeFieldEnd(); } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } if ($this->o2 !== null) { - $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 1); + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); $xfer += $this->o2->write($output); $xfer += $output->writeFieldEnd(); } @@ -2971,6 +3335,7 @@ class metastore_ThriftHiveMetastore_drop_type_result { static $_TSPEC; public $success = null; + public $o1 = null; public $o2 = null; public function __construct($vals=null) { @@ -2981,16 +3346,24 @@ class metastore_ThriftHiveMetastore_drop_type_result { 'type' => TType::BOOL, ), 1 => array( - 'var' => 'o2', + 'var' => 'o1', 'type' => TType::STRUCT, 'class' => 'metastore_MetaException', ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), ); } if (is_array($vals)) { if (isset($vals['success'])) { $this->success = $vals['success']; } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } if (isset($vals['o2'])) { $this->o2 = $vals['o2']; } @@ -3025,7 +3398,15 @@ class metastore_ThriftHiveMetastore_drop_type_result { break; case 1: if ($ftype == TType::STRUCT) { - $this->o2 = new metastore_MetaException(); + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_NoSuchObjectException(); $xfer += $this->o2->read($input); } else { $xfer += $input->skip($ftype); @@ -3049,8 +3430,13 @@ class metastore_ThriftHiveMetastore_drop_type_result { $xfer += $output->writeBool($this->success); $xfer += $output->writeFieldEnd(); } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } if ($this->o2 !== null) { - $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 1); + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); $xfer += $this->o2->write($output); $xfer += $output->writeFieldEnd(); } @@ -3194,18 +3580,18 @@ class metastore_ThriftHiveMetastore_get_type_all_result { case 0: if ($ftype == TType::MAP) { $this->success = array(); - $_size108 = 0; - $_ktype109 = 0; - $_vtype110 = 0; - $xfer += $input->readMapBegin($_ktype109, $_vtype110, $_size108); - for ($_i112 = 0; $_i112 < $_size108; ++$_i112) + $_size115 = 0; + $_ktype116 = 0; + $_vtype117 = 0; + $xfer += $input->readMapBegin($_ktype116, $_vtype117, $_size115); + for ($_i119 = 0; $_i119 < $_size115; ++$_i119) { - $key113 = ''; - $val114 = new metastore_Type(); - $xfer += $input->readString($key113); - $val114 = new metastore_Type(); - $xfer += $val114->read($input); - $this->success[$key113] = $val114; + $key120 = ''; + $val121 = new metastore_Type(); + $xfer += $input->readString($key120); + $val121 = new metastore_Type(); + $xfer += $val121->read($input); + $this->success[$key120] = $val121; } $xfer += $input->readMapEnd(); } else { @@ -3241,10 +3627,10 @@ class metastore_ThriftHiveMetastore_get_type_all_result { { $output->writeMapBegin(TType::STRING, TType::STRUCT, count($this->success)); { - foreach ($this->success as $kiter115 => $viter116) + foreach ($this->success as $kiter122 => $viter123) { - $xfer += $output->writeString($kiter115); - $xfer += $viter116->write($output); + $xfer += $output->writeString($kiter122); + $xfer += $viter123->write($output); } } $output->writeMapEnd(); @@ -3430,15 +3816,15 @@ class metastore_ThriftHiveMetastore_get_fields_result { case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size117 = 0; - $_etype120 = 0; - $xfer += $input->readListBegin($_etype120, $_size117); - for ($_i121 = 0; $_i121 < $_size117; ++$_i121) + $_size124 = 0; + $_etype127 = 0; + $xfer += $input->readListBegin($_etype127, $_size124); + for ($_i128 = 0; $_i128 < $_size124; ++$_i128) { - $elem122 = null; - $elem122 = new metastore_FieldSchema(); - $xfer += $elem122->read($input); - $this->success []= $elem122; + $elem129 = null; + $elem129 = new metastore_FieldSchema(); + $xfer += $elem129->read($input); + $this->success []= $elem129; } $xfer += $input->readListEnd(); } else { @@ -3490,9 +3876,9 @@ class metastore_ThriftHiveMetastore_get_fields_result { { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter123) + foreach ($this->success as $iter130) { - $xfer += $iter123->write($output); + $xfer += $iter130->write($output); } } $output->writeListEnd(); @@ -3688,15 +4074,15 @@ class metastore_ThriftHiveMetastore_get_schema_result { case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size124 = 0; - $_etype127 = 0; - $xfer += $input->readListBegin($_etype127, $_size124); - for ($_i128 = 0; $_i128 < $_size124; ++$_i128) + $_size131 = 0; + $_etype134 = 0; + $xfer += $input->readListBegin($_etype134, $_size131); + for ($_i135 = 0; $_i135 < $_size131; ++$_i135) { - $elem129 = null; - $elem129 = new metastore_FieldSchema(); - $xfer += $elem129->read($input); - $this->success []= $elem129; + $elem136 = null; + $elem136 = new metastore_FieldSchema(); + $xfer += $elem136->read($input); + $this->success []= $elem136; } $xfer += $input->readListEnd(); } else { @@ -3748,9 +4134,9 @@ class metastore_ThriftHiveMetastore_get_schema_result { { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter130) + foreach ($this->success as $iter137) { - $xfer += $iter130->write($output); + $xfer += $iter137->write($output); } } $output->writeListEnd(); @@ -4096,9 +4482,197 @@ class metastore_ThriftHiveMetastore_drop_table_args { $xfer += $output->writeString($this->name); $xfer += $output->writeFieldEnd(); } - if ($this->deleteData !== null) { - $xfer += $output->writeFieldBegin('deleteData', TType::BOOL, 3); - $xfer += $output->writeBool($this->deleteData); + if ($this->deleteData !== null) { + $xfer += $output->writeFieldBegin('deleteData', TType::BOOL, 3); + $xfer += $output->writeBool($this->deleteData); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_drop_table_result { + static $_TSPEC; + + public $o1 = null; + public $o3 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), + 2 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_drop_table_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_NoSuchObjectException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_MetaException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_drop_table_result'); + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o3 !== null) { + $xfer += $output->writeFieldBegin('o3', TType::STRUCT, 2); + $xfer += $this->o3->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_tables_args { + static $_TSPEC; + + public $db_name = null; + public $pattern = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'pattern', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['pattern'])) { + $this->pattern = $vals['pattern']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_tables_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->pattern); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_tables_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->pattern !== null) { + $xfer += $output->writeFieldBegin('pattern', TType::STRING, 2); + $xfer += $output->writeString($this->pattern); $xfer += $output->writeFieldEnd(); } $xfer += $output->writeFieldStop(); @@ -4108,39 +4682,42 @@ class metastore_ThriftHiveMetastore_drop_table_args { } -class metastore_ThriftHiveMetastore_drop_table_result { +class metastore_ThriftHiveMetastore_get_tables_result { static $_TSPEC; + public $success = null; public $o1 = null; - public $o3 = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), 1 => array( 'var' => 'o1', 'type' => TType::STRUCT, - 'class' => 'metastore_NoSuchObjectException', - ), - 2 => array( - 'var' => 'o3', - 'type' => TType::STRUCT, 'class' => 'metastore_MetaException', ), ); } if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } if (isset($vals['o1'])) { $this->o1 = $vals['o1']; } - if (isset($vals['o3'])) { - $this->o3 = $vals['o3']; - } } } public function getName() { - return 'ThriftHiveMetastore_drop_table_result'; + return 'ThriftHiveMetastore_get_tables_result'; } public function read($input) @@ -4158,18 +4735,27 @@ class metastore_ThriftHiveMetastore_drop_table_result { } switch ($fid) { - case 1: - if ($ftype == TType::STRUCT) { - $this->o1 = new metastore_NoSuchObjectException(); - $xfer += $this->o1->read($input); + case 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size138 = 0; + $_etype141 = 0; + $xfer += $input->readListBegin($_etype141, $_size138); + for ($_i142 = 0; $_i142 < $_size138; ++$_i142) + { + $elem143 = null; + $xfer += $input->readString($elem143); + $this->success []= $elem143; + } + $xfer += $input->readListEnd(); } else { $xfer += $input->skip($ftype); } break; - case 2: + case 1: if ($ftype == TType::STRUCT) { - $this->o3 = new metastore_MetaException(); - $xfer += $this->o3->read($input); + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); } else { $xfer += $input->skip($ftype); } @@ -4186,17 +4772,29 @@ class metastore_ThriftHiveMetastore_drop_table_result { public function write($output) { $xfer = 0; - $xfer += $output->writeStructBegin('ThriftHiveMetastore_drop_table_result'); + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_tables_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRING, count($this->success)); + { + foreach ($this->success as $iter144) + { + $xfer += $output->writeString($iter144); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } if ($this->o1 !== null) { $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); $xfer += $this->o1->write($output); $xfer += $output->writeFieldEnd(); } - if ($this->o3 !== null) { - $xfer += $output->writeFieldBegin('o3', TType::STRUCT, 2); - $xfer += $this->o3->write($output); - $xfer += $output->writeFieldEnd(); - } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -4204,11 +4802,10 @@ class metastore_ThriftHiveMetastore_drop_table_result { } -class metastore_ThriftHiveMetastore_get_tables_args { +class metastore_ThriftHiveMetastore_get_all_tables_args { static $_TSPEC; public $db_name = null; - public $pattern = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -4217,24 +4814,17 @@ class metastore_ThriftHiveMetastore_get_tables_args { 'var' => 'db_name', 'type' => TType::STRING, ), - 2 => array( - 'var' => 'pattern', - 'type' => TType::STRING, - ), ); } if (is_array($vals)) { if (isset($vals['db_name'])) { $this->db_name = $vals['db_name']; } - if (isset($vals['pattern'])) { - $this->pattern = $vals['pattern']; - } } } public function getName() { - return 'ThriftHiveMetastore_get_tables_args'; + return 'ThriftHiveMetastore_get_all_tables_args'; } public function read($input) @@ -4259,13 +4849,6 @@ class metastore_ThriftHiveMetastore_get_tables_args { $xfer += $input->skip($ftype); } break; - case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->pattern); - } else { - $xfer += $input->skip($ftype); - } - break; default: $xfer += $input->skip($ftype); break; @@ -4278,17 +4861,12 @@ class metastore_ThriftHiveMetastore_get_tables_args { public function write($output) { $xfer = 0; - $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_tables_args'); + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_all_tables_args'); if ($this->db_name !== null) { $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); $xfer += $output->writeString($this->db_name); $xfer += $output->writeFieldEnd(); } - if ($this->pattern !== null) { - $xfer += $output->writeFieldBegin('pattern', TType::STRING, 2); - $xfer += $output->writeString($this->pattern); - $xfer += $output->writeFieldEnd(); - } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -4296,7 +4874,7 @@ class metastore_ThriftHiveMetastore_get_tables_args { } -class metastore_ThriftHiveMetastore_get_tables_result { +class metastore_ThriftHiveMetastore_get_all_tables_result { static $_TSPEC; public $success = null; @@ -4331,7 +4909,7 @@ class metastore_ThriftHiveMetastore_get_tables_result { } public function getName() { - return 'ThriftHiveMetastore_get_tables_result'; + return 'ThriftHiveMetastore_get_all_tables_result'; } public function read($input) @@ -4352,14 +4930,14 @@ class metastore_ThriftHiveMetastore_get_tables_result { case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size131 = 0; - $_etype134 = 0; - $xfer += $input->readListBegin($_etype134, $_size131); - for ($_i135 = 0; $_i135 < $_size131; ++$_i135) + $_size145 = 0; + $_etype148 = 0; + $xfer += $input->readListBegin($_etype148, $_size145); + for ($_i149 = 0; $_i149 < $_size145; ++$_i149) { - $elem136 = null; - $xfer += $input->readString($elem136); - $this->success []= $elem136; + $elem150 = null; + $xfer += $input->readString($elem150); + $this->success []= $elem150; } $xfer += $input->readListEnd(); } else { @@ -4386,7 +4964,7 @@ class metastore_ThriftHiveMetastore_get_tables_result { public function write($output) { $xfer = 0; - $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_tables_result'); + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_all_tables_result'); if ($this->success !== null) { if (!is_array($this->success)) { throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); @@ -4395,9 +4973,9 @@ class metastore_ThriftHiveMetastore_get_tables_result { { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter137) + foreach ($this->success as $iter151) { - $xfer += $output->writeString($iter137); + $xfer += $output->writeString($iter151); } } $output->writeListEnd(); @@ -5139,14 +5717,14 @@ class metastore_ThriftHiveMetastore_append_partition_args { case 3: if ($ftype == TType::LST) { $this->part_vals = array(); - $_size138 = 0; - $_etype141 = 0; - $xfer += $input->readListBegin($_etype141, $_size138); - for ($_i142 = 0; $_i142 < $_size138; ++$_i142) + $_size152 = 0; + $_etype155 = 0; + $xfer += $input->readListBegin($_etype155, $_size152); + for ($_i156 = 0; $_i156 < $_size152; ++$_i156) { - $elem143 = null; - $xfer += $input->readString($elem143); - $this->part_vals []= $elem143; + $elem157 = null; + $xfer += $input->readString($elem157); + $this->part_vals []= $elem157; } $xfer += $input->readListEnd(); } else { @@ -5184,9 +5762,9 @@ class metastore_ThriftHiveMetastore_append_partition_args { { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter144) + foreach ($this->part_vals as $iter158) { - $xfer += $output->writeString($iter144); + $xfer += $output->writeString($iter158); } } $output->writeListEnd(); @@ -5683,14 +6261,14 @@ class metastore_ThriftHiveMetastore_drop_partition_args { case 3: if ($ftype == TType::LST) { $this->part_vals = array(); - $_size145 = 0; - $_etype148 = 0; - $xfer += $input->readListBegin($_etype148, $_size145); - for ($_i149 = 0; $_i149 < $_size145; ++$_i149) + $_size159 = 0; + $_etype162 = 0; + $xfer += $input->readListBegin($_etype162, $_size159); + for ($_i163 = 0; $_i163 < $_size159; ++$_i163) { - $elem150 = null; - $xfer += $input->readString($elem150); - $this->part_vals []= $elem150; + $elem164 = null; + $xfer += $input->readString($elem164); + $this->part_vals []= $elem164; } $xfer += $input->readListEnd(); } else { @@ -5735,9 +6313,9 @@ class metastore_ThriftHiveMetastore_drop_partition_args { { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter151) + foreach ($this->part_vals as $iter165) { - $xfer += $output->writeString($iter151); + $xfer += $output->writeString($iter165); } } $output->writeListEnd(); @@ -6197,14 +6775,14 @@ class metastore_ThriftHiveMetastore_get_partition_args { case 3: if ($ftype == TType::LST) { $this->part_vals = array(); - $_size152 = 0; - $_etype155 = 0; - $xfer += $input->readListBegin($_etype155, $_size152); - for ($_i156 = 0; $_i156 < $_size152; ++$_i156) + $_size166 = 0; + $_etype169 = 0; + $xfer += $input->readListBegin($_etype169, $_size166); + for ($_i170 = 0; $_i170 < $_size166; ++$_i170) { - $elem157 = null; - $xfer += $input->readString($elem157); - $this->part_vals []= $elem157; + $elem171 = null; + $xfer += $input->readString($elem171); + $this->part_vals []= $elem171; } $xfer += $input->readListEnd(); } else { @@ -6242,9 +6820,9 @@ class metastore_ThriftHiveMetastore_get_partition_args { { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter158) + foreach ($this->part_vals as $iter172) { - $xfer += $output->writeString($iter158); + $xfer += $output->writeString($iter172); } } $output->writeListEnd(); @@ -6790,15 +7368,15 @@ class metastore_ThriftHiveMetastore_get_partitions_result { case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size159 = 0; - $_etype162 = 0; - $xfer += $input->readListBegin($_etype162, $_size159); - for ($_i163 = 0; $_i163 < $_size159; ++$_i163) + $_size173 = 0; + $_etype176 = 0; + $xfer += $input->readListBegin($_etype176, $_size173); + for ($_i177 = 0; $_i177 < $_size173; ++$_i177) { - $elem164 = null; - $elem164 = new metastore_Partition(); - $xfer += $elem164->read($input); - $this->success []= $elem164; + $elem178 = null; + $elem178 = new metastore_Partition(); + $xfer += $elem178->read($input); + $this->success []= $elem178; } $xfer += $input->readListEnd(); } else { @@ -6842,9 +7420,9 @@ class metastore_ThriftHiveMetastore_get_partitions_result { { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter165) + foreach ($this->success as $iter179) { - $xfer += $iter165->write($output); + $xfer += $iter179->write($output); } } $output->writeListEnd(); @@ -7036,14 +7614,14 @@ class metastore_ThriftHiveMetastore_get_partition_names_result { case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size166 = 0; - $_etype169 = 0; - $xfer += $input->readListBegin($_etype169, $_size166); - for ($_i170 = 0; $_i170 < $_size166; ++$_i170) + $_size180 = 0; + $_etype183 = 0; + $xfer += $input->readListBegin($_etype183, $_size180); + for ($_i184 = 0; $_i184 < $_size180; ++$_i184) { - $elem171 = null; - $xfer += $input->readString($elem171); - $this->success []= $elem171; + $elem185 = null; + $xfer += $input->readString($elem185); + $this->success []= $elem185; } $xfer += $input->readListEnd(); } else { @@ -7079,9 +7657,9 @@ class metastore_ThriftHiveMetastore_get_partition_names_result { { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter172) + foreach ($this->success as $iter186) { - $xfer += $output->writeString($iter172); + $xfer += $output->writeString($iter186); } } $output->writeListEnd(); @@ -7185,14 +7763,14 @@ class metastore_ThriftHiveMetastore_get_partitions_ps_args { case 3: if ($ftype == TType::LST) { $this->part_vals = array(); - $_size173 = 0; - $_etype176 = 0; - $xfer += $input->readListBegin($_etype176, $_size173); - for ($_i177 = 0; $_i177 < $_size173; ++$_i177) + $_size187 = 0; + $_etype190 = 0; + $xfer += $input->readListBegin($_etype190, $_size187); + for ($_i191 = 0; $_i191 < $_size187; ++$_i191) { - $elem178 = null; - $xfer += $input->readString($elem178); - $this->part_vals []= $elem178; + $elem192 = null; + $xfer += $input->readString($elem192); + $this->part_vals []= $elem192; } $xfer += $input->readListEnd(); } else { @@ -7237,9 +7815,9 @@ class metastore_ThriftHiveMetastore_get_partitions_ps_args { { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter179) + foreach ($this->part_vals as $iter193) { - $xfer += $output->writeString($iter179); + $xfer += $output->writeString($iter193); } } $output->writeListEnd(); @@ -7315,15 +7893,15 @@ class metastore_ThriftHiveMetastore_get_partitions_ps_result { case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size180 = 0; - $_etype183 = 0; - $xfer += $input->readListBegin($_etype183, $_size180); - for ($_i184 = 0; $_i184 < $_size180; ++$_i184) + $_size194 = 0; + $_etype197 = 0; + $xfer += $input->readListBegin($_etype197, $_size194); + for ($_i198 = 0; $_i198 < $_size194; ++$_i198) { - $elem185 = null; - $elem185 = new metastore_Partition(); - $xfer += $elem185->read($input); - $this->success []= $elem185; + $elem199 = null; + $elem199 = new metastore_Partition(); + $xfer += $elem199->read($input); + $this->success []= $elem199; } $xfer += $input->readListEnd(); } else { @@ -7359,9 +7937,9 @@ class metastore_ThriftHiveMetastore_get_partitions_ps_result { { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter186) + foreach ($this->success as $iter200) { - $xfer += $iter186->write($output); + $xfer += $iter200->write($output); } } $output->writeListEnd(); @@ -7465,14 +8043,14 @@ class metastore_ThriftHiveMetastore_get_partition_names_ps_args { case 3: if ($ftype == TType::LST) { $this->part_vals = array(); - $_size187 = 0; - $_etype190 = 0; - $xfer += $input->readListBegin($_etype190, $_size187); - for ($_i191 = 0; $_i191 < $_size187; ++$_i191) + $_size201 = 0; + $_etype204 = 0; + $xfer += $input->readListBegin($_etype204, $_size201); + for ($_i205 = 0; $_i205 < $_size201; ++$_i205) { - $elem192 = null; - $xfer += $input->readString($elem192); - $this->part_vals []= $elem192; + $elem206 = null; + $xfer += $input->readString($elem206); + $this->part_vals []= $elem206; } $xfer += $input->readListEnd(); } else { @@ -7517,9 +8095,9 @@ class metastore_ThriftHiveMetastore_get_partition_names_ps_args { { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter193) + foreach ($this->part_vals as $iter207) { - $xfer += $output->writeString($iter193); + $xfer += $output->writeString($iter207); } } $output->writeListEnd(); @@ -7594,14 +8172,14 @@ class metastore_ThriftHiveMetastore_get_partition_names_ps_result { case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size194 = 0; - $_etype197 = 0; - $xfer += $input->readListBegin($_etype197, $_size194); - for ($_i198 = 0; $_i198 < $_size194; ++$_i198) + $_size208 = 0; + $_etype211 = 0; + $xfer += $input->readListBegin($_etype211, $_size208); + for ($_i212 = 0; $_i212 < $_size208; ++$_i212) { - $elem199 = null; - $xfer += $input->readString($elem199); - $this->success []= $elem199; + $elem213 = null; + $xfer += $input->readString($elem213); + $this->success []= $elem213; } $xfer += $input->readListEnd(); } else { @@ -7637,9 +8215,9 @@ class metastore_ThriftHiveMetastore_get_partition_names_ps_result { { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter200) + foreach ($this->success as $iter214) { - $xfer += $output->writeString($iter200); + $xfer += $output->writeString($iter214); } } $output->writeListEnd(); @@ -8185,14 +8763,14 @@ class metastore_ThriftHiveMetastore_partition_name_to_vals_result { case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size201 = 0; - $_etype204 = 0; - $xfer += $input->readListBegin($_etype204, $_size201); - for ($_i205 = 0; $_i205 < $_size201; ++$_i205) + $_size215 = 0; + $_etype218 = 0; + $xfer += $input->readListBegin($_etype218, $_size215); + for ($_i219 = 0; $_i219 < $_size215; ++$_i219) { - $elem206 = null; - $xfer += $input->readString($elem206); - $this->success []= $elem206; + $elem220 = null; + $xfer += $input->readString($elem220); + $this->success []= $elem220; } $xfer += $input->readListEnd(); } else { @@ -8228,9 +8806,9 @@ class metastore_ThriftHiveMetastore_partition_name_to_vals_result { { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter207) + foreach ($this->success as $iter221) { - $xfer += $output->writeString($iter207); + $xfer += $output->writeString($iter221); } } $output->writeListEnd(); @@ -8381,17 +8959,17 @@ class metastore_ThriftHiveMetastore_partition_name_to_spec_result { case 0: if ($ftype == TType::MAP) { $this->success = array(); - $_size208 = 0; - $_ktype209 = 0; - $_vtype210 = 0; - $xfer += $input->readMapBegin($_ktype209, $_vtype210, $_size208); - for ($_i212 = 0; $_i212 < $_size208; ++$_i212) + $_size222 = 0; + $_ktype223 = 0; + $_vtype224 = 0; + $xfer += $input->readMapBegin($_ktype223, $_vtype224, $_size222); + for ($_i226 = 0; $_i226 < $_size222; ++$_i226) { - $key213 = ''; - $val214 = ''; - $xfer += $input->readString($key213); - $xfer += $input->readString($val214); - $this->success[$key213] = $val214; + $key227 = ''; + $val228 = ''; + $xfer += $input->readString($key227); + $xfer += $input->readString($val228); + $this->success[$key227] = $val228; } $xfer += $input->readMapEnd(); } else { @@ -8427,10 +9005,10 @@ class metastore_ThriftHiveMetastore_partition_name_to_spec_result { { $output->writeMapBegin(TType::STRING, TType::STRING, count($this->success)); { - foreach ($this->success as $kiter215 => $viter216) + foreach ($this->success as $kiter229 => $viter230) { - $xfer += $output->writeString($kiter215); - $xfer += $output->writeString($viter216); + $xfer += $output->writeString($kiter229); + $xfer += $output->writeString($viter230); } } $output->writeMapEnd(); diff --git metastore/src/gen-php/hive_metastore/ThriftHiveMetastore.php metastore/src/gen-php/hive_metastore/ThriftHiveMetastore.php new file mode 100644 index 0000000..6b3f6e9 --- /dev/null +++ metastore/src/gen-php/hive_metastore/ThriftHiveMetastore.php @@ -0,0 +1,9030 @@ +send_create_database($database); + $this->recv_create_database(); + } + + public function send_create_database($database) + { + $args = new metastore_ThriftHiveMetastore_create_database_args(); + $args->database = $database; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'create_database', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('create_database', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_create_database() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_create_database_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_create_database_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + if ($result->o3 !== null) { + throw $result->o3; + } + return; + } + + public function get_database($name) + { + $this->send_get_database($name); + return $this->recv_get_database(); + } + + public function send_get_database($name) + { + $args = new metastore_ThriftHiveMetastore_get_database_args(); + $args->name = $name; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_database', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_database', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_database() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_database_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_database_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + throw new Exception("get_database failed: unknown result"); + } + + public function drop_database($name, $deleteData) + { + $this->send_drop_database($name, $deleteData); + $this->recv_drop_database(); + } + + public function send_drop_database($name, $deleteData) + { + $args = new metastore_ThriftHiveMetastore_drop_database_args(); + $args->name = $name; + $args->deleteData = $deleteData; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'drop_database', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('drop_database', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_drop_database() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_drop_database_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_drop_database_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + if ($result->o3 !== null) { + throw $result->o3; + } + return; + } + + public function get_databases($pattern) + { + $this->send_get_databases($pattern); + return $this->recv_get_databases(); + } + + public function send_get_databases($pattern) + { + $args = new metastore_ThriftHiveMetastore_get_databases_args(); + $args->pattern = $pattern; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_databases', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_databases', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_databases() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_databases_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_databases_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new Exception("get_databases failed: unknown result"); + } + + public function get_all_databases() + { + $this->send_get_all_databases(); + return $this->recv_get_all_databases(); + } + + public function send_get_all_databases() + { + $args = new metastore_ThriftHiveMetastore_get_all_databases_args(); + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_all_databases', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_all_databases', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_all_databases() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_all_databases_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_all_databases_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new Exception("get_all_databases failed: unknown result"); + } + + public function get_type($name) + { + $this->send_get_type($name); + return $this->recv_get_type(); + } + + public function send_get_type($name) + { + $args = new metastore_ThriftHiveMetastore_get_type_args(); + $args->name = $name; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_type', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_type', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_type() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_type_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_type_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + throw new Exception("get_type failed: unknown result"); + } + + public function create_type($type) + { + $this->send_create_type($type); + return $this->recv_create_type(); + } + + public function send_create_type($type) + { + $args = new metastore_ThriftHiveMetastore_create_type_args(); + $args->type = $type; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'create_type', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('create_type', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_create_type() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_create_type_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_create_type_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + if ($result->o3 !== null) { + throw $result->o3; + } + throw new Exception("create_type failed: unknown result"); + } + + public function drop_type($type) + { + $this->send_drop_type($type); + return $this->recv_drop_type(); + } + + public function send_drop_type($type) + { + $args = new metastore_ThriftHiveMetastore_drop_type_args(); + $args->type = $type; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'drop_type', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('drop_type', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_drop_type() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_drop_type_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_drop_type_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + throw new Exception("drop_type failed: unknown result"); + } + + public function get_type_all($name) + { + $this->send_get_type_all($name); + return $this->recv_get_type_all(); + } + + public function send_get_type_all($name) + { + $args = new metastore_ThriftHiveMetastore_get_type_all_args(); + $args->name = $name; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_type_all', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_type_all', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_type_all() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_type_all_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_type_all_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o2 !== null) { + throw $result->o2; + } + throw new Exception("get_type_all failed: unknown result"); + } + + public function get_fields($db_name, $table_name) + { + $this->send_get_fields($db_name, $table_name); + return $this->recv_get_fields(); + } + + public function send_get_fields($db_name, $table_name) + { + $args = new metastore_ThriftHiveMetastore_get_fields_args(); + $args->db_name = $db_name; + $args->table_name = $table_name; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_fields', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_fields', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_fields() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_fields_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_fields_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + if ($result->o3 !== null) { + throw $result->o3; + } + throw new Exception("get_fields failed: unknown result"); + } + + public function get_schema($db_name, $table_name) + { + $this->send_get_schema($db_name, $table_name); + return $this->recv_get_schema(); + } + + public function send_get_schema($db_name, $table_name) + { + $args = new metastore_ThriftHiveMetastore_get_schema_args(); + $args->db_name = $db_name; + $args->table_name = $table_name; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_schema', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_schema', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_schema() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_schema_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_schema_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + if ($result->o3 !== null) { + throw $result->o3; + } + throw new Exception("get_schema failed: unknown result"); + } + + public function create_table($tbl) + { + $this->send_create_table($tbl); + $this->recv_create_table(); + } + + public function send_create_table($tbl) + { + $args = new metastore_ThriftHiveMetastore_create_table_args(); + $args->tbl = $tbl; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'create_table', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('create_table', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_create_table() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_create_table_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_create_table_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + if ($result->o3 !== null) { + throw $result->o3; + } + if ($result->o4 !== null) { + throw $result->o4; + } + return; + } + + public function drop_table($dbname, $name, $deleteData) + { + $this->send_drop_table($dbname, $name, $deleteData); + $this->recv_drop_table(); + } + + public function send_drop_table($dbname, $name, $deleteData) + { + $args = new metastore_ThriftHiveMetastore_drop_table_args(); + $args->dbname = $dbname; + $args->name = $name; + $args->deleteData = $deleteData; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'drop_table', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('drop_table', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_drop_table() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_drop_table_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_drop_table_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o3 !== null) { + throw $result->o3; + } + return; + } + + public function get_tables($db_name, $pattern) + { + $this->send_get_tables($db_name, $pattern); + return $this->recv_get_tables(); + } + + public function send_get_tables($db_name, $pattern) + { + $args = new metastore_ThriftHiveMetastore_get_tables_args(); + $args->db_name = $db_name; + $args->pattern = $pattern; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_tables', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_tables', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_tables() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_tables_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_tables_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new Exception("get_tables failed: unknown result"); + } + + public function get_all_tables($db_name) + { + $this->send_get_all_tables($db_name); + return $this->recv_get_all_tables(); + } + + public function send_get_all_tables($db_name) + { + $args = new metastore_ThriftHiveMetastore_get_all_tables_args(); + $args->db_name = $db_name; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_all_tables', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_all_tables', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_all_tables() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_all_tables_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_all_tables_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new Exception("get_all_tables failed: unknown result"); + } + + public function get_table($dbname, $tbl_name) + { + $this->send_get_table($dbname, $tbl_name); + return $this->recv_get_table(); + } + + public function send_get_table($dbname, $tbl_name) + { + $args = new metastore_ThriftHiveMetastore_get_table_args(); + $args->dbname = $dbname; + $args->tbl_name = $tbl_name; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_table', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_table', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_table() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_table_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_table_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + throw new Exception("get_table failed: unknown result"); + } + + public function alter_table($dbname, $tbl_name, $new_tbl) + { + $this->send_alter_table($dbname, $tbl_name, $new_tbl); + $this->recv_alter_table(); + } + + public function send_alter_table($dbname, $tbl_name, $new_tbl) + { + $args = new metastore_ThriftHiveMetastore_alter_table_args(); + $args->dbname = $dbname; + $args->tbl_name = $tbl_name; + $args->new_tbl = $new_tbl; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'alter_table', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('alter_table', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_alter_table() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_alter_table_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_alter_table_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + return; + } + + public function add_partition($new_part) + { + $this->send_add_partition($new_part); + return $this->recv_add_partition(); + } + + public function send_add_partition($new_part) + { + $args = new metastore_ThriftHiveMetastore_add_partition_args(); + $args->new_part = $new_part; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'add_partition', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('add_partition', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_add_partition() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_add_partition_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_add_partition_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + if ($result->o3 !== null) { + throw $result->o3; + } + throw new Exception("add_partition failed: unknown result"); + } + + public function append_partition($db_name, $tbl_name, $part_vals) + { + $this->send_append_partition($db_name, $tbl_name, $part_vals); + return $this->recv_append_partition(); + } + + public function send_append_partition($db_name, $tbl_name, $part_vals) + { + $args = new metastore_ThriftHiveMetastore_append_partition_args(); + $args->db_name = $db_name; + $args->tbl_name = $tbl_name; + $args->part_vals = $part_vals; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'append_partition', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('append_partition', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_append_partition() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_append_partition_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_append_partition_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + if ($result->o3 !== null) { + throw $result->o3; + } + throw new Exception("append_partition failed: unknown result"); + } + + public function append_partition_by_name($db_name, $tbl_name, $part_name) + { + $this->send_append_partition_by_name($db_name, $tbl_name, $part_name); + return $this->recv_append_partition_by_name(); + } + + public function send_append_partition_by_name($db_name, $tbl_name, $part_name) + { + $args = new metastore_ThriftHiveMetastore_append_partition_by_name_args(); + $args->db_name = $db_name; + $args->tbl_name = $tbl_name; + $args->part_name = $part_name; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'append_partition_by_name', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('append_partition_by_name', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_append_partition_by_name() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_append_partition_by_name_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_append_partition_by_name_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + if ($result->o3 !== null) { + throw $result->o3; + } + throw new Exception("append_partition_by_name failed: unknown result"); + } + + public function drop_partition($db_name, $tbl_name, $part_vals, $deleteData) + { + $this->send_drop_partition($db_name, $tbl_name, $part_vals, $deleteData); + return $this->recv_drop_partition(); + } + + public function send_drop_partition($db_name, $tbl_name, $part_vals, $deleteData) + { + $args = new metastore_ThriftHiveMetastore_drop_partition_args(); + $args->db_name = $db_name; + $args->tbl_name = $tbl_name; + $args->part_vals = $part_vals; + $args->deleteData = $deleteData; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'drop_partition', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('drop_partition', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_drop_partition() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_drop_partition_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_drop_partition_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + throw new Exception("drop_partition failed: unknown result"); + } + + public function drop_partition_by_name($db_name, $tbl_name, $part_name, $deleteData) + { + $this->send_drop_partition_by_name($db_name, $tbl_name, $part_name, $deleteData); + return $this->recv_drop_partition_by_name(); + } + + public function send_drop_partition_by_name($db_name, $tbl_name, $part_name, $deleteData) + { + $args = new metastore_ThriftHiveMetastore_drop_partition_by_name_args(); + $args->db_name = $db_name; + $args->tbl_name = $tbl_name; + $args->part_name = $part_name; + $args->deleteData = $deleteData; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'drop_partition_by_name', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('drop_partition_by_name', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_drop_partition_by_name() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_drop_partition_by_name_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_drop_partition_by_name_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + throw new Exception("drop_partition_by_name failed: unknown result"); + } + + public function get_partition($db_name, $tbl_name, $part_vals) + { + $this->send_get_partition($db_name, $tbl_name, $part_vals); + return $this->recv_get_partition(); + } + + public function send_get_partition($db_name, $tbl_name, $part_vals) + { + $args = new metastore_ThriftHiveMetastore_get_partition_args(); + $args->db_name = $db_name; + $args->tbl_name = $tbl_name; + $args->part_vals = $part_vals; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_partition', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_partition', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_partition() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_partition_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_partition_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + throw new Exception("get_partition failed: unknown result"); + } + + public function get_partition_by_name($db_name, $tbl_name, $part_name) + { + $this->send_get_partition_by_name($db_name, $tbl_name, $part_name); + return $this->recv_get_partition_by_name(); + } + + public function send_get_partition_by_name($db_name, $tbl_name, $part_name) + { + $args = new metastore_ThriftHiveMetastore_get_partition_by_name_args(); + $args->db_name = $db_name; + $args->tbl_name = $tbl_name; + $args->part_name = $part_name; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_partition_by_name', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_partition_by_name', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_partition_by_name() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_partition_by_name_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_partition_by_name_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + throw new Exception("get_partition_by_name failed: unknown result"); + } + + public function get_partitions($db_name, $tbl_name, $max_parts) + { + $this->send_get_partitions($db_name, $tbl_name, $max_parts); + return $this->recv_get_partitions(); + } + + public function send_get_partitions($db_name, $tbl_name, $max_parts) + { + $args = new metastore_ThriftHiveMetastore_get_partitions_args(); + $args->db_name = $db_name; + $args->tbl_name = $tbl_name; + $args->max_parts = $max_parts; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_partitions', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_partitions', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_partitions() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_partitions_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_partitions_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + throw new Exception("get_partitions failed: unknown result"); + } + + public function get_partition_names($db_name, $tbl_name, $max_parts) + { + $this->send_get_partition_names($db_name, $tbl_name, $max_parts); + return $this->recv_get_partition_names(); + } + + public function send_get_partition_names($db_name, $tbl_name, $max_parts) + { + $args = new metastore_ThriftHiveMetastore_get_partition_names_args(); + $args->db_name = $db_name; + $args->tbl_name = $tbl_name; + $args->max_parts = $max_parts; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_partition_names', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_partition_names', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_partition_names() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_partition_names_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_partition_names_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o2 !== null) { + throw $result->o2; + } + throw new Exception("get_partition_names failed: unknown result"); + } + + public function get_partitions_ps($db_name, $tbl_name, $part_vals, $max_parts) + { + $this->send_get_partitions_ps($db_name, $tbl_name, $part_vals, $max_parts); + return $this->recv_get_partitions_ps(); + } + + public function send_get_partitions_ps($db_name, $tbl_name, $part_vals, $max_parts) + { + $args = new metastore_ThriftHiveMetastore_get_partitions_ps_args(); + $args->db_name = $db_name; + $args->tbl_name = $tbl_name; + $args->part_vals = $part_vals; + $args->max_parts = $max_parts; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_partitions_ps', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_partitions_ps', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_partitions_ps() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_partitions_ps_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_partitions_ps_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new Exception("get_partitions_ps failed: unknown result"); + } + + public function get_partition_names_ps($db_name, $tbl_name, $part_vals, $max_parts) + { + $this->send_get_partition_names_ps($db_name, $tbl_name, $part_vals, $max_parts); + return $this->recv_get_partition_names_ps(); + } + + public function send_get_partition_names_ps($db_name, $tbl_name, $part_vals, $max_parts) + { + $args = new metastore_ThriftHiveMetastore_get_partition_names_ps_args(); + $args->db_name = $db_name; + $args->tbl_name = $tbl_name; + $args->part_vals = $part_vals; + $args->max_parts = $max_parts; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_partition_names_ps', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_partition_names_ps', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_partition_names_ps() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_partition_names_ps_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_partition_names_ps_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new Exception("get_partition_names_ps failed: unknown result"); + } + + public function alter_partition($db_name, $tbl_name, $new_part) + { + $this->send_alter_partition($db_name, $tbl_name, $new_part); + $this->recv_alter_partition(); + } + + public function send_alter_partition($db_name, $tbl_name, $new_part) + { + $args = new metastore_ThriftHiveMetastore_alter_partition_args(); + $args->db_name = $db_name; + $args->tbl_name = $tbl_name; + $args->new_part = $new_part; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'alter_partition', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('alter_partition', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_alter_partition() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_alter_partition_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_alter_partition_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + return; + } + + public function get_config_value($name, $defaultValue) + { + $this->send_get_config_value($name, $defaultValue); + return $this->recv_get_config_value(); + } + + public function send_get_config_value($name, $defaultValue) + { + $args = new metastore_ThriftHiveMetastore_get_config_value_args(); + $args->name = $name; + $args->defaultValue = $defaultValue; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_config_value', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_config_value', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_config_value() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_config_value_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_config_value_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new Exception("get_config_value failed: unknown result"); + } + + public function partition_name_to_vals($part_name) + { + $this->send_partition_name_to_vals($part_name); + return $this->recv_partition_name_to_vals(); + } + + public function send_partition_name_to_vals($part_name) + { + $args = new metastore_ThriftHiveMetastore_partition_name_to_vals_args(); + $args->part_name = $part_name; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'partition_name_to_vals', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('partition_name_to_vals', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_partition_name_to_vals() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_partition_name_to_vals_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_partition_name_to_vals_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new Exception("partition_name_to_vals failed: unknown result"); + } + + public function partition_name_to_spec($part_name) + { + $this->send_partition_name_to_spec($part_name); + return $this->recv_partition_name_to_spec(); + } + + public function send_partition_name_to_spec($part_name) + { + $args = new metastore_ThriftHiveMetastore_partition_name_to_spec_args(); + $args->part_name = $part_name; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'partition_name_to_spec', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('partition_name_to_spec', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_partition_name_to_spec() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_partition_name_to_spec_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_partition_name_to_spec_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new Exception("partition_name_to_spec failed: unknown result"); + } + +} + +// HELPER FUNCTIONS AND STRUCTURES + +class metastore_ThriftHiveMetastore_create_database_args { + static $_TSPEC; + + public $database = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'database', + 'type' => TType::STRUCT, + 'class' => 'metastore_Database', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['database'])) { + $this->database = $vals['database']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_create_database_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->database = new metastore_Database(); + $xfer += $this->database->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_create_database_args'); + if ($this->database !== null) { + if (!is_object($this->database)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('database', TType::STRUCT, 1); + $xfer += $this->database->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_create_database_result { + static $_TSPEC; + + public $o1 = null; + public $o2 = null; + public $o3 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_AlreadyExistsException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_InvalidObjectException', + ), + 3 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_create_database_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_AlreadyExistsException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_InvalidObjectException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_MetaException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_create_database_result'); + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $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; + } + +} + +class metastore_ThriftHiveMetastore_get_database_args { + static $_TSPEC; + + public $name = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'name', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['name'])) { + $this->name = $vals['name']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_database_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->name); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_database_args'); + if ($this->name !== null) { + $xfer += $output->writeFieldBegin('name', TType::STRING, 1); + $xfer += $output->writeString($this->name); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_database_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => 'metastore_Database', + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_database_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRUCT) { + $this->success = new metastore_Database(); + $xfer += $this->success->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_NoSuchObjectException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_MetaException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_database_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_drop_database_args { + static $_TSPEC; + + public $name = null; + public $deleteData = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'deleteData', + 'type' => TType::BOOL, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['name'])) { + $this->name = $vals['name']; + } + if (isset($vals['deleteData'])) { + $this->deleteData = $vals['deleteData']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_drop_database_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->deleteData); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_drop_database_args'); + if ($this->name !== null) { + $xfer += $output->writeFieldBegin('name', TType::STRING, 1); + $xfer += $output->writeString($this->name); + $xfer += $output->writeFieldEnd(); + } + if ($this->deleteData !== null) { + $xfer += $output->writeFieldBegin('deleteData', TType::BOOL, 2); + $xfer += $output->writeBool($this->deleteData); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_drop_database_result { + static $_TSPEC; + + public $o1 = null; + public $o2 = null; + public $o3 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_InvalidOperationException', + ), + 3 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_drop_database_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_NoSuchObjectException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_InvalidOperationException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_MetaException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_drop_database_result'); + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $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; + } + +} + +class metastore_ThriftHiveMetastore_get_databases_args { + static $_TSPEC; + + public $pattern = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'pattern', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['pattern'])) { + $this->pattern = $vals['pattern']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_databases_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->pattern); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_databases_args'); + if ($this->pattern !== null) { + $xfer += $output->writeFieldBegin('pattern', TType::STRING, 1); + $xfer += $output->writeString($this->pattern); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_databases_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_databases_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size101 = 0; + $_etype104 = 0; + $xfer += $input->readListBegin($_etype104, $_size101); + for ($_i105 = 0; $_i105 < $_size101; ++$_i105) + { + $elem106 = null; + $xfer += $input->readString($elem106); + $this->success []= $elem106; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_databases_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRING, count($this->success)); + { + foreach ($this->success as $iter107) + { + $xfer += $output->writeString($iter107); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_all_databases_args { + static $_TSPEC; + + + public function __construct() { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + ); + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_all_databases_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_all_databases_args'); + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_all_databases_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_all_databases_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size108 = 0; + $_etype111 = 0; + $xfer += $input->readListBegin($_etype111, $_size108); + for ($_i112 = 0; $_i112 < $_size108; ++$_i112) + { + $elem113 = null; + $xfer += $input->readString($elem113); + $this->success []= $elem113; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_all_databases_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRING, count($this->success)); + { + foreach ($this->success as $iter114) + { + $xfer += $output->writeString($iter114); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_type_args { + static $_TSPEC; + + public $name = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'name', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['name'])) { + $this->name = $vals['name']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_type_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->name); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_type_args'); + if ($this->name !== null) { + $xfer += $output->writeFieldBegin('name', TType::STRING, 1); + $xfer += $output->writeString($this->name); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_type_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => 'metastore_Type', + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_type_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRUCT) { + $this->success = new metastore_Type(); + $xfer += $this->success->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_NoSuchObjectException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_type_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_create_type_args { + static $_TSPEC; + + public $type = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'type', + 'type' => TType::STRUCT, + 'class' => 'metastore_Type', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['type'])) { + $this->type = $vals['type']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_create_type_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->type = new metastore_Type(); + $xfer += $this->type->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_create_type_args'); + if ($this->type !== null) { + if (!is_object($this->type)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('type', TType::STRUCT, 1); + $xfer += $this->type->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_create_type_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + public $o3 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::BOOL, + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_AlreadyExistsException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_InvalidObjectException', + ), + 3 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_create_type_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->success); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_AlreadyExistsException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_InvalidObjectException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_MetaException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_create_type_result'); + if ($this->success !== null) { + $xfer += $output->writeFieldBegin('success', TType::BOOL, 0); + $xfer += $output->writeBool($this->success); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $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; + } + +} + +class metastore_ThriftHiveMetastore_drop_type_args { + static $_TSPEC; + + public $type = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'type', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['type'])) { + $this->type = $vals['type']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_drop_type_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->type); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_drop_type_args'); + if ($this->type !== null) { + $xfer += $output->writeFieldBegin('type', TType::STRING, 1); + $xfer += $output->writeString($this->type); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_drop_type_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::BOOL, + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_drop_type_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->success); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_NoSuchObjectException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_drop_type_result'); + if ($this->success !== null) { + $xfer += $output->writeFieldBegin('success', TType::BOOL, 0); + $xfer += $output->writeBool($this->success); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_type_all_args { + static $_TSPEC; + + public $name = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'name', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['name'])) { + $this->name = $vals['name']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_type_all_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->name); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_type_all_args'); + if ($this->name !== null) { + $xfer += $output->writeFieldBegin('name', TType::STRING, 1); + $xfer += $output->writeString($this->name); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_type_all_result { + static $_TSPEC; + + public $success = null; + public $o2 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::MAP, + 'ktype' => TType::STRING, + 'vtype' => TType::STRUCT, + 'key' => array( + 'type' => TType::STRING, + ), + 'val' => array( + 'type' => TType::STRUCT, + 'class' => 'metastore_Type', + ), + ), + 1 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_type_all_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::MAP) { + $this->success = array(); + $_size115 = 0; + $_ktype116 = 0; + $_vtype117 = 0; + $xfer += $input->readMapBegin($_ktype116, $_vtype117, $_size115); + for ($_i119 = 0; $_i119 < $_size115; ++$_i119) + { + $key120 = ''; + $val121 = new metastore_Type(); + $xfer += $input->readString($key120); + $val121 = new metastore_Type(); + $xfer += $val121->read($input); + $this->success[$key120] = $val121; + } + $xfer += $input->readMapEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_MetaException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_type_all_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::MAP, 0); + { + $output->writeMapBegin(TType::STRING, TType::STRUCT, count($this->success)); + { + foreach ($this->success as $kiter122 => $viter123) + { + $xfer += $output->writeString($kiter122); + $xfer += $viter123->write($output); + } + } + $output->writeMapEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 1); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_fields_args { + static $_TSPEC; + + public $db_name = null; + public $table_name = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'table_name', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['table_name'])) { + $this->table_name = $vals['table_name']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_fields_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->table_name); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_fields_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->table_name !== null) { + $xfer += $output->writeFieldBegin('table_name', TType::STRING, 2); + $xfer += $output->writeString($this->table_name); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_fields_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + public $o3 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRUCT, + 'elem' => array( + 'type' => TType::STRUCT, + 'class' => 'metastore_FieldSchema', + ), + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_UnknownTableException', + ), + 3 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, + 'class' => 'metastore_UnknownDBException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_fields_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size124 = 0; + $_etype127 = 0; + $xfer += $input->readListBegin($_etype127, $_size124); + for ($_i128 = 0; $_i128 < $_size124; ++$_i128) + { + $elem129 = null; + $elem129 = new metastore_FieldSchema(); + $xfer += $elem129->read($input); + $this->success []= $elem129; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_UnknownTableException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_UnknownDBException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_fields_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRUCT, count($this->success)); + { + foreach ($this->success as $iter130) + { + $xfer += $iter130->write($output); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $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; + } + +} + +class metastore_ThriftHiveMetastore_get_schema_args { + static $_TSPEC; + + public $db_name = null; + public $table_name = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'table_name', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['table_name'])) { + $this->table_name = $vals['table_name']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_schema_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->table_name); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_schema_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->table_name !== null) { + $xfer += $output->writeFieldBegin('table_name', TType::STRING, 2); + $xfer += $output->writeString($this->table_name); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_schema_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + public $o3 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRUCT, + 'elem' => array( + 'type' => TType::STRUCT, + 'class' => 'metastore_FieldSchema', + ), + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_UnknownTableException', + ), + 3 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, + 'class' => 'metastore_UnknownDBException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_schema_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size131 = 0; + $_etype134 = 0; + $xfer += $input->readListBegin($_etype134, $_size131); + for ($_i135 = 0; $_i135 < $_size131; ++$_i135) + { + $elem136 = null; + $elem136 = new metastore_FieldSchema(); + $xfer += $elem136->read($input); + $this->success []= $elem136; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_UnknownTableException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_UnknownDBException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_schema_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRUCT, count($this->success)); + { + foreach ($this->success as $iter137) + { + $xfer += $iter137->write($output); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $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; + } + +} + +class metastore_ThriftHiveMetastore_create_table_args { + static $_TSPEC; + + public $tbl = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'tbl', + 'type' => TType::STRUCT, + 'class' => 'metastore_Table', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['tbl'])) { + $this->tbl = $vals['tbl']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_create_table_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->tbl = new metastore_Table(); + $xfer += $this->tbl->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_create_table_args'); + if ($this->tbl !== null) { + if (!is_object($this->tbl)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('tbl', TType::STRUCT, 1); + $xfer += $this->tbl->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_create_table_result { + static $_TSPEC; + + public $o1 = null; + public $o2 = null; + public $o3 = null; + public $o4 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_AlreadyExistsException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_InvalidObjectException', + ), + 3 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + 4 => array( + 'var' => 'o4', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } + if (isset($vals['o4'])) { + $this->o4 = $vals['o4']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_create_table_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_AlreadyExistsException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_InvalidObjectException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_MetaException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::STRUCT) { + $this->o4 = new metastore_NoSuchObjectException(); + $xfer += $this->o4->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_create_table_result'); + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $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(); + } + if ($this->o4 !== null) { + $xfer += $output->writeFieldBegin('o4', TType::STRUCT, 4); + $xfer += $this->o4->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_drop_table_args { + static $_TSPEC; + + public $dbname = null; + public $name = null; + public $deleteData = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'dbname', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'deleteData', + 'type' => TType::BOOL, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['dbname'])) { + $this->dbname = $vals['dbname']; + } + if (isset($vals['name'])) { + $this->name = $vals['name']; + } + if (isset($vals['deleteData'])) { + $this->deleteData = $vals['deleteData']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_drop_table_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->dbname); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->deleteData); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_drop_table_args'); + if ($this->dbname !== null) { + $xfer += $output->writeFieldBegin('dbname', TType::STRING, 1); + $xfer += $output->writeString($this->dbname); + $xfer += $output->writeFieldEnd(); + } + if ($this->name !== null) { + $xfer += $output->writeFieldBegin('name', TType::STRING, 2); + $xfer += $output->writeString($this->name); + $xfer += $output->writeFieldEnd(); + } + if ($this->deleteData !== null) { + $xfer += $output->writeFieldBegin('deleteData', TType::BOOL, 3); + $xfer += $output->writeBool($this->deleteData); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_drop_table_result { + static $_TSPEC; + + public $o1 = null; + public $o3 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), + 2 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_drop_table_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_NoSuchObjectException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_MetaException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_drop_table_result'); + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o3 !== null) { + $xfer += $output->writeFieldBegin('o3', TType::STRUCT, 2); + $xfer += $this->o3->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_tables_args { + static $_TSPEC; + + public $db_name = null; + public $pattern = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'pattern', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['pattern'])) { + $this->pattern = $vals['pattern']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_tables_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->pattern); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_tables_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->pattern !== null) { + $xfer += $output->writeFieldBegin('pattern', TType::STRING, 2); + $xfer += $output->writeString($this->pattern); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_tables_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_tables_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size138 = 0; + $_etype141 = 0; + $xfer += $input->readListBegin($_etype141, $_size138); + for ($_i142 = 0; $_i142 < $_size138; ++$_i142) + { + $elem143 = null; + $xfer += $input->readString($elem143); + $this->success []= $elem143; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_tables_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRING, count($this->success)); + { + foreach ($this->success as $iter144) + { + $xfer += $output->writeString($iter144); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_all_tables_args { + static $_TSPEC; + + public $db_name = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_all_tables_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_all_tables_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_all_tables_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_all_tables_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size145 = 0; + $_etype148 = 0; + $xfer += $input->readListBegin($_etype148, $_size145); + for ($_i149 = 0; $_i149 < $_size145; ++$_i149) + { + $elem150 = null; + $xfer += $input->readString($elem150); + $this->success []= $elem150; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_all_tables_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRING, count($this->success)); + { + foreach ($this->success as $iter151) + { + $xfer += $output->writeString($iter151); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_table_args { + static $_TSPEC; + + public $dbname = null; + public $tbl_name = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'dbname', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['dbname'])) { + $this->dbname = $vals['dbname']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_table_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->dbname); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_table_args'); + if ($this->dbname !== null) { + $xfer += $output->writeFieldBegin('dbname', TType::STRING, 1); + $xfer += $output->writeString($this->dbname); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_table_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => 'metastore_Table', + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_table_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRUCT) { + $this->success = new metastore_Table(); + $xfer += $this->success->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_NoSuchObjectException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_table_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_alter_table_args { + static $_TSPEC; + + public $dbname = null; + public $tbl_name = null; + public $new_tbl = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'dbname', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'new_tbl', + 'type' => TType::STRUCT, + 'class' => 'metastore_Table', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['dbname'])) { + $this->dbname = $vals['dbname']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + if (isset($vals['new_tbl'])) { + $this->new_tbl = $vals['new_tbl']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_alter_table_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->dbname); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->new_tbl = new metastore_Table(); + $xfer += $this->new_tbl->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_alter_table_args'); + if ($this->dbname !== null) { + $xfer += $output->writeFieldBegin('dbname', TType::STRING, 1); + $xfer += $output->writeString($this->dbname); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->new_tbl !== null) { + if (!is_object($this->new_tbl)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('new_tbl', TType::STRUCT, 3); + $xfer += $this->new_tbl->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_alter_table_result { + static $_TSPEC; + + public $o1 = null; + public $o2 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_InvalidOperationException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_alter_table_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_InvalidOperationException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_MetaException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_alter_table_result'); + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_add_partition_args { + static $_TSPEC; + + public $new_part = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'new_part', + 'type' => TType::STRUCT, + 'class' => 'metastore_Partition', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['new_part'])) { + $this->new_part = $vals['new_part']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_add_partition_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->new_part = new metastore_Partition(); + $xfer += $this->new_part->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_add_partition_args'); + if ($this->new_part !== null) { + if (!is_object($this->new_part)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('new_part', TType::STRUCT, 1); + $xfer += $this->new_part->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_add_partition_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + public $o3 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => 'metastore_Partition', + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_InvalidObjectException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_AlreadyExistsException', + ), + 3 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_add_partition_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRUCT) { + $this->success = new metastore_Partition(); + $xfer += $this->success->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_InvalidObjectException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_AlreadyExistsException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_MetaException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_add_partition_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $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; + } + +} + +class metastore_ThriftHiveMetastore_append_partition_args { + static $_TSPEC; + + public $db_name = null; + public $tbl_name = null; + public $part_vals = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'part_vals', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + if (isset($vals['part_vals'])) { + $this->part_vals = $vals['part_vals']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_append_partition_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::LST) { + $this->part_vals = array(); + $_size152 = 0; + $_etype155 = 0; + $xfer += $input->readListBegin($_etype155, $_size152); + for ($_i156 = 0; $_i156 < $_size152; ++$_i156) + { + $elem157 = null; + $xfer += $input->readString($elem157); + $this->part_vals []= $elem157; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_append_partition_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->part_vals !== null) { + if (!is_array($this->part_vals)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('part_vals', TType::LST, 3); + { + $output->writeListBegin(TType::STRING, count($this->part_vals)); + { + foreach ($this->part_vals as $iter158) + { + $xfer += $output->writeString($iter158); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_append_partition_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + public $o3 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => 'metastore_Partition', + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_InvalidObjectException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_AlreadyExistsException', + ), + 3 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_append_partition_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRUCT) { + $this->success = new metastore_Partition(); + $xfer += $this->success->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_InvalidObjectException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_AlreadyExistsException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_MetaException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_append_partition_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $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; + } + +} + +class metastore_ThriftHiveMetastore_append_partition_by_name_args { + static $_TSPEC; + + public $db_name = null; + public $tbl_name = null; + public $part_name = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'part_name', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + if (isset($vals['part_name'])) { + $this->part_name = $vals['part_name']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_append_partition_by_name_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->part_name); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_append_partition_by_name_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->part_name !== null) { + $xfer += $output->writeFieldBegin('part_name', TType::STRING, 3); + $xfer += $output->writeString($this->part_name); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_append_partition_by_name_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + public $o3 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => 'metastore_Partition', + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_InvalidObjectException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_AlreadyExistsException', + ), + 3 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_append_partition_by_name_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRUCT) { + $this->success = new metastore_Partition(); + $xfer += $this->success->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_InvalidObjectException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_AlreadyExistsException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_MetaException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_append_partition_by_name_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $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; + } + +} + +class metastore_ThriftHiveMetastore_drop_partition_args { + static $_TSPEC; + + public $db_name = null; + public $tbl_name = null; + public $part_vals = null; + public $deleteData = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'part_vals', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 4 => array( + 'var' => 'deleteData', + 'type' => TType::BOOL, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + if (isset($vals['part_vals'])) { + $this->part_vals = $vals['part_vals']; + } + if (isset($vals['deleteData'])) { + $this->deleteData = $vals['deleteData']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_drop_partition_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::LST) { + $this->part_vals = array(); + $_size159 = 0; + $_etype162 = 0; + $xfer += $input->readListBegin($_etype162, $_size159); + for ($_i163 = 0; $_i163 < $_size159; ++$_i163) + { + $elem164 = null; + $xfer += $input->readString($elem164); + $this->part_vals []= $elem164; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->deleteData); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_drop_partition_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->part_vals !== null) { + if (!is_array($this->part_vals)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('part_vals', TType::LST, 3); + { + $output->writeListBegin(TType::STRING, count($this->part_vals)); + { + foreach ($this->part_vals as $iter165) + { + $xfer += $output->writeString($iter165); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->deleteData !== null) { + $xfer += $output->writeFieldBegin('deleteData', TType::BOOL, 4); + $xfer += $output->writeBool($this->deleteData); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_drop_partition_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::BOOL, + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_drop_partition_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->success); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_NoSuchObjectException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_MetaException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_drop_partition_result'); + if ($this->success !== null) { + $xfer += $output->writeFieldBegin('success', TType::BOOL, 0); + $xfer += $output->writeBool($this->success); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_drop_partition_by_name_args { + static $_TSPEC; + + public $db_name = null; + public $tbl_name = null; + public $part_name = null; + public $deleteData = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'part_name', + 'type' => TType::STRING, + ), + 4 => array( + 'var' => 'deleteData', + 'type' => TType::BOOL, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + if (isset($vals['part_name'])) { + $this->part_name = $vals['part_name']; + } + if (isset($vals['deleteData'])) { + $this->deleteData = $vals['deleteData']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_drop_partition_by_name_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->part_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->deleteData); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_drop_partition_by_name_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->part_name !== null) { + $xfer += $output->writeFieldBegin('part_name', TType::STRING, 3); + $xfer += $output->writeString($this->part_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->deleteData !== null) { + $xfer += $output->writeFieldBegin('deleteData', TType::BOOL, 4); + $xfer += $output->writeBool($this->deleteData); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_drop_partition_by_name_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::BOOL, + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_drop_partition_by_name_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->success); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_NoSuchObjectException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_MetaException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_drop_partition_by_name_result'); + if ($this->success !== null) { + $xfer += $output->writeFieldBegin('success', TType::BOOL, 0); + $xfer += $output->writeBool($this->success); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_partition_args { + static $_TSPEC; + + public $db_name = null; + public $tbl_name = null; + public $part_vals = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'part_vals', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + if (isset($vals['part_vals'])) { + $this->part_vals = $vals['part_vals']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_partition_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::LST) { + $this->part_vals = array(); + $_size166 = 0; + $_etype169 = 0; + $xfer += $input->readListBegin($_etype169, $_size166); + for ($_i170 = 0; $_i170 < $_size166; ++$_i170) + { + $elem171 = null; + $xfer += $input->readString($elem171); + $this->part_vals []= $elem171; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_partition_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->part_vals !== null) { + if (!is_array($this->part_vals)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('part_vals', TType::LST, 3); + { + $output->writeListBegin(TType::STRING, count($this->part_vals)); + { + foreach ($this->part_vals as $iter172) + { + $xfer += $output->writeString($iter172); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_partition_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => 'metastore_Partition', + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_partition_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRUCT) { + $this->success = new metastore_Partition(); + $xfer += $this->success->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_NoSuchObjectException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_partition_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_partition_by_name_args { + static $_TSPEC; + + public $db_name = null; + public $tbl_name = null; + public $part_name = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'part_name', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + if (isset($vals['part_name'])) { + $this->part_name = $vals['part_name']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_partition_by_name_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->part_name); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_partition_by_name_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->part_name !== null) { + $xfer += $output->writeFieldBegin('part_name', TType::STRING, 3); + $xfer += $output->writeString($this->part_name); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_partition_by_name_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => 'metastore_Partition', + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_partition_by_name_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRUCT) { + $this->success = new metastore_Partition(); + $xfer += $this->success->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_NoSuchObjectException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_partition_by_name_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_partitions_args { + static $_TSPEC; + + public $db_name = null; + public $tbl_name = null; + public $max_parts = -1; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'max_parts', + 'type' => TType::I16, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + if (isset($vals['max_parts'])) { + $this->max_parts = $vals['max_parts']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_partitions_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::I16) { + $xfer += $input->readI16($this->max_parts); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_partitions_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->max_parts !== null) { + $xfer += $output->writeFieldBegin('max_parts', TType::I16, 3); + $xfer += $output->writeI16($this->max_parts); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_partitions_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRUCT, + 'elem' => array( + 'type' => TType::STRUCT, + 'class' => 'metastore_Partition', + ), + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_partitions_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size173 = 0; + $_etype176 = 0; + $xfer += $input->readListBegin($_etype176, $_size173); + for ($_i177 = 0; $_i177 < $_size173; ++$_i177) + { + $elem178 = null; + $elem178 = new metastore_Partition(); + $xfer += $elem178->read($input); + $this->success []= $elem178; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_NoSuchObjectException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_MetaException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_partitions_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRUCT, count($this->success)); + { + foreach ($this->success as $iter179) + { + $xfer += $iter179->write($output); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_partition_names_args { + static $_TSPEC; + + public $db_name = null; + public $tbl_name = null; + public $max_parts = -1; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'max_parts', + 'type' => TType::I16, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + if (isset($vals['max_parts'])) { + $this->max_parts = $vals['max_parts']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_partition_names_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::I16) { + $xfer += $input->readI16($this->max_parts); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_partition_names_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->max_parts !== null) { + $xfer += $output->writeFieldBegin('max_parts', TType::I16, 3); + $xfer += $output->writeI16($this->max_parts); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_partition_names_result { + static $_TSPEC; + + public $success = null; + public $o2 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 1 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_partition_names_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size180 = 0; + $_etype183 = 0; + $xfer += $input->readListBegin($_etype183, $_size180); + for ($_i184 = 0; $_i184 < $_size180; ++$_i184) + { + $elem185 = null; + $xfer += $input->readString($elem185); + $this->success []= $elem185; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_MetaException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_partition_names_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRING, count($this->success)); + { + foreach ($this->success as $iter186) + { + $xfer += $output->writeString($iter186); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 1); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_partitions_ps_args { + static $_TSPEC; + + public $db_name = null; + public $tbl_name = null; + public $part_vals = null; + public $max_parts = -1; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'part_vals', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 4 => array( + 'var' => 'max_parts', + 'type' => TType::I16, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + if (isset($vals['part_vals'])) { + $this->part_vals = $vals['part_vals']; + } + if (isset($vals['max_parts'])) { + $this->max_parts = $vals['max_parts']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_partitions_ps_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::LST) { + $this->part_vals = array(); + $_size187 = 0; + $_etype190 = 0; + $xfer += $input->readListBegin($_etype190, $_size187); + for ($_i191 = 0; $_i191 < $_size187; ++$_i191) + { + $elem192 = null; + $xfer += $input->readString($elem192); + $this->part_vals []= $elem192; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::I16) { + $xfer += $input->readI16($this->max_parts); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_partitions_ps_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->part_vals !== null) { + if (!is_array($this->part_vals)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('part_vals', TType::LST, 3); + { + $output->writeListBegin(TType::STRING, count($this->part_vals)); + { + foreach ($this->part_vals as $iter193) + { + $xfer += $output->writeString($iter193); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->max_parts !== null) { + $xfer += $output->writeFieldBegin('max_parts', TType::I16, 4); + $xfer += $output->writeI16($this->max_parts); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_partitions_ps_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRUCT, + 'elem' => array( + 'type' => TType::STRUCT, + 'class' => 'metastore_Partition', + ), + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_partitions_ps_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size194 = 0; + $_etype197 = 0; + $xfer += $input->readListBegin($_etype197, $_size194); + for ($_i198 = 0; $_i198 < $_size194; ++$_i198) + { + $elem199 = null; + $elem199 = new metastore_Partition(); + $xfer += $elem199->read($input); + $this->success []= $elem199; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_partitions_ps_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRUCT, count($this->success)); + { + foreach ($this->success as $iter200) + { + $xfer += $iter200->write($output); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_partition_names_ps_args { + static $_TSPEC; + + public $db_name = null; + public $tbl_name = null; + public $part_vals = null; + public $max_parts = -1; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'part_vals', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 4 => array( + 'var' => 'max_parts', + 'type' => TType::I16, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + if (isset($vals['part_vals'])) { + $this->part_vals = $vals['part_vals']; + } + if (isset($vals['max_parts'])) { + $this->max_parts = $vals['max_parts']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_partition_names_ps_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::LST) { + $this->part_vals = array(); + $_size201 = 0; + $_etype204 = 0; + $xfer += $input->readListBegin($_etype204, $_size201); + for ($_i205 = 0; $_i205 < $_size201; ++$_i205) + { + $elem206 = null; + $xfer += $input->readString($elem206); + $this->part_vals []= $elem206; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::I16) { + $xfer += $input->readI16($this->max_parts); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_partition_names_ps_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->part_vals !== null) { + if (!is_array($this->part_vals)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('part_vals', TType::LST, 3); + { + $output->writeListBegin(TType::STRING, count($this->part_vals)); + { + foreach ($this->part_vals as $iter207) + { + $xfer += $output->writeString($iter207); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->max_parts !== null) { + $xfer += $output->writeFieldBegin('max_parts', TType::I16, 4); + $xfer += $output->writeI16($this->max_parts); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_partition_names_ps_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_partition_names_ps_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size208 = 0; + $_etype211 = 0; + $xfer += $input->readListBegin($_etype211, $_size208); + for ($_i212 = 0; $_i212 < $_size208; ++$_i212) + { + $elem213 = null; + $xfer += $input->readString($elem213); + $this->success []= $elem213; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_partition_names_ps_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRING, count($this->success)); + { + foreach ($this->success as $iter214) + { + $xfer += $output->writeString($iter214); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_alter_partition_args { + static $_TSPEC; + + public $db_name = null; + public $tbl_name = null; + public $new_part = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'new_part', + 'type' => TType::STRUCT, + 'class' => 'metastore_Partition', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + if (isset($vals['new_part'])) { + $this->new_part = $vals['new_part']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_alter_partition_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->new_part = new metastore_Partition(); + $xfer += $this->new_part->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_alter_partition_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->new_part !== null) { + if (!is_object($this->new_part)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('new_part', TType::STRUCT, 3); + $xfer += $this->new_part->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_alter_partition_result { + static $_TSPEC; + + public $o1 = null; + public $o2 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_InvalidOperationException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_alter_partition_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_InvalidOperationException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_MetaException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_alter_partition_result'); + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_config_value_args { + static $_TSPEC; + + public $name = null; + public $defaultValue = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'defaultValue', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['name'])) { + $this->name = $vals['name']; + } + if (isset($vals['defaultValue'])) { + $this->defaultValue = $vals['defaultValue']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_config_value_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->defaultValue); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_config_value_args'); + if ($this->name !== null) { + $xfer += $output->writeFieldBegin('name', TType::STRING, 1); + $xfer += $output->writeString($this->name); + $xfer += $output->writeFieldEnd(); + } + if ($this->defaultValue !== null) { + $xfer += $output->writeFieldBegin('defaultValue', TType::STRING, 2); + $xfer += $output->writeString($this->defaultValue); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_config_value_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRING, + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_ConfigValSecurityException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_config_value_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->success); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_ConfigValSecurityException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_config_value_result'); + if ($this->success !== null) { + $xfer += $output->writeFieldBegin('success', TType::STRING, 0); + $xfer += $output->writeString($this->success); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_partition_name_to_vals_args { + static $_TSPEC; + + public $part_name = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'part_name', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['part_name'])) { + $this->part_name = $vals['part_name']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_partition_name_to_vals_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->part_name); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_partition_name_to_vals_args'); + if ($this->part_name !== null) { + $xfer += $output->writeFieldBegin('part_name', TType::STRING, 1); + $xfer += $output->writeString($this->part_name); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_partition_name_to_vals_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_partition_name_to_vals_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size215 = 0; + $_etype218 = 0; + $xfer += $input->readListBegin($_etype218, $_size215); + for ($_i219 = 0; $_i219 < $_size215; ++$_i219) + { + $elem220 = null; + $xfer += $input->readString($elem220); + $this->success []= $elem220; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_partition_name_to_vals_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRING, count($this->success)); + { + foreach ($this->success as $iter221) + { + $xfer += $output->writeString($iter221); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_partition_name_to_spec_args { + static $_TSPEC; + + public $part_name = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'part_name', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['part_name'])) { + $this->part_name = $vals['part_name']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_partition_name_to_spec_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->part_name); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_partition_name_to_spec_args'); + if ($this->part_name !== null) { + $xfer += $output->writeFieldBegin('part_name', TType::STRING, 1); + $xfer += $output->writeString($this->part_name); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_partition_name_to_spec_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::MAP, + 'ktype' => TType::STRING, + 'vtype' => TType::STRING, + 'key' => array( + 'type' => TType::STRING, + ), + 'val' => array( + 'type' => TType::STRING, + ), + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_partition_name_to_spec_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::MAP) { + $this->success = array(); + $_size222 = 0; + $_ktype223 = 0; + $_vtype224 = 0; + $xfer += $input->readMapBegin($_ktype223, $_vtype224, $_size222); + for ($_i226 = 0; $_i226 < $_size222; ++$_i226) + { + $key227 = ''; + $val228 = ''; + $xfer += $input->readString($key227); + $xfer += $input->readString($val228); + $this->success[$key227] = $val228; + } + $xfer += $input->readMapEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_partition_name_to_spec_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::MAP, 0); + { + $output->writeMapBegin(TType::STRING, TType::STRING, count($this->success)); + { + foreach ($this->success as $kiter229 => $viter230) + { + $xfer += $output->writeString($kiter229); + $xfer += $output->writeString($viter230); + } + } + $output->writeMapEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +?> diff --git metastore/src/gen-php/hive_metastore/hive_metastore_constants.php metastore/src/gen-php/hive_metastore/hive_metastore_constants.php new file mode 100644 index 0000000..5daa79a --- /dev/null +++ metastore/src/gen-php/hive_metastore/hive_metastore_constants.php @@ -0,0 +1,43 @@ + diff --git metastore/src/gen-php/hive_metastore/hive_metastore_types.php metastore/src/gen-php/hive_metastore/hive_metastore_types.php new file mode 100644 index 0000000..eb1a6ef --- /dev/null +++ metastore/src/gen-php/hive_metastore/hive_metastore_types.php @@ -0,0 +1,2714 @@ + array( + 'var' => 'version', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'comments', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['version'])) { + $this->version = $vals['version']; + } + if (isset($vals['comments'])) { + $this->comments = $vals['comments']; + } + } + } + + public function getName() { + return 'Version'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->version); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->comments); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('Version'); + if ($this->version !== null) { + $xfer += $output->writeFieldBegin('version', TType::STRING, 1); + $xfer += $output->writeString($this->version); + $xfer += $output->writeFieldEnd(); + } + if ($this->comments !== null) { + $xfer += $output->writeFieldBegin('comments', TType::STRING, 2); + $xfer += $output->writeString($this->comments); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_FieldSchema { + static $_TSPEC; + + public $name = null; + public $type = null; + public $comment = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'type', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'comment', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['name'])) { + $this->name = $vals['name']; + } + if (isset($vals['type'])) { + $this->type = $vals['type']; + } + if (isset($vals['comment'])) { + $this->comment = $vals['comment']; + } + } + } + + public function getName() { + return 'FieldSchema'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->type); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->comment); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('FieldSchema'); + if ($this->name !== null) { + $xfer += $output->writeFieldBegin('name', TType::STRING, 1); + $xfer += $output->writeString($this->name); + $xfer += $output->writeFieldEnd(); + } + if ($this->type !== null) { + $xfer += $output->writeFieldBegin('type', TType::STRING, 2); + $xfer += $output->writeString($this->type); + $xfer += $output->writeFieldEnd(); + } + if ($this->comment !== null) { + $xfer += $output->writeFieldBegin('comment', TType::STRING, 3); + $xfer += $output->writeString($this->comment); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_Type { + static $_TSPEC; + + public $name = null; + public $type1 = null; + public $type2 = null; + public $fields = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'type1', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'type2', + 'type' => TType::STRING, + ), + 4 => array( + 'var' => 'fields', + 'type' => TType::LST, + 'etype' => TType::STRUCT, + 'elem' => array( + 'type' => TType::STRUCT, + 'class' => 'metastore_FieldSchema', + ), + ), + ); + } + if (is_array($vals)) { + if (isset($vals['name'])) { + $this->name = $vals['name']; + } + if (isset($vals['type1'])) { + $this->type1 = $vals['type1']; + } + if (isset($vals['type2'])) { + $this->type2 = $vals['type2']; + } + if (isset($vals['fields'])) { + $this->fields = $vals['fields']; + } + } + } + + public function getName() { + return 'Type'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->type1); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->type2); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::LST) { + $this->fields = array(); + $_size0 = 0; + $_etype3 = 0; + $xfer += $input->readListBegin($_etype3, $_size0); + for ($_i4 = 0; $_i4 < $_size0; ++$_i4) + { + $elem5 = null; + $elem5 = new metastore_FieldSchema(); + $xfer += $elem5->read($input); + $this->fields []= $elem5; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('Type'); + if ($this->name !== null) { + $xfer += $output->writeFieldBegin('name', TType::STRING, 1); + $xfer += $output->writeString($this->name); + $xfer += $output->writeFieldEnd(); + } + if ($this->type1 !== null) { + $xfer += $output->writeFieldBegin('type1', TType::STRING, 2); + $xfer += $output->writeString($this->type1); + $xfer += $output->writeFieldEnd(); + } + if ($this->type2 !== null) { + $xfer += $output->writeFieldBegin('type2', TType::STRING, 3); + $xfer += $output->writeString($this->type2); + $xfer += $output->writeFieldEnd(); + } + if ($this->fields !== null) { + if (!is_array($this->fields)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('fields', TType::LST, 4); + { + $output->writeListBegin(TType::STRUCT, count($this->fields)); + { + foreach ($this->fields as $iter6) + { + $xfer += $iter6->write($output); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_Database { + static $_TSPEC; + + public $name = null; + public $description = null; + public $locationUri = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'description', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'locationUri', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['name'])) { + $this->name = $vals['name']; + } + if (isset($vals['description'])) { + $this->description = $vals['description']; + } + if (isset($vals['locationUri'])) { + $this->locationUri = $vals['locationUri']; + } + } + } + + public function getName() { + return 'Database'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->description); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->locationUri); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('Database'); + if ($this->name !== null) { + $xfer += $output->writeFieldBegin('name', TType::STRING, 1); + $xfer += $output->writeString($this->name); + $xfer += $output->writeFieldEnd(); + } + if ($this->description !== null) { + $xfer += $output->writeFieldBegin('description', TType::STRING, 2); + $xfer += $output->writeString($this->description); + $xfer += $output->writeFieldEnd(); + } + if ($this->locationUri !== null) { + $xfer += $output->writeFieldBegin('locationUri', TType::STRING, 3); + $xfer += $output->writeString($this->locationUri); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_SerDeInfo { + static $_TSPEC; + + public $name = null; + public $serializationLib = null; + public $parameters = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'serializationLib', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'parameters', + 'type' => TType::MAP, + 'ktype' => TType::STRING, + 'vtype' => TType::STRING, + 'key' => array( + 'type' => TType::STRING, + ), + 'val' => array( + 'type' => TType::STRING, + ), + ), + ); + } + if (is_array($vals)) { + if (isset($vals['name'])) { + $this->name = $vals['name']; + } + if (isset($vals['serializationLib'])) { + $this->serializationLib = $vals['serializationLib']; + } + if (isset($vals['parameters'])) { + $this->parameters = $vals['parameters']; + } + } + } + + public function getName() { + return 'SerDeInfo'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->serializationLib); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::MAP) { + $this->parameters = array(); + $_size7 = 0; + $_ktype8 = 0; + $_vtype9 = 0; + $xfer += $input->readMapBegin($_ktype8, $_vtype9, $_size7); + for ($_i11 = 0; $_i11 < $_size7; ++$_i11) + { + $key12 = ''; + $val13 = ''; + $xfer += $input->readString($key12); + $xfer += $input->readString($val13); + $this->parameters[$key12] = $val13; + } + $xfer += $input->readMapEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('SerDeInfo'); + if ($this->name !== null) { + $xfer += $output->writeFieldBegin('name', TType::STRING, 1); + $xfer += $output->writeString($this->name); + $xfer += $output->writeFieldEnd(); + } + if ($this->serializationLib !== null) { + $xfer += $output->writeFieldBegin('serializationLib', TType::STRING, 2); + $xfer += $output->writeString($this->serializationLib); + $xfer += $output->writeFieldEnd(); + } + if ($this->parameters !== null) { + if (!is_array($this->parameters)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('parameters', TType::MAP, 3); + { + $output->writeMapBegin(TType::STRING, TType::STRING, count($this->parameters)); + { + foreach ($this->parameters as $kiter14 => $viter15) + { + $xfer += $output->writeString($kiter14); + $xfer += $output->writeString($viter15); + } + } + $output->writeMapEnd(); + } + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_Order { + static $_TSPEC; + + public $col = null; + public $order = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'col', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'order', + 'type' => TType::I32, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['col'])) { + $this->col = $vals['col']; + } + if (isset($vals['order'])) { + $this->order = $vals['order']; + } + } + } + + public function getName() { + return 'Order'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->col); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->order); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('Order'); + if ($this->col !== null) { + $xfer += $output->writeFieldBegin('col', TType::STRING, 1); + $xfer += $output->writeString($this->col); + $xfer += $output->writeFieldEnd(); + } + if ($this->order !== null) { + $xfer += $output->writeFieldBegin('order', TType::I32, 2); + $xfer += $output->writeI32($this->order); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_StorageDescriptor { + static $_TSPEC; + + public $cols = null; + public $location = null; + public $inputFormat = null; + public $outputFormat = null; + public $compressed = null; + public $numBuckets = null; + public $serdeInfo = null; + public $bucketCols = null; + public $sortCols = null; + public $parameters = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'cols', + 'type' => TType::LST, + 'etype' => TType::STRUCT, + 'elem' => array( + 'type' => TType::STRUCT, + 'class' => 'metastore_FieldSchema', + ), + ), + 2 => array( + 'var' => 'location', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'inputFormat', + 'type' => TType::STRING, + ), + 4 => array( + 'var' => 'outputFormat', + 'type' => TType::STRING, + ), + 5 => array( + 'var' => 'compressed', + 'type' => TType::BOOL, + ), + 6 => array( + 'var' => 'numBuckets', + 'type' => TType::I32, + ), + 7 => array( + 'var' => 'serdeInfo', + 'type' => TType::STRUCT, + 'class' => 'metastore_SerDeInfo', + ), + 8 => array( + 'var' => 'bucketCols', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 9 => array( + 'var' => 'sortCols', + 'type' => TType::LST, + 'etype' => TType::STRUCT, + 'elem' => array( + 'type' => TType::STRUCT, + 'class' => 'metastore_Order', + ), + ), + 10 => array( + 'var' => 'parameters', + 'type' => TType::MAP, + 'ktype' => TType::STRING, + 'vtype' => TType::STRING, + 'key' => array( + 'type' => TType::STRING, + ), + 'val' => array( + 'type' => TType::STRING, + ), + ), + ); + } + if (is_array($vals)) { + if (isset($vals['cols'])) { + $this->cols = $vals['cols']; + } + if (isset($vals['location'])) { + $this->location = $vals['location']; + } + if (isset($vals['inputFormat'])) { + $this->inputFormat = $vals['inputFormat']; + } + if (isset($vals['outputFormat'])) { + $this->outputFormat = $vals['outputFormat']; + } + if (isset($vals['compressed'])) { + $this->compressed = $vals['compressed']; + } + if (isset($vals['numBuckets'])) { + $this->numBuckets = $vals['numBuckets']; + } + if (isset($vals['serdeInfo'])) { + $this->serdeInfo = $vals['serdeInfo']; + } + if (isset($vals['bucketCols'])) { + $this->bucketCols = $vals['bucketCols']; + } + if (isset($vals['sortCols'])) { + $this->sortCols = $vals['sortCols']; + } + if (isset($vals['parameters'])) { + $this->parameters = $vals['parameters']; + } + } + } + + public function getName() { + return 'StorageDescriptor'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::LST) { + $this->cols = array(); + $_size16 = 0; + $_etype19 = 0; + $xfer += $input->readListBegin($_etype19, $_size16); + for ($_i20 = 0; $_i20 < $_size16; ++$_i20) + { + $elem21 = null; + $elem21 = new metastore_FieldSchema(); + $xfer += $elem21->read($input); + $this->cols []= $elem21; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->location); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->inputFormat); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->outputFormat); + } else { + $xfer += $input->skip($ftype); + } + break; + case 5: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->compressed); + } else { + $xfer += $input->skip($ftype); + } + break; + case 6: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->numBuckets); + } else { + $xfer += $input->skip($ftype); + } + break; + case 7: + if ($ftype == TType::STRUCT) { + $this->serdeInfo = new metastore_SerDeInfo(); + $xfer += $this->serdeInfo->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 8: + if ($ftype == TType::LST) { + $this->bucketCols = array(); + $_size22 = 0; + $_etype25 = 0; + $xfer += $input->readListBegin($_etype25, $_size22); + for ($_i26 = 0; $_i26 < $_size22; ++$_i26) + { + $elem27 = null; + $xfer += $input->readString($elem27); + $this->bucketCols []= $elem27; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 9: + if ($ftype == TType::LST) { + $this->sortCols = array(); + $_size28 = 0; + $_etype31 = 0; + $xfer += $input->readListBegin($_etype31, $_size28); + for ($_i32 = 0; $_i32 < $_size28; ++$_i32) + { + $elem33 = null; + $elem33 = new metastore_Order(); + $xfer += $elem33->read($input); + $this->sortCols []= $elem33; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 10: + if ($ftype == TType::MAP) { + $this->parameters = array(); + $_size34 = 0; + $_ktype35 = 0; + $_vtype36 = 0; + $xfer += $input->readMapBegin($_ktype35, $_vtype36, $_size34); + for ($_i38 = 0; $_i38 < $_size34; ++$_i38) + { + $key39 = ''; + $val40 = ''; + $xfer += $input->readString($key39); + $xfer += $input->readString($val40); + $this->parameters[$key39] = $val40; + } + $xfer += $input->readMapEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('StorageDescriptor'); + if ($this->cols !== null) { + if (!is_array($this->cols)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('cols', TType::LST, 1); + { + $output->writeListBegin(TType::STRUCT, count($this->cols)); + { + foreach ($this->cols as $iter41) + { + $xfer += $iter41->write($output); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->location !== null) { + $xfer += $output->writeFieldBegin('location', TType::STRING, 2); + $xfer += $output->writeString($this->location); + $xfer += $output->writeFieldEnd(); + } + if ($this->inputFormat !== null) { + $xfer += $output->writeFieldBegin('inputFormat', TType::STRING, 3); + $xfer += $output->writeString($this->inputFormat); + $xfer += $output->writeFieldEnd(); + } + if ($this->outputFormat !== null) { + $xfer += $output->writeFieldBegin('outputFormat', TType::STRING, 4); + $xfer += $output->writeString($this->outputFormat); + $xfer += $output->writeFieldEnd(); + } + if ($this->compressed !== null) { + $xfer += $output->writeFieldBegin('compressed', TType::BOOL, 5); + $xfer += $output->writeBool($this->compressed); + $xfer += $output->writeFieldEnd(); + } + if ($this->numBuckets !== null) { + $xfer += $output->writeFieldBegin('numBuckets', TType::I32, 6); + $xfer += $output->writeI32($this->numBuckets); + $xfer += $output->writeFieldEnd(); + } + if ($this->serdeInfo !== null) { + if (!is_object($this->serdeInfo)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('serdeInfo', TType::STRUCT, 7); + $xfer += $this->serdeInfo->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->bucketCols !== null) { + if (!is_array($this->bucketCols)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('bucketCols', TType::LST, 8); + { + $output->writeListBegin(TType::STRING, count($this->bucketCols)); + { + foreach ($this->bucketCols as $iter42) + { + $xfer += $output->writeString($iter42); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->sortCols !== null) { + if (!is_array($this->sortCols)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('sortCols', TType::LST, 9); + { + $output->writeListBegin(TType::STRUCT, count($this->sortCols)); + { + foreach ($this->sortCols as $iter43) + { + $xfer += $iter43->write($output); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->parameters !== null) { + if (!is_array($this->parameters)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('parameters', TType::MAP, 10); + { + $output->writeMapBegin(TType::STRING, TType::STRING, count($this->parameters)); + { + foreach ($this->parameters as $kiter44 => $viter45) + { + $xfer += $output->writeString($kiter44); + $xfer += $output->writeString($viter45); + } + } + $output->writeMapEnd(); + } + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_Table { + static $_TSPEC; + + public $tableName = null; + public $dbName = null; + public $owner = null; + public $createTime = null; + public $lastAccessTime = null; + public $retention = null; + public $sd = null; + public $partitionKeys = null; + public $parameters = null; + public $viewOriginalText = null; + public $viewExpandedText = null; + public $tableType = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'tableName', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'dbName', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'owner', + 'type' => TType::STRING, + ), + 4 => array( + 'var' => 'createTime', + 'type' => TType::I32, + ), + 5 => array( + 'var' => 'lastAccessTime', + 'type' => TType::I32, + ), + 6 => array( + 'var' => 'retention', + 'type' => TType::I32, + ), + 7 => array( + 'var' => 'sd', + 'type' => TType::STRUCT, + 'class' => 'metastore_StorageDescriptor', + ), + 8 => array( + 'var' => 'partitionKeys', + 'type' => TType::LST, + 'etype' => TType::STRUCT, + 'elem' => array( + 'type' => TType::STRUCT, + 'class' => 'metastore_FieldSchema', + ), + ), + 9 => array( + 'var' => 'parameters', + 'type' => TType::MAP, + 'ktype' => TType::STRING, + 'vtype' => TType::STRING, + 'key' => array( + 'type' => TType::STRING, + ), + 'val' => array( + 'type' => TType::STRING, + ), + ), + 10 => array( + 'var' => 'viewOriginalText', + 'type' => TType::STRING, + ), + 11 => array( + 'var' => 'viewExpandedText', + 'type' => TType::STRING, + ), + 12 => array( + 'var' => 'tableType', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['tableName'])) { + $this->tableName = $vals['tableName']; + } + if (isset($vals['dbName'])) { + $this->dbName = $vals['dbName']; + } + if (isset($vals['owner'])) { + $this->owner = $vals['owner']; + } + if (isset($vals['createTime'])) { + $this->createTime = $vals['createTime']; + } + if (isset($vals['lastAccessTime'])) { + $this->lastAccessTime = $vals['lastAccessTime']; + } + if (isset($vals['retention'])) { + $this->retention = $vals['retention']; + } + if (isset($vals['sd'])) { + $this->sd = $vals['sd']; + } + if (isset($vals['partitionKeys'])) { + $this->partitionKeys = $vals['partitionKeys']; + } + if (isset($vals['parameters'])) { + $this->parameters = $vals['parameters']; + } + if (isset($vals['viewOriginalText'])) { + $this->viewOriginalText = $vals['viewOriginalText']; + } + if (isset($vals['viewExpandedText'])) { + $this->viewExpandedText = $vals['viewExpandedText']; + } + if (isset($vals['tableType'])) { + $this->tableType = $vals['tableType']; + } + } + } + + public function getName() { + return 'Table'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tableName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->dbName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->owner); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->createTime); + } else { + $xfer += $input->skip($ftype); + } + break; + case 5: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->lastAccessTime); + } else { + $xfer += $input->skip($ftype); + } + break; + case 6: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->retention); + } else { + $xfer += $input->skip($ftype); + } + break; + case 7: + if ($ftype == TType::STRUCT) { + $this->sd = new metastore_StorageDescriptor(); + $xfer += $this->sd->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 8: + if ($ftype == TType::LST) { + $this->partitionKeys = array(); + $_size46 = 0; + $_etype49 = 0; + $xfer += $input->readListBegin($_etype49, $_size46); + for ($_i50 = 0; $_i50 < $_size46; ++$_i50) + { + $elem51 = null; + $elem51 = new metastore_FieldSchema(); + $xfer += $elem51->read($input); + $this->partitionKeys []= $elem51; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 9: + if ($ftype == TType::MAP) { + $this->parameters = array(); + $_size52 = 0; + $_ktype53 = 0; + $_vtype54 = 0; + $xfer += $input->readMapBegin($_ktype53, $_vtype54, $_size52); + for ($_i56 = 0; $_i56 < $_size52; ++$_i56) + { + $key57 = ''; + $val58 = ''; + $xfer += $input->readString($key57); + $xfer += $input->readString($val58); + $this->parameters[$key57] = $val58; + } + $xfer += $input->readMapEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 10: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->viewOriginalText); + } else { + $xfer += $input->skip($ftype); + } + break; + case 11: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->viewExpandedText); + } else { + $xfer += $input->skip($ftype); + } + break; + case 12: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tableType); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('Table'); + if ($this->tableName !== null) { + $xfer += $output->writeFieldBegin('tableName', TType::STRING, 1); + $xfer += $output->writeString($this->tableName); + $xfer += $output->writeFieldEnd(); + } + if ($this->dbName !== null) { + $xfer += $output->writeFieldBegin('dbName', TType::STRING, 2); + $xfer += $output->writeString($this->dbName); + $xfer += $output->writeFieldEnd(); + } + if ($this->owner !== null) { + $xfer += $output->writeFieldBegin('owner', TType::STRING, 3); + $xfer += $output->writeString($this->owner); + $xfer += $output->writeFieldEnd(); + } + if ($this->createTime !== null) { + $xfer += $output->writeFieldBegin('createTime', TType::I32, 4); + $xfer += $output->writeI32($this->createTime); + $xfer += $output->writeFieldEnd(); + } + if ($this->lastAccessTime !== null) { + $xfer += $output->writeFieldBegin('lastAccessTime', TType::I32, 5); + $xfer += $output->writeI32($this->lastAccessTime); + $xfer += $output->writeFieldEnd(); + } + if ($this->retention !== null) { + $xfer += $output->writeFieldBegin('retention', TType::I32, 6); + $xfer += $output->writeI32($this->retention); + $xfer += $output->writeFieldEnd(); + } + if ($this->sd !== null) { + if (!is_object($this->sd)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('sd', TType::STRUCT, 7); + $xfer += $this->sd->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->partitionKeys !== null) { + if (!is_array($this->partitionKeys)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('partitionKeys', TType::LST, 8); + { + $output->writeListBegin(TType::STRUCT, count($this->partitionKeys)); + { + foreach ($this->partitionKeys as $iter59) + { + $xfer += $iter59->write($output); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->parameters !== null) { + if (!is_array($this->parameters)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('parameters', TType::MAP, 9); + { + $output->writeMapBegin(TType::STRING, TType::STRING, count($this->parameters)); + { + foreach ($this->parameters as $kiter60 => $viter61) + { + $xfer += $output->writeString($kiter60); + $xfer += $output->writeString($viter61); + } + } + $output->writeMapEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->viewOriginalText !== null) { + $xfer += $output->writeFieldBegin('viewOriginalText', TType::STRING, 10); + $xfer += $output->writeString($this->viewOriginalText); + $xfer += $output->writeFieldEnd(); + } + if ($this->viewExpandedText !== null) { + $xfer += $output->writeFieldBegin('viewExpandedText', TType::STRING, 11); + $xfer += $output->writeString($this->viewExpandedText); + $xfer += $output->writeFieldEnd(); + } + if ($this->tableType !== null) { + $xfer += $output->writeFieldBegin('tableType', TType::STRING, 12); + $xfer += $output->writeString($this->tableType); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_Partition { + static $_TSPEC; + + public $values = null; + public $dbName = null; + public $tableName = null; + public $createTime = null; + public $lastAccessTime = null; + public $sd = null; + public $parameters = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'values', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 2 => array( + 'var' => 'dbName', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'tableName', + 'type' => TType::STRING, + ), + 4 => array( + 'var' => 'createTime', + 'type' => TType::I32, + ), + 5 => array( + 'var' => 'lastAccessTime', + 'type' => TType::I32, + ), + 6 => array( + 'var' => 'sd', + 'type' => TType::STRUCT, + 'class' => 'metastore_StorageDescriptor', + ), + 7 => array( + 'var' => 'parameters', + 'type' => TType::MAP, + 'ktype' => TType::STRING, + 'vtype' => TType::STRING, + 'key' => array( + 'type' => TType::STRING, + ), + 'val' => array( + 'type' => TType::STRING, + ), + ), + ); + } + if (is_array($vals)) { + if (isset($vals['values'])) { + $this->values = $vals['values']; + } + if (isset($vals['dbName'])) { + $this->dbName = $vals['dbName']; + } + if (isset($vals['tableName'])) { + $this->tableName = $vals['tableName']; + } + if (isset($vals['createTime'])) { + $this->createTime = $vals['createTime']; + } + if (isset($vals['lastAccessTime'])) { + $this->lastAccessTime = $vals['lastAccessTime']; + } + if (isset($vals['sd'])) { + $this->sd = $vals['sd']; + } + if (isset($vals['parameters'])) { + $this->parameters = $vals['parameters']; + } + } + } + + public function getName() { + return 'Partition'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::LST) { + $this->values = array(); + $_size62 = 0; + $_etype65 = 0; + $xfer += $input->readListBegin($_etype65, $_size62); + for ($_i66 = 0; $_i66 < $_size62; ++$_i66) + { + $elem67 = null; + $xfer += $input->readString($elem67); + $this->values []= $elem67; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->dbName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tableName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->createTime); + } else { + $xfer += $input->skip($ftype); + } + break; + case 5: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->lastAccessTime); + } else { + $xfer += $input->skip($ftype); + } + break; + case 6: + if ($ftype == TType::STRUCT) { + $this->sd = new metastore_StorageDescriptor(); + $xfer += $this->sd->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 7: + if ($ftype == TType::MAP) { + $this->parameters = array(); + $_size68 = 0; + $_ktype69 = 0; + $_vtype70 = 0; + $xfer += $input->readMapBegin($_ktype69, $_vtype70, $_size68); + for ($_i72 = 0; $_i72 < $_size68; ++$_i72) + { + $key73 = ''; + $val74 = ''; + $xfer += $input->readString($key73); + $xfer += $input->readString($val74); + $this->parameters[$key73] = $val74; + } + $xfer += $input->readMapEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('Partition'); + if ($this->values !== null) { + if (!is_array($this->values)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('values', TType::LST, 1); + { + $output->writeListBegin(TType::STRING, count($this->values)); + { + foreach ($this->values as $iter75) + { + $xfer += $output->writeString($iter75); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->dbName !== null) { + $xfer += $output->writeFieldBegin('dbName', TType::STRING, 2); + $xfer += $output->writeString($this->dbName); + $xfer += $output->writeFieldEnd(); + } + if ($this->tableName !== null) { + $xfer += $output->writeFieldBegin('tableName', TType::STRING, 3); + $xfer += $output->writeString($this->tableName); + $xfer += $output->writeFieldEnd(); + } + if ($this->createTime !== null) { + $xfer += $output->writeFieldBegin('createTime', TType::I32, 4); + $xfer += $output->writeI32($this->createTime); + $xfer += $output->writeFieldEnd(); + } + if ($this->lastAccessTime !== null) { + $xfer += $output->writeFieldBegin('lastAccessTime', TType::I32, 5); + $xfer += $output->writeI32($this->lastAccessTime); + $xfer += $output->writeFieldEnd(); + } + if ($this->sd !== null) { + if (!is_object($this->sd)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('sd', TType::STRUCT, 6); + $xfer += $this->sd->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->parameters !== null) { + if (!is_array($this->parameters)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('parameters', TType::MAP, 7); + { + $output->writeMapBegin(TType::STRING, TType::STRING, count($this->parameters)); + { + foreach ($this->parameters as $kiter76 => $viter77) + { + $xfer += $output->writeString($kiter76); + $xfer += $output->writeString($viter77); + } + } + $output->writeMapEnd(); + } + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_Index { + static $_TSPEC; + + public $indexName = null; + public $indexType = null; + public $tableName = null; + public $dbName = null; + public $colNames = null; + public $partName = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'indexName', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'indexType', + 'type' => TType::I32, + ), + 3 => array( + 'var' => 'tableName', + 'type' => TType::STRING, + ), + 4 => array( + 'var' => 'dbName', + 'type' => TType::STRING, + ), + 5 => array( + 'var' => 'colNames', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 6 => array( + 'var' => 'partName', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['indexName'])) { + $this->indexName = $vals['indexName']; + } + if (isset($vals['indexType'])) { + $this->indexType = $vals['indexType']; + } + if (isset($vals['tableName'])) { + $this->tableName = $vals['tableName']; + } + if (isset($vals['dbName'])) { + $this->dbName = $vals['dbName']; + } + if (isset($vals['colNames'])) { + $this->colNames = $vals['colNames']; + } + if (isset($vals['partName'])) { + $this->partName = $vals['partName']; + } + } + } + + public function getName() { + return 'Index'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->indexName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->indexType); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tableName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->dbName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 5: + if ($ftype == TType::LST) { + $this->colNames = array(); + $_size78 = 0; + $_etype81 = 0; + $xfer += $input->readListBegin($_etype81, $_size78); + for ($_i82 = 0; $_i82 < $_size78; ++$_i82) + { + $elem83 = null; + $xfer += $input->readString($elem83); + $this->colNames []= $elem83; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 6: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->partName); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('Index'); + if ($this->indexName !== null) { + $xfer += $output->writeFieldBegin('indexName', TType::STRING, 1); + $xfer += $output->writeString($this->indexName); + $xfer += $output->writeFieldEnd(); + } + if ($this->indexType !== null) { + $xfer += $output->writeFieldBegin('indexType', TType::I32, 2); + $xfer += $output->writeI32($this->indexType); + $xfer += $output->writeFieldEnd(); + } + if ($this->tableName !== null) { + $xfer += $output->writeFieldBegin('tableName', TType::STRING, 3); + $xfer += $output->writeString($this->tableName); + $xfer += $output->writeFieldEnd(); + } + if ($this->dbName !== null) { + $xfer += $output->writeFieldBegin('dbName', TType::STRING, 4); + $xfer += $output->writeString($this->dbName); + $xfer += $output->writeFieldEnd(); + } + if ($this->colNames !== null) { + if (!is_array($this->colNames)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('colNames', TType::LST, 5); + { + $output->writeListBegin(TType::STRING, count($this->colNames)); + { + foreach ($this->colNames as $iter84) + { + $xfer += $output->writeString($iter84); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->partName !== null) { + $xfer += $output->writeFieldBegin('partName', TType::STRING, 6); + $xfer += $output->writeString($this->partName); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_Schema { + static $_TSPEC; + + public $fieldSchemas = null; + public $properties = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'fieldSchemas', + 'type' => TType::LST, + 'etype' => TType::STRUCT, + 'elem' => array( + 'type' => TType::STRUCT, + 'class' => 'metastore_FieldSchema', + ), + ), + 2 => array( + 'var' => 'properties', + 'type' => TType::MAP, + 'ktype' => TType::STRING, + 'vtype' => TType::STRING, + 'key' => array( + 'type' => TType::STRING, + ), + 'val' => array( + 'type' => TType::STRING, + ), + ), + ); + } + if (is_array($vals)) { + if (isset($vals['fieldSchemas'])) { + $this->fieldSchemas = $vals['fieldSchemas']; + } + if (isset($vals['properties'])) { + $this->properties = $vals['properties']; + } + } + } + + public function getName() { + return 'Schema'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::LST) { + $this->fieldSchemas = array(); + $_size85 = 0; + $_etype88 = 0; + $xfer += $input->readListBegin($_etype88, $_size85); + for ($_i89 = 0; $_i89 < $_size85; ++$_i89) + { + $elem90 = null; + $elem90 = new metastore_FieldSchema(); + $xfer += $elem90->read($input); + $this->fieldSchemas []= $elem90; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::MAP) { + $this->properties = array(); + $_size91 = 0; + $_ktype92 = 0; + $_vtype93 = 0; + $xfer += $input->readMapBegin($_ktype92, $_vtype93, $_size91); + for ($_i95 = 0; $_i95 < $_size91; ++$_i95) + { + $key96 = ''; + $val97 = ''; + $xfer += $input->readString($key96); + $xfer += $input->readString($val97); + $this->properties[$key96] = $val97; + } + $xfer += $input->readMapEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('Schema'); + if ($this->fieldSchemas !== null) { + if (!is_array($this->fieldSchemas)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('fieldSchemas', TType::LST, 1); + { + $output->writeListBegin(TType::STRUCT, count($this->fieldSchemas)); + { + foreach ($this->fieldSchemas as $iter98) + { + $xfer += $iter98->write($output); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->properties !== null) { + if (!is_array($this->properties)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('properties', TType::MAP, 2); + { + $output->writeMapBegin(TType::STRING, TType::STRING, count($this->properties)); + { + foreach ($this->properties as $kiter99 => $viter100) + { + $xfer += $output->writeString($kiter99); + $xfer += $output->writeString($viter100); + } + } + $output->writeMapEnd(); + } + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_MetaException extends TException { + static $_TSPEC; + + public $message = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'message', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['message'])) { + $this->message = $vals['message']; + } + } + } + + public function getName() { + return 'MetaException'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->message); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('MetaException'); + if ($this->message !== null) { + $xfer += $output->writeFieldBegin('message', TType::STRING, 1); + $xfer += $output->writeString($this->message); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_UnknownTableException extends TException { + static $_TSPEC; + + public $message = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'message', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['message'])) { + $this->message = $vals['message']; + } + } + } + + public function getName() { + return 'UnknownTableException'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->message); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('UnknownTableException'); + if ($this->message !== null) { + $xfer += $output->writeFieldBegin('message', TType::STRING, 1); + $xfer += $output->writeString($this->message); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_UnknownDBException extends TException { + static $_TSPEC; + + public $message = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'message', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['message'])) { + $this->message = $vals['message']; + } + } + } + + public function getName() { + return 'UnknownDBException'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->message); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('UnknownDBException'); + if ($this->message !== null) { + $xfer += $output->writeFieldBegin('message', TType::STRING, 1); + $xfer += $output->writeString($this->message); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_AlreadyExistsException extends TException { + static $_TSPEC; + + public $message = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'message', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['message'])) { + $this->message = $vals['message']; + } + } + } + + public function getName() { + return 'AlreadyExistsException'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->message); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('AlreadyExistsException'); + if ($this->message !== null) { + $xfer += $output->writeFieldBegin('message', TType::STRING, 1); + $xfer += $output->writeString($this->message); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_InvalidObjectException extends TException { + static $_TSPEC; + + public $message = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'message', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['message'])) { + $this->message = $vals['message']; + } + } + } + + public function getName() { + return 'InvalidObjectException'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->message); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('InvalidObjectException'); + if ($this->message !== null) { + $xfer += $output->writeFieldBegin('message', TType::STRING, 1); + $xfer += $output->writeString($this->message); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_NoSuchObjectException extends TException { + static $_TSPEC; + + public $message = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'message', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['message'])) { + $this->message = $vals['message']; + } + } + } + + public function getName() { + return 'NoSuchObjectException'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->message); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('NoSuchObjectException'); + if ($this->message !== null) { + $xfer += $output->writeFieldBegin('message', TType::STRING, 1); + $xfer += $output->writeString($this->message); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_IndexAlreadyExistsException extends TException { + static $_TSPEC; + + public $message = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'message', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['message'])) { + $this->message = $vals['message']; + } + } + } + + public function getName() { + return 'IndexAlreadyExistsException'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->message); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('IndexAlreadyExistsException'); + if ($this->message !== null) { + $xfer += $output->writeFieldBegin('message', TType::STRING, 1); + $xfer += $output->writeString($this->message); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_InvalidOperationException extends TException { + static $_TSPEC; + + public $message = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'message', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['message'])) { + $this->message = $vals['message']; + } + } + } + + public function getName() { + return 'InvalidOperationException'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->message); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('InvalidOperationException'); + if ($this->message !== null) { + $xfer += $output->writeFieldBegin('message', TType::STRING, 1); + $xfer += $output->writeString($this->message); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ConfigValSecurityException extends TException { + static $_TSPEC; + + public $message = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'message', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['message'])) { + $this->message = $vals['message']; + } + } + } + + public function getName() { + return 'ConfigValSecurityException'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->message); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ConfigValSecurityException'); + if ($this->message !== null) { + $xfer += $output->writeFieldBegin('message', TType::STRING, 1); + $xfer += $output->writeString($this->message); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +?> diff --git metastore/src/gen-php/hive_metastore_types.php metastore/src/gen-php/hive_metastore_types.php index 181b92f..eb1a6ef 100644 --- metastore/src/gen-php/hive_metastore_types.php +++ metastore/src/gen-php/hive_metastore_types.php @@ -377,6 +377,7 @@ class metastore_Database { public $name = null; public $description = null; + public $locationUri = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -389,6 +390,10 @@ class metastore_Database { 'var' => 'description', 'type' => TType::STRING, ), + 3 => array( + 'var' => 'locationUri', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -398,6 +403,9 @@ class metastore_Database { if (isset($vals['description'])) { $this->description = $vals['description']; } + if (isset($vals['locationUri'])) { + $this->locationUri = $vals['locationUri']; + } } } @@ -434,6 +442,13 @@ class metastore_Database { $xfer += $input->skip($ftype); } break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->locationUri); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -457,6 +472,11 @@ class metastore_Database { $xfer += $output->writeString($this->description); $xfer += $output->writeFieldEnd(); } + if ($this->locationUri !== null) { + $xfer += $output->writeFieldBegin('locationUri', TType::STRING, 3); + $xfer += $output->writeString($this->locationUri); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; diff --git metastore/src/gen-py/hive_metastore/ThriftHiveMetastore-remote metastore/src/gen-py/hive_metastore/ThriftHiveMetastore-remote old mode 100644 new mode 100755 index 6a9e81c..a1c42a4 --- metastore/src/gen-py/hive_metastore/ThriftHiveMetastore-remote +++ metastore/src/gen-py/hive_metastore/ThriftHiveMetastore-remote @@ -21,10 +21,11 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]' print '' print 'Functions:' - print ' bool create_database(string name, string description)' + print ' void create_database(Database database)' print ' Database get_database(string name)' - print ' bool drop_database(string name)' - print ' get_databases()' + print ' void drop_database(string name, bool deleteData)' + print ' get_databases(string pattern)' + print ' get_all_databases()' print ' Type get_type(string name)' print ' bool create_type(Type type)' print ' bool drop_type(string type)' @@ -34,6 +35,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' void create_table(Table tbl)' print ' void drop_table(string dbname, string name, bool deleteData)' print ' get_tables(string db_name, string pattern)' + print ' get_all_tables(string db_name)' print ' Table get_table(string dbname, string tbl_name)' print ' void alter_table(string dbname, string tbl_name, Table new_tbl)' print ' Partition add_partition(Partition new_part)' @@ -100,10 +102,10 @@ client = ThriftHiveMetastore.Client(protocol) transport.open() if cmd == 'create_database': - if len(args) != 2: - print 'create_database requires 2 args' + if len(args) != 1: + print 'create_database requires 1 args' sys.exit(1) - pp.pprint(client.create_database(args[0],args[1],)) + pp.pprint(client.create_database(eval(args[0]),)) elif cmd == 'get_database': if len(args) != 1: @@ -112,16 +114,22 @@ elif cmd == 'get_database': pp.pprint(client.get_database(args[0],)) elif cmd == 'drop_database': - if len(args) != 1: - print 'drop_database requires 1 args' + if len(args) != 2: + print 'drop_database requires 2 args' sys.exit(1) - pp.pprint(client.drop_database(args[0],)) + pp.pprint(client.drop_database(args[0],eval(args[1]),)) elif cmd == 'get_databases': + if len(args) != 1: + print 'get_databases requires 1 args' + sys.exit(1) + pp.pprint(client.get_databases(args[0],)) + +elif cmd == 'get_all_databases': if len(args) != 0: - print 'get_databases requires 0 args' + print 'get_all_databases requires 0 args' sys.exit(1) - pp.pprint(client.get_databases()) + pp.pprint(client.get_all_databases()) elif cmd == 'get_type': if len(args) != 1: @@ -177,6 +185,12 @@ elif cmd == 'get_tables': sys.exit(1) pp.pprint(client.get_tables(args[0],args[1],)) +elif cmd == 'get_all_tables': + if len(args) != 1: + print 'get_all_tables requires 1 args' + sys.exit(1) + pp.pprint(client.get_all_tables(args[0],)) + elif cmd == 'get_table': if len(args) != 2: print 'get_table requires 2 args' diff --git metastore/src/gen-py/hive_metastore/ThriftHiveMetastore.py metastore/src/gen-py/hive_metastore/ThriftHiveMetastore.py index 12461a4..5e5ed14 100644 --- metastore/src/gen-py/hive_metastore/ThriftHiveMetastore.py +++ metastore/src/gen-py/hive_metastore/ThriftHiveMetastore.py @@ -20,11 +20,10 @@ class Iface(fb303.FacebookService.Iface): """ This interface is live. """ - def create_database(self, name, description): + def create_database(self, database): """ Parameters: - - name - - description + - database """ pass @@ -35,14 +34,22 @@ class Iface(fb303.FacebookService.Iface): """ pass - def drop_database(self, name): + def drop_database(self, name, deleteData): """ Parameters: - name + - deleteData """ pass - def get_databases(self, ): + def get_databases(self, pattern): + """ + Parameters: + - pattern + """ + pass + + def get_all_databases(self, ): pass def get_type(self, name): @@ -113,6 +120,13 @@ class Iface(fb303.FacebookService.Iface): """ pass + def get_all_tables(self, db_name): + """ + Parameters: + - db_name + """ + pass + def get_table(self, dbname, tbl_name): """ Parameters: @@ -270,20 +284,18 @@ class Client(fb303.FacebookService.Client, Iface): def __init__(self, iprot, oprot=None): fb303.FacebookService.Client.__init__(self, iprot, oprot) - def create_database(self, name, description): + def create_database(self, database): """ Parameters: - - name - - description + - database """ - self.send_create_database(name, description) - return self.recv_create_database() + self.send_create_database(database) + self.recv_create_database() - def send_create_database(self, name, description): + def send_create_database(self, database): self._oprot.writeMessageBegin('create_database', TMessageType.CALL, self._seqid) args = create_database_args() - args.name = name - args.description = description + args.database = database args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() @@ -298,13 +310,13 @@ class Client(fb303.FacebookService.Client, Iface): result = create_database_result() result.read(self._iprot) self._iprot.readMessageEnd() - if result.success != None: - return result.success if result.o1 != None: raise result.o1 if result.o2 != None: raise result.o2 - raise TApplicationException(TApplicationException.MISSING_RESULT, "create_database failed: unknown result"); + if result.o3 != None: + raise result.o3 + return def get_database(self, name): """ @@ -340,18 +352,20 @@ class Client(fb303.FacebookService.Client, Iface): raise result.o2 raise TApplicationException(TApplicationException.MISSING_RESULT, "get_database failed: unknown result"); - def drop_database(self, name): + def drop_database(self, name, deleteData): """ Parameters: - name + - deleteData """ - self.send_drop_database(name) - return self.recv_drop_database() + self.send_drop_database(name, deleteData) + self.recv_drop_database() - def send_drop_database(self, name): + def send_drop_database(self, name, deleteData): self._oprot.writeMessageBegin('drop_database', TMessageType.CALL, self._seqid) args = drop_database_args() args.name = name + args.deleteData = deleteData args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() @@ -366,19 +380,26 @@ class Client(fb303.FacebookService.Client, Iface): result = drop_database_result() result.read(self._iprot) self._iprot.readMessageEnd() - if result.success != None: - return result.success + if result.o1 != None: + raise result.o1 if result.o2 != None: raise result.o2 - raise TApplicationException(TApplicationException.MISSING_RESULT, "drop_database failed: unknown result"); + if result.o3 != None: + raise result.o3 + return - def get_databases(self, ): - self.send_get_databases() + def get_databases(self, pattern): + """ + Parameters: + - pattern + """ + self.send_get_databases(pattern) return self.recv_get_databases() - def send_get_databases(self, ): + def send_get_databases(self, pattern): self._oprot.writeMessageBegin('get_databases', TMessageType.CALL, self._seqid) args = get_databases_args() + args.pattern = pattern args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() @@ -399,6 +420,33 @@ class Client(fb303.FacebookService.Client, Iface): raise result.o1 raise TApplicationException(TApplicationException.MISSING_RESULT, "get_databases failed: unknown result"); + def get_all_databases(self, ): + self.send_get_all_databases() + return self.recv_get_all_databases() + + def send_get_all_databases(self, ): + self._oprot.writeMessageBegin('get_all_databases', TMessageType.CALL, self._seqid) + args = get_all_databases_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_get_all_databases(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = get_all_databases_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success != None: + return result.success + if result.o1 != None: + raise result.o1 + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_all_databases failed: unknown result"); + def get_type(self, name): """ Parameters: @@ -427,6 +475,8 @@ class Client(fb303.FacebookService.Client, Iface): self._iprot.readMessageEnd() if result.success != None: return result.success + if result.o1 != None: + raise result.o1 if result.o2 != None: raise result.o2 raise TApplicationException(TApplicationException.MISSING_RESULT, "get_type failed: unknown result"); @@ -495,6 +545,8 @@ class Client(fb303.FacebookService.Client, Iface): self._iprot.readMessageEnd() if result.success != None: return result.success + if result.o1 != None: + raise result.o1 if result.o2 != None: raise result.o2 raise TApplicationException(TApplicationException.MISSING_RESULT, "drop_type failed: unknown result"); @@ -713,6 +765,38 @@ class Client(fb303.FacebookService.Client, Iface): raise result.o1 raise TApplicationException(TApplicationException.MISSING_RESULT, "get_tables failed: unknown result"); + def get_all_tables(self, db_name): + """ + Parameters: + - db_name + """ + self.send_get_all_tables(db_name) + return self.recv_get_all_tables() + + def send_get_all_tables(self, db_name): + self._oprot.writeMessageBegin('get_all_tables', TMessageType.CALL, self._seqid) + args = get_all_tables_args() + args.db_name = db_name + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_get_all_tables(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = get_all_tables_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success != None: + return result.success + if result.o1 != None: + raise result.o1 + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_all_tables failed: unknown result"); + def get_table(self, dbname, tbl_name): """ Parameters: @@ -1349,6 +1433,7 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): self._processMap["get_database"] = Processor.process_get_database self._processMap["drop_database"] = Processor.process_drop_database self._processMap["get_databases"] = Processor.process_get_databases + self._processMap["get_all_databases"] = Processor.process_get_all_databases self._processMap["get_type"] = Processor.process_get_type self._processMap["create_type"] = Processor.process_create_type self._processMap["drop_type"] = Processor.process_drop_type @@ -1358,6 +1443,7 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): self._processMap["create_table"] = Processor.process_create_table self._processMap["drop_table"] = Processor.process_drop_table self._processMap["get_tables"] = Processor.process_get_tables + self._processMap["get_all_tables"] = Processor.process_get_all_tables self._processMap["get_table"] = Processor.process_get_table self._processMap["alter_table"] = Processor.process_alter_table self._processMap["add_partition"] = Processor.process_add_partition @@ -1397,11 +1483,13 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): iprot.readMessageEnd() result = create_database_result() try: - result.success = self._handler.create_database(args.name, args.description) + self._handler.create_database(args.database) except AlreadyExistsException, o1: result.o1 = o1 - except MetaException, o2: + except InvalidObjectException, o2: result.o2 = o2 + except MetaException, o3: + result.o3 = o3 oprot.writeMessageBegin("create_database", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() @@ -1429,9 +1517,13 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): iprot.readMessageEnd() result = drop_database_result() try: - result.success = self._handler.drop_database(args.name) - except MetaException, o2: + self._handler.drop_database(args.name, args.deleteData) + except NoSuchObjectException, o1: + result.o1 = o1 + except InvalidOperationException, o2: result.o2 = o2 + except MetaException, o3: + result.o3 = o3 oprot.writeMessageBegin("drop_database", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() @@ -1443,7 +1535,7 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): iprot.readMessageEnd() result = get_databases_result() try: - result.success = self._handler.get_databases() + result.success = self._handler.get_databases(args.pattern) except MetaException, o1: result.o1 = o1 oprot.writeMessageBegin("get_databases", TMessageType.REPLY, seqid) @@ -1451,6 +1543,20 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() + def process_get_all_databases(self, seqid, iprot, oprot): + args = get_all_databases_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_all_databases_result() + try: + result.success = self._handler.get_all_databases() + except MetaException, o1: + result.o1 = o1 + oprot.writeMessageBegin("get_all_databases", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_get_type(self, seqid, iprot, oprot): args = get_type_args() args.read(iprot) @@ -1458,7 +1564,9 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): result = get_type_result() try: result.success = self._handler.get_type(args.name) - except MetaException, o2: + except MetaException, o1: + result.o1 = o1 + except NoSuchObjectException, o2: result.o2 = o2 oprot.writeMessageBegin("get_type", TMessageType.REPLY, seqid) result.write(oprot) @@ -1490,7 +1598,9 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): result = drop_type_result() try: result.success = self._handler.drop_type(args.type) - except MetaException, o2: + except MetaException, o1: + result.o1 = o1 + except NoSuchObjectException, o2: result.o2 = o2 oprot.writeMessageBegin("drop_type", TMessageType.REPLY, seqid) result.write(oprot) @@ -1597,6 +1707,20 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() + def process_get_all_tables(self, seqid, iprot, oprot): + args = get_all_tables_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_all_tables_result() + try: + result.success = self._handler.get_all_tables(args.db_name) + except MetaException, o1: + result.o1 = o1 + oprot.writeMessageBegin("get_all_tables", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_get_table(self, seqid, iprot, oprot): args = get_table_args() args.read(iprot) @@ -1869,19 +1993,16 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): class create_database_args: """ Attributes: - - name - - description + - database """ thrift_spec = ( None, # 0 - (1, TType.STRING, 'name', None, None, ), # 1 - (2, TType.STRING, 'description', None, None, ), # 2 + (1, TType.STRUCT, 'database', (Database, Database.thrift_spec), None, ), # 1 ) - def __init__(self, name=None, description=None,): - self.name = name - self.description = description + def __init__(self, database=None,): + self.database = database 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: @@ -1893,13 +2014,9 @@ class create_database_args: if ftype == TType.STOP: break if fid == 1: - if ftype == TType.STRING: - self.name = iprot.readString(); - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.description = iprot.readString(); + if ftype == TType.STRUCT: + self.database = Database() + self.database.read(iprot) else: iprot.skip(ftype) else: @@ -1912,13 +2029,9 @@ class create_database_args: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('create_database_args') - if self.name != None: - oprot.writeFieldBegin('name', TType.STRING, 1) - oprot.writeString(self.name) - oprot.writeFieldEnd() - if self.description != None: - oprot.writeFieldBegin('description', TType.STRING, 2) - oprot.writeString(self.description) + if self.database != None: + oprot.writeFieldBegin('database', TType.STRUCT, 1) + self.database.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1937,21 +2050,22 @@ class create_database_args: class create_database_result: """ Attributes: - - success - o1 - o2 + - o3 """ thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 + None, # 0 (1, TType.STRUCT, 'o1', (AlreadyExistsException, AlreadyExistsException.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 2 + (2, TType.STRUCT, 'o2', (InvalidObjectException, InvalidObjectException.thrift_spec), None, ), # 2 + (3, TType.STRUCT, 'o3', (MetaException, MetaException.thrift_spec), None, ), # 3 ) - def __init__(self, success=None, o1=None, o2=None,): - self.success = success + def __init__(self, o1=None, o2=None, o3=None,): self.o1 = o1 self.o2 = o2 + self.o3 = o3 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: @@ -1962,12 +2076,7 @@ class create_database_result: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break - if fid == 0: - if ftype == TType.BOOL: - self.success = iprot.readBool(); - else: - iprot.skip(ftype) - elif fid == 1: + if fid == 1: if ftype == TType.STRUCT: self.o1 = AlreadyExistsException() self.o1.read(iprot) @@ -1975,10 +2084,16 @@ class create_database_result: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: - self.o2 = MetaException() + self.o2 = InvalidObjectException() self.o2.read(iprot) else: iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.o3 = MetaException() + self.o3.read(iprot) + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -1989,10 +2104,6 @@ class create_database_result: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('create_database_result') - if self.success != None: - oprot.writeFieldBegin('success', TType.BOOL, 0) - oprot.writeBool(self.success) - oprot.writeFieldEnd() if self.o1 != None: oprot.writeFieldBegin('o1', TType.STRUCT, 1) self.o1.write(oprot) @@ -2001,6 +2112,10 @@ class create_database_result: oprot.writeFieldBegin('o2', TType.STRUCT, 2) self.o2.write(oprot) oprot.writeFieldEnd() + if self.o3 != None: + oprot.writeFieldBegin('o3', TType.STRUCT, 3) + self.o3.write(oprot) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2157,15 +2272,18 @@ class drop_database_args: """ Attributes: - name + - deleteData """ thrift_spec = ( None, # 0 (1, TType.STRING, 'name', None, None, ), # 1 + (2, TType.BOOL, 'deleteData', None, None, ), # 2 ) - def __init__(self, name=None,): + def __init__(self, name=None, deleteData=None,): self.name = name + self.deleteData = deleteData 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: @@ -2181,6 +2299,11 @@ class drop_database_args: self.name = iprot.readString(); else: iprot.skip(ftype) + elif fid == 2: + if ftype == TType.BOOL: + self.deleteData = iprot.readBool(); + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -2195,6 +2318,10 @@ class drop_database_args: oprot.writeFieldBegin('name', TType.STRING, 1) oprot.writeString(self.name) oprot.writeFieldEnd() + if self.deleteData != None: + oprot.writeFieldBegin('deleteData', TType.BOOL, 2) + oprot.writeBool(self.deleteData) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2212,19 +2339,22 @@ class drop_database_args: class drop_database_result: """ Attributes: - - success + - o1 - o2 + - o3 """ thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 - None, # 1 - (2, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 2 + None, # 0 + (1, TType.STRUCT, 'o1', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'o2', (InvalidOperationException, InvalidOperationException.thrift_spec), None, ), # 2 + (3, TType.STRUCT, 'o3', (MetaException, MetaException.thrift_spec), None, ), # 3 ) - def __init__(self, success=None, o2=None,): - self.success = success + def __init__(self, o1=None, o2=None, o3=None,): + self.o1 = o1 self.o2 = o2 + self.o3 = o3 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: @@ -2235,17 +2365,24 @@ class drop_database_result: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break - if fid == 0: - if ftype == TType.BOOL: - self.success = iprot.readBool(); + if fid == 1: + if ftype == TType.STRUCT: + self.o1 = NoSuchObjectException() + self.o1.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: - self.o2 = MetaException() + self.o2 = InvalidOperationException() self.o2.read(iprot) else: iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.o3 = MetaException() + self.o3.read(iprot) + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -2256,14 +2393,18 @@ class drop_database_result: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('drop_database_result') - if self.success != None: - oprot.writeFieldBegin('success', TType.BOOL, 0) - oprot.writeBool(self.success) + if self.o1 != None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) oprot.writeFieldEnd() if self.o2 != None: oprot.writeFieldBegin('o2', TType.STRUCT, 2) self.o2.write(oprot) oprot.writeFieldEnd() + if self.o3 != None: + oprot.writeFieldBegin('o3', TType.STRUCT, 3) + self.o3.write(oprot) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2279,10 +2420,19 @@ class drop_database_result: return not (self == other) class get_databases_args: + """ + Attributes: + - pattern + """ thrift_spec = ( + None, # 0 + (1, TType.STRING, 'pattern', None, None, ), # 1 ) + def __init__(self, pattern=None,): + self.pattern = pattern + 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: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) @@ -2292,6 +2442,11 @@ class get_databases_args: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break + if fid == 1: + if ftype == TType.STRING: + self.pattern = iprot.readString(); + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -2302,6 +2457,10 @@ class get_databases_args: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('get_databases_args') + if self.pattern != None: + oprot.writeFieldBegin('pattern', TType.STRING, 1) + oprot.writeString(self.pattern) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2392,6 +2551,120 @@ class get_databases_result: def __ne__(self, other): return not (self == other) +class get_all_databases_args: + + thrift_spec = ( + ) + + 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: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_all_databases_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_all_databases_result: + """ + Attributes: + - success + - o1 + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRING,None), None, ), # 0 + (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, o1=None,): + self.success = success + self.o1 = o1 + + 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: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype111, _size108) = iprot.readListBegin() + for _i112 in xrange(_size108): + _elem113 = iprot.readString(); + self.success.append(_elem113) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.o1 = MetaException() + self.o1.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_all_databases_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRING, len(self.success)) + for iter114 in self.success: + oprot.writeString(iter114) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.o1 != None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + class get_type_args: """ Attributes: @@ -2452,16 +2725,19 @@ class get_type_result: """ Attributes: - success + - o1 - o2 """ thrift_spec = ( (0, TType.STRUCT, 'success', (Type, Type.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 1 + (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'o2', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 2 ) - def __init__(self, success=None, o2=None,): + def __init__(self, success=None, o1=None, o2=None,): self.success = success + self.o1 = o1 self.o2 = o2 def read(self, iprot): @@ -2481,7 +2757,13 @@ class get_type_result: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.o2 = MetaException() + self.o1 = MetaException() + self.o1.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.o2 = NoSuchObjectException() self.o2.read(iprot) else: iprot.skip(ftype) @@ -2499,8 +2781,12 @@ class get_type_result: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() + if self.o1 != None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) + oprot.writeFieldEnd() if self.o2 != None: - oprot.writeFieldBegin('o2', TType.STRUCT, 1) + oprot.writeFieldBegin('o2', TType.STRUCT, 2) self.o2.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() @@ -2728,16 +3014,19 @@ class drop_type_result: """ Attributes: - success + - o1 - o2 """ thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 1 + (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'o2', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 2 ) - def __init__(self, success=None, o2=None,): + def __init__(self, success=None, o1=None, o2=None,): self.success = success + self.o1 = o1 self.o2 = o2 def read(self, iprot): @@ -2756,7 +3045,13 @@ class drop_type_result: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.o2 = MetaException() + self.o1 = MetaException() + self.o1.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.o2 = NoSuchObjectException() self.o2.read(iprot) else: iprot.skip(ftype) @@ -2774,8 +3069,12 @@ class drop_type_result: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) oprot.writeFieldEnd() + if self.o1 != None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) + oprot.writeFieldEnd() if self.o2 != None: - oprot.writeFieldBegin('o2', TType.STRUCT, 1) + oprot.writeFieldBegin('o2', TType.STRUCT, 2) self.o2.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() @@ -2876,12 +3175,12 @@ class get_type_all_result: if fid == 0: if ftype == TType.MAP: self.success = {} - (_ktype109, _vtype110, _size108 ) = iprot.readMapBegin() - for _i112 in xrange(_size108): - _key113 = iprot.readString(); - _val114 = Type() - _val114.read(iprot) - self.success[_key113] = _val114 + (_ktype116, _vtype117, _size115 ) = iprot.readMapBegin() + for _i119 in xrange(_size115): + _key120 = iprot.readString(); + _val121 = Type() + _val121.read(iprot) + self.success[_key120] = _val121 iprot.readMapEnd() else: iprot.skip(ftype) @@ -2904,9 +3203,9 @@ class get_type_all_result: if self.success != None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.success)) - for kiter115,viter116 in self.success.items(): - oprot.writeString(kiter115) - viter116.write(oprot) + for kiter122,viter123 in self.success.items(): + oprot.writeString(kiter122) + viter123.write(oprot) oprot.writeMapEnd() oprot.writeFieldEnd() if self.o2 != None: @@ -3029,11 +3328,11 @@ class get_fields_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype120, _size117) = iprot.readListBegin() - for _i121 in xrange(_size117): - _elem122 = FieldSchema() - _elem122.read(iprot) - self.success.append(_elem122) + (_etype127, _size124) = iprot.readListBegin() + for _i128 in xrange(_size124): + _elem129 = FieldSchema() + _elem129.read(iprot) + self.success.append(_elem129) iprot.readListEnd() else: iprot.skip(ftype) @@ -3068,8 +3367,8 @@ class get_fields_result: if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter123 in self.success: - iter123.write(oprot) + for iter130 in self.success: + iter130.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -3200,11 +3499,11 @@ class get_schema_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype127, _size124) = iprot.readListBegin() - for _i128 in xrange(_size124): - _elem129 = FieldSchema() - _elem129.read(iprot) - self.success.append(_elem129) + (_etype134, _size131) = iprot.readListBegin() + for _i135 in xrange(_size131): + _elem136 = FieldSchema() + _elem136.read(iprot) + self.success.append(_elem136) iprot.readListEnd() else: iprot.skip(ftype) @@ -3239,8 +3538,8 @@ class get_schema_result: if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter130 in self.success: - iter130.write(oprot) + for iter137 in self.success: + iter137.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -3668,10 +3967,10 @@ class get_tables_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype134, _size131) = iprot.readListBegin() - for _i135 in xrange(_size131): - _elem136 = iprot.readString(); - self.success.append(_elem136) + (_etype141, _size138) = iprot.readListBegin() + for _i142 in xrange(_size138): + _elem143 = iprot.readString(); + self.success.append(_elem143) iprot.readListEnd() else: iprot.skip(ftype) @@ -3694,8 +3993,140 @@ class get_tables_result: if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter137 in self.success: - oprot.writeString(iter137) + for iter144 in self.success: + oprot.writeString(iter144) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.o1 != None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_all_tables_args: + """ + Attributes: + - db_name + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'db_name', None, None, ), # 1 + ) + + def __init__(self, db_name=None,): + self.db_name = db_name + + 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: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.db_name = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_all_tables_args') + if self.db_name != None: + oprot.writeFieldBegin('db_name', TType.STRING, 1) + oprot.writeString(self.db_name) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_all_tables_result: + """ + Attributes: + - success + - o1 + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRING,None), None, ), # 0 + (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, o1=None,): + self.success = success + self.o1 = o1 + + 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: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype148, _size145) = iprot.readListBegin() + for _i149 in xrange(_size145): + _elem150 = iprot.readString(); + self.success.append(_elem150) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.o1 = MetaException() + self.o1.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_all_tables_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRING, len(self.success)) + for iter151 in self.success: + oprot.writeString(iter151) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -4211,10 +4642,10 @@ class append_partition_args: elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype141, _size138) = iprot.readListBegin() - for _i142 in xrange(_size138): - _elem143 = iprot.readString(); - self.part_vals.append(_elem143) + (_etype155, _size152) = iprot.readListBegin() + for _i156 in xrange(_size152): + _elem157 = iprot.readString(); + self.part_vals.append(_elem157) iprot.readListEnd() else: iprot.skip(ftype) @@ -4239,8 +4670,8 @@ class append_partition_args: if self.part_vals != None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter144 in self.part_vals: - oprot.writeString(iter144) + for iter158 in self.part_vals: + oprot.writeString(iter158) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -4572,10 +5003,10 @@ class drop_partition_args: elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype148, _size145) = iprot.readListBegin() - for _i149 in xrange(_size145): - _elem150 = iprot.readString(); - self.part_vals.append(_elem150) + (_etype162, _size159) = iprot.readListBegin() + for _i163 in xrange(_size159): + _elem164 = iprot.readString(); + self.part_vals.append(_elem164) iprot.readListEnd() else: iprot.skip(ftype) @@ -4605,8 +5036,8 @@ class drop_partition_args: if self.part_vals != None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter151 in self.part_vals: - oprot.writeString(iter151) + for iter165 in self.part_vals: + oprot.writeString(iter165) oprot.writeListEnd() oprot.writeFieldEnd() if self.deleteData != None: @@ -4923,10 +5354,10 @@ class get_partition_args: elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype155, _size152) = iprot.readListBegin() - for _i156 in xrange(_size152): - _elem157 = iprot.readString(); - self.part_vals.append(_elem157) + (_etype169, _size166) = iprot.readListBegin() + for _i170 in xrange(_size166): + _elem171 = iprot.readString(); + self.part_vals.append(_elem171) iprot.readListEnd() else: iprot.skip(ftype) @@ -4951,8 +5382,8 @@ class get_partition_args: if self.part_vals != None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter158 in self.part_vals: - oprot.writeString(iter158) + for iter172 in self.part_vals: + oprot.writeString(iter172) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -5324,11 +5755,11 @@ class get_partitions_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype162, _size159) = iprot.readListBegin() - for _i163 in xrange(_size159): - _elem164 = Partition() - _elem164.read(iprot) - self.success.append(_elem164) + (_etype176, _size173) = iprot.readListBegin() + for _i177 in xrange(_size173): + _elem178 = Partition() + _elem178.read(iprot) + self.success.append(_elem178) iprot.readListEnd() else: iprot.skip(ftype) @@ -5357,8 +5788,8 @@ class get_partitions_result: if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter165 in self.success: - iter165.write(oprot) + for iter179 in self.success: + iter179.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -5491,10 +5922,10 @@ class get_partition_names_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype169, _size166) = iprot.readListBegin() - for _i170 in xrange(_size166): - _elem171 = iprot.readString(); - self.success.append(_elem171) + (_etype183, _size180) = iprot.readListBegin() + for _i184 in xrange(_size180): + _elem185 = iprot.readString(); + self.success.append(_elem185) iprot.readListEnd() else: iprot.skip(ftype) @@ -5517,8 +5948,8 @@ class get_partition_names_result: if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter172 in self.success: - oprot.writeString(iter172) + for iter186 in self.success: + oprot.writeString(iter186) oprot.writeListEnd() oprot.writeFieldEnd() if self.o2 != None: @@ -5584,10 +6015,10 @@ class get_partitions_ps_args: elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype176, _size173) = iprot.readListBegin() - for _i177 in xrange(_size173): - _elem178 = iprot.readString(); - self.part_vals.append(_elem178) + (_etype190, _size187) = iprot.readListBegin() + for _i191 in xrange(_size187): + _elem192 = iprot.readString(); + self.part_vals.append(_elem192) iprot.readListEnd() else: iprot.skip(ftype) @@ -5617,8 +6048,8 @@ class get_partitions_ps_args: if self.part_vals != None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter179 in self.part_vals: - oprot.writeString(iter179) + for iter193 in self.part_vals: + oprot.writeString(iter193) oprot.writeListEnd() oprot.writeFieldEnd() if self.max_parts != None: @@ -5667,11 +6098,11 @@ class get_partitions_ps_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype183, _size180) = iprot.readListBegin() - for _i184 in xrange(_size180): - _elem185 = Partition() - _elem185.read(iprot) - self.success.append(_elem185) + (_etype197, _size194) = iprot.readListBegin() + for _i198 in xrange(_size194): + _elem199 = Partition() + _elem199.read(iprot) + self.success.append(_elem199) iprot.readListEnd() else: iprot.skip(ftype) @@ -5694,8 +6125,8 @@ class get_partitions_ps_result: if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter186 in self.success: - iter186.write(oprot) + for iter200 in self.success: + iter200.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -5761,10 +6192,10 @@ class get_partition_names_ps_args: elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype190, _size187) = iprot.readListBegin() - for _i191 in xrange(_size187): - _elem192 = iprot.readString(); - self.part_vals.append(_elem192) + (_etype204, _size201) = iprot.readListBegin() + for _i205 in xrange(_size201): + _elem206 = iprot.readString(); + self.part_vals.append(_elem206) iprot.readListEnd() else: iprot.skip(ftype) @@ -5794,8 +6225,8 @@ class get_partition_names_ps_args: if self.part_vals != None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter193 in self.part_vals: - oprot.writeString(iter193) + for iter207 in self.part_vals: + oprot.writeString(iter207) oprot.writeListEnd() oprot.writeFieldEnd() if self.max_parts != None: @@ -5844,10 +6275,10 @@ class get_partition_names_ps_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype197, _size194) = iprot.readListBegin() - for _i198 in xrange(_size194): - _elem199 = iprot.readString(); - self.success.append(_elem199) + (_etype211, _size208) = iprot.readListBegin() + for _i212 in xrange(_size208): + _elem213 = iprot.readString(); + self.success.append(_elem213) iprot.readListEnd() else: iprot.skip(ftype) @@ -5870,8 +6301,8 @@ class get_partition_names_ps_result: if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter200 in self.success: - oprot.writeString(iter200) + for iter214 in self.success: + oprot.writeString(iter214) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -6263,10 +6694,10 @@ class partition_name_to_vals_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype204, _size201) = iprot.readListBegin() - for _i205 in xrange(_size201): - _elem206 = iprot.readString(); - self.success.append(_elem206) + (_etype218, _size215) = iprot.readListBegin() + for _i219 in xrange(_size215): + _elem220 = iprot.readString(); + self.success.append(_elem220) iprot.readListEnd() else: iprot.skip(ftype) @@ -6289,8 +6720,8 @@ class partition_name_to_vals_result: if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter207 in self.success: - oprot.writeString(iter207) + for iter221 in self.success: + oprot.writeString(iter221) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -6395,11 +6826,11 @@ class partition_name_to_spec_result: if fid == 0: if ftype == TType.MAP: self.success = {} - (_ktype209, _vtype210, _size208 ) = iprot.readMapBegin() - for _i212 in xrange(_size208): - _key213 = iprot.readString(); - _val214 = iprot.readString(); - self.success[_key213] = _val214 + (_ktype223, _vtype224, _size222 ) = iprot.readMapBegin() + for _i226 in xrange(_size222): + _key227 = iprot.readString(); + _val228 = iprot.readString(); + self.success[_key227] = _val228 iprot.readMapEnd() else: iprot.skip(ftype) @@ -6422,9 +6853,9 @@ class partition_name_to_spec_result: if self.success != None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success)) - for kiter215,viter216 in self.success.items(): - oprot.writeString(kiter215) - oprot.writeString(viter216) + for kiter229,viter230 in self.success.items(): + oprot.writeString(kiter229) + oprot.writeString(viter230) oprot.writeMapEnd() oprot.writeFieldEnd() if self.o1 != None: diff --git metastore/src/gen-py/hive_metastore/ttypes.py metastore/src/gen-py/hive_metastore/ttypes.py index b225889..79a4dbe 100644 --- metastore/src/gen-py/hive_metastore/ttypes.py +++ metastore/src/gen-py/hive_metastore/ttypes.py @@ -270,17 +270,20 @@ class Database: Attributes: - name - description + - locationUri """ thrift_spec = ( None, # 0 (1, TType.STRING, 'name', None, None, ), # 1 (2, TType.STRING, 'description', None, None, ), # 2 + (3, TType.STRING, 'locationUri', None, None, ), # 3 ) - def __init__(self, name=None, description=None,): + def __init__(self, name=None, description=None, locationUri=None,): self.name = name self.description = description + self.locationUri = locationUri 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: @@ -301,6 +304,11 @@ class Database: self.description = iprot.readString(); else: iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.locationUri = iprot.readString(); + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -319,6 +327,10 @@ class Database: oprot.writeFieldBegin('description', TType.STRING, 2) oprot.writeString(self.description) oprot.writeFieldEnd() + if self.locationUri != None: + oprot.writeFieldBegin('locationUri', TType.STRING, 3) + oprot.writeString(self.locationUri) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() diff --git metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index 1cba29a..a942f0c 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -18,6 +18,11 @@ package org.apache.hadoop.hive.metastore; +import static org.apache.commons.lang.StringUtils.join; +import static org.apache.hadoop.hive.metastore.MetaStoreUtils.DEFAULT_DATABASE_COMMENT; +import static org.apache.hadoop.hive.metastore.MetaStoreUtils.DEFAULT_DATABASE_NAME; +import static org.apache.hadoop.hive.metastore.MetaStoreUtils.validateName; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -349,14 +354,13 @@ public class HiveMetaStore extends ThriftHiveMetastore { return; } - private void createDefaultDB_core(RawStore ms) throws MetaException { + private void createDefaultDB_core(RawStore ms) throws MetaException, InvalidObjectException { try { ms.getDatabase(MetaStoreUtils.DEFAULT_DATABASE_NAME); } catch (NoSuchObjectException e) { ms.createDatabase( - new Database(MetaStoreUtils.DEFAULT_DATABASE_NAME, wh - .getDefaultDatabasePath(MetaStoreUtils.DEFAULT_DATABASE_NAME) - .toString())); + new Database(DEFAULT_DATABASE_NAME, DEFAULT_DATABASE_COMMENT, + wh.getDefaultDatabasePath(DEFAULT_DATABASE_NAME).toString())); } HMSHandler.createDefaultDB = true; } @@ -378,6 +382,8 @@ public class HiveMetaStore extends ThriftHiveMetastore { return Boolean.TRUE; } }); + } catch (InvalidObjectException e) { + throw new MetaException(e.getMessage()); } catch (MetaException e) { throw e; } catch (Exception e) { @@ -400,9 +406,13 @@ public class HiveMetaStore extends ThriftHiveMetastore { LOG.info(threadLocalId.get().toString() + ": " + m); } - private void logStartFunction(String f, String db, String tbl) { - LOG.info(threadLocalId.get().toString() + ": " + f + " : db=" + db - + " tbl=" + tbl); + private void logStartTableFunction(String f, String db, String tbl) { + LOG.info(threadLocalId.get().toString() + ": " + f + " : db=" + db + " tbl=" + tbl); + } + + private void logStartPartitionFunction(String f, String db, String tbl, List partVals) { + LOG.info(threadLocalId.get().toString() + ": " + f + " : db=" + db + " tbl=" + tbl + + "[" + join(partVals, ",") + "]"); } @Override @@ -420,48 +430,60 @@ public class HiveMetaStore extends ThriftHiveMetastore { System.exit(0); } - private boolean create_database_core(RawStore ms, final String name, - final String location_uri) throws AlreadyExistsException, MetaException { + private void create_database_core(RawStore ms, final Database db) + throws AlreadyExistsException, InvalidObjectException, MetaException { + if (!validateName(db.getName())) { + throw new InvalidObjectException(db.getName() + " is not a valid database name"); + } boolean success = false; try { ms.openTransaction(); - Database db = new Database(name, location_uri); - if (ms.createDatabase(db) - && wh.mkdirs(wh.getDefaultDatabasePath(name))) { - success = ms.commitTransaction(); + if (null == db.getLocationUri()) { + db.setLocationUri(wh.getDefaultDatabasePath(db.getName()).toString()); } + ms.createDatabase(db); + success = ms.commitTransaction(); } finally { if (!success) { ms.rollbackTransaction(); + } else { + wh.mkdirs(new Path(db.getLocationUri())); } } - return success; } - public boolean create_database(final String name, final String location_uri) - throws AlreadyExistsException, MetaException { + public void create_database(final Database db) + throws AlreadyExistsException, InvalidObjectException, MetaException { incrementCounter("create_database"); - logStartFunction("create_database: " + name); - - Boolean ret = null; + logStartFunction("create_database: " + + db.getName() + " " + + db.getLocationUri() + " " + + db.getDescription()); try { - ret = executeWithRetry(new Command() { + try { + if(null != get_database(db.getName())) { + throw new AlreadyExistsException("Database " + db.getName() + " already exists"); + } + } catch (NoSuchObjectException e) { + // expected + } + executeWithRetry(new Command() { @Override Boolean run(RawStore ms) throws Exception { - boolean success = create_database_core(ms, name, location_uri); - return Boolean.valueOf(success); + create_database_core(ms, db); + return Boolean.TRUE; } }); } catch (AlreadyExistsException e) { throw e; + } catch (InvalidObjectException e) { + throw e; } catch (MetaException e) { throw e; } catch (Exception e) { assert(e instanceof RuntimeException); throw (RuntimeException)e; } - - return ret.booleanValue(); } public Database get_database(final String name) throws NoSuchObjectException, @@ -488,59 +510,90 @@ public class HiveMetaStore extends ThriftHiveMetastore { return db; } - private boolean drop_database_core(RawStore ms, final String name) throws MetaException { + private void drop_database_core(RawStore ms, + final String name, final boolean deleteData) + throws NoSuchObjectException, InvalidOperationException, MetaException { boolean success = false; + Database db = null; try { ms.openTransaction(); + db = ms.getDatabase(name); + if (!get_all_tables(db.getName()).isEmpty()) { + throw new InvalidOperationException("Database " + db.getName() + " is not empty"); + } if (ms.dropDatabase(name)) { success = ms.commitTransaction(); } } finally { if (!success) { ms.rollbackTransaction(); - } else { - wh.deleteDir(wh.getDefaultDatabasePath(name), true); + } else if (deleteData) { + wh.deleteDir(new Path(db.getLocationUri()), true); // it is not a terrible thing even if the data is not deleted } } - return success; } - public boolean drop_database(final String name) throws MetaException { + + public void drop_database(final String dbName, final boolean deleteData) + throws NoSuchObjectException, InvalidOperationException, MetaException { incrementCounter("drop_database"); - logStartFunction("drop_database: " + name); - if (name.equalsIgnoreCase(MetaStoreUtils.DEFAULT_DATABASE_NAME)) { - throw new MetaException("Can't drop default database"); + logStartFunction("drop_database: " + dbName); + if (DEFAULT_DATABASE_NAME.equalsIgnoreCase(dbName)) { + throw new MetaException("Can not drop default database"); } - Boolean ret = null; try { - ret = executeWithRetry(new Command() { + executeWithRetry(new Command() { @Override Boolean run(RawStore ms) throws Exception { - boolean success = drop_database_core(ms, name); - return Boolean.valueOf(success); + drop_database_core(ms, dbName, deleteData); + return Boolean.TRUE; } }); + } catch (NoSuchObjectException e) { + throw e; + } catch (InvalidOperationException e) { + throw e; } catch (MetaException e) { throw e; } catch (Exception e) { assert(e instanceof RuntimeException); throw (RuntimeException)e; } - return ret.booleanValue(); } - public List get_databases() throws MetaException { + public List get_databases(final String pattern) throws MetaException { incrementCounter("get_databases"); - logStartFunction("get_databases"); + logStartFunction("get_databases: " + pattern); + + List ret = null; + try { + ret = executeWithRetry(new Command>() { + @Override + List run(RawStore ms) throws Exception { + return ms.getDatabases(pattern); + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + assert(e instanceof RuntimeException); + throw (RuntimeException)e; + } + return ret; + } + + public List get_all_databases() throws MetaException { + incrementCounter("get_all_databases"); + logStartFunction("get_all_databases"); List ret = null; try { ret = executeWithRetry(new Command>() { @Override List run(RawStore ms) throws Exception { - return ms.getDatabases(); + return ms.getAllDatabases(); } }); } catch (MetaException e) { @@ -552,23 +605,38 @@ public class HiveMetaStore extends ThriftHiveMetastore { return ret; } + private void create_type_core(final RawStore ms, final Type type) + throws AlreadyExistsException, MetaException, InvalidObjectException { + if (!MetaStoreUtils.validateName(type.getName())) { + throw new InvalidObjectException("Invalid type name"); + } + + boolean success = false; + try { + ms.openTransaction(); + if (is_type_exists(type.getName())) { + throw new AlreadyExistsException("Type " + type.getName() + " already exists"); + } + ms.createType(type); + success = ms.commitTransaction(); + } finally { + if (!success) { + ms.rollbackTransaction(); + } + } + } + public boolean create_type(final Type type) throws AlreadyExistsException, MetaException, InvalidObjectException { incrementCounter("create_type"); logStartFunction("create_type: " + type.getName()); - // check whether type already exists - if (get_type(type.getName()) != null) { - throw new AlreadyExistsException("Type " + type.getName() - + " already exists"); - } - Boolean ret = null; try { ret = executeWithRetry(new Command() { @Override Boolean run(RawStore ms) throws Exception { - // TODO:pc Validation of types should be done by clients or here???? - return Boolean.valueOf(ms.createType(type)); + create_type_core(ms, type); + return Boolean.TRUE; } }); } catch (AlreadyExistsException e) { @@ -583,9 +651,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { } return ret.booleanValue(); - } + } - public Type get_type(final String name) throws MetaException { + public Type get_type(final String name) throws MetaException, NoSuchObjectException { incrementCounter("get_type"); logStartFunction("get_type: " + name); @@ -594,9 +662,15 @@ public class HiveMetaStore extends ThriftHiveMetastore { ret = executeWithRetry(new Command() { @Override Type run(RawStore ms) throws Exception { - return ms.getType(name); + Type type = ms.getType(name); + if (null == type) { + throw new NoSuchObjectException("Type \"" + name + "\" not found."); + } + return type; } }); + } catch (NoSuchObjectException e) { + throw e; } catch (MetaException e) { throw e; } catch (Exception e) { @@ -606,6 +680,36 @@ public class HiveMetaStore extends ThriftHiveMetastore { return ret; } + public boolean is_type_exists(String typeName) throws MetaException { + incrementCounter("is_type_exists"); + logStartFunction("is_type_exists: " + typeName); + try { + return (get_type(typeName) != null); + } catch (NoSuchObjectException e) { + return false; + } + } + + private void drop_type_core(final RawStore ms, String typeName) + throws NoSuchObjectException, MetaException { + boolean success = false; + try { + ms.openTransaction(); + // drop any partitions + if (!is_type_exists(typeName)) { + throw new NoSuchObjectException(typeName + " doesn't exist"); + } + if (!ms.dropType(typeName)) { + throw new MetaException("Unable to drop type " + typeName); + } + success = ms.commitTransaction(); + } finally { + if (!success) { + ms.rollbackTransaction(); + } + } + } + public boolean drop_type(final String name) throws MetaException { incrementCounter("drop_type"); logStartFunction("drop_type: " + name); @@ -631,7 +735,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { public Map get_type_all(String name) throws MetaException { incrementCounter("get_type_all"); // TODO Auto-generated method stub - logStartFunction("get_type_all"); + logStartFunction("get_type_all: " + name); throw new MetaException("Not yet implemented"); } @@ -727,6 +831,8 @@ public class HiveMetaStore extends ThriftHiveMetastore { public boolean is_table_exists(String dbname, String name) throws MetaException { try { + incrementCounter("is_table_exists"); + logStartTableFunction("is_table_exists", dbname, name); return (get_table(dbname, name) != null); } catch (NoSuchObjectException e) { return false; @@ -774,7 +880,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { public void drop_table(final String dbname, final String name, final boolean deleteData) throws NoSuchObjectException, MetaException { incrementCounter("drop_table"); - logStartFunction("drop_table", dbname, name); + logStartTableFunction("drop_table", dbname, name); try { executeWithRetry(new Command() { @@ -810,7 +916,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { NoSuchObjectException { Table t = null; incrementCounter("get_table"); - logStartFunction("get_table", dbname, name); + logStartTableFunction("get_table", dbname, name); try { t = executeWithRetry(new Command() { @Override @@ -837,7 +943,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { public boolean set_table_parameters(String dbname, String name, Map params) throws NoSuchObjectException, MetaException { incrementCounter("set_table_parameters"); - logStartFunction("set_table_parameters", dbname, name); + logStartTableFunction("set_table_parameters", dbname, name); // TODO Auto-generated method stub return false; } @@ -911,7 +1017,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { final List part_vals) throws InvalidObjectException, AlreadyExistsException, MetaException { incrementCounter("append_partition"); - logStartFunction("append_partition", dbName, tableName); + logStartPartitionFunction("append_partition", dbName, tableName, part_vals); if (LOG.isDebugEnabled()) { for (String part : part_vals) { LOG.debug(part); @@ -943,7 +1049,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { throws MetaException, InvalidObjectException, AlreadyExistsException { String db = parts.get(0).getDbName(); String tbl = parts.get(0).getTableName(); - logStartFunction("add_partitions", db, tbl); + logStartTableFunction("add_partitions", db, tbl); boolean success = false; try { ms.openTransaction(); @@ -1056,7 +1162,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { public Partition add_partition(final Partition part) throws InvalidObjectException, AlreadyExistsException, MetaException { incrementCounter("add_partition"); - logStartFunction("add_partition", part.getDbName(), part.getTableName()); + logStartTableFunction("add_partition", part.getDbName(), part.getTableName()); Partition ret = null; try { @@ -1137,7 +1243,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { final List part_vals, final boolean deleteData) throws NoSuchObjectException, MetaException, TException { incrementCounter("drop_partition"); - logStartFunction("drop_partition", db_name, tbl_name); + logStartPartitionFunction("drop_partition", db_name, tbl_name, part_vals); LOG.info("Partition values:" + part_vals); Boolean ret = null; @@ -1166,7 +1272,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { public Partition get_partition(final String db_name, final String tbl_name, final List part_vals) throws MetaException, NoSuchObjectException { incrementCounter("get_partition"); - logStartFunction("get_partition", db_name, tbl_name); + logStartPartitionFunction("get_partition", db_name, tbl_name, part_vals); Partition ret = null; try { @@ -1190,7 +1296,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { public List get_partitions(final String db_name, final String tbl_name, final short max_parts) throws NoSuchObjectException, MetaException { incrementCounter("get_partitions"); - logStartFunction("get_partitions", db_name, tbl_name); + logStartTableFunction("get_partitions", db_name, tbl_name); List ret = null; try { @@ -1215,7 +1321,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { public List get_partition_names(final String db_name, final String tbl_name, final short max_parts) throws MetaException { incrementCounter("get_partition_names"); - logStartFunction("get_partition_names", db_name, tbl_name); + logStartTableFunction("get_partition_names", db_name, tbl_name); List ret = null; try { @@ -1250,7 +1356,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { final Partition new_part) throws InvalidOperationException, MetaException, TException { incrementCounter("alter_partition"); - logStartFunction("alter_partition", db_name, tbl_name); + logStartTableFunction("alter_partition", db_name, tbl_name); LOG.info("Partition values:" + new_part.getValues()); try { @@ -1337,6 +1443,27 @@ public class HiveMetaStore extends ThriftHiveMetastore { } + public List get_all_tables(final String dbname) throws MetaException { + incrementCounter("get_all_tables"); + logStartFunction("get_all_tables: db=" + dbname); + + List ret; + try { + ret = executeWithRetry(new Command>() { + @Override + List run(RawStore ms) throws Exception { + return ms.getAllTables(dbname); + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + assert(e instanceof RuntimeException); + throw (RuntimeException)e; + } + return ret; + } + public List get_fields(String db, String tableName) throws MetaException, UnknownTableException, UnknownDBException { incrementCounter("get_fields"); @@ -1595,7 +1722,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { List part_vals, short max_parts) throws MetaException, TException { incrementCounter("get_partitions_ps"); - logStartFunction("get_partitions_ps", db_name, tbl_name); + logStartPartitionFunction("get_partitions_ps", db_name, tbl_name, part_vals); List parts = null; List matchingParts = new ArrayList(); @@ -1623,7 +1750,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { public List get_partition_names_ps(String db_name, String tbl_name, List part_vals, short max_parts) throws MetaException, TException { incrementCounter("get_partition_names_ps"); - logStartFunction("get_partitions_names_ps", db_name, tbl_name); + logStartPartitionFunction("get_partitions_names_ps", db_name, tbl_name, part_vals); Table t; try { t = get_table(db_name, tbl_name); diff --git metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java index 870f080..decafb0 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java @@ -18,6 +18,8 @@ package org.apache.hadoop.hive.metastore; +import static org.apache.hadoop.hive.metastore.MetaStoreUtils.DEFAULT_DATABASE_NAME; + import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; @@ -203,19 +205,6 @@ public class HiveMetaStoreClient implements IMetaStoreClient { } } - public void dropTable(String tableName, boolean deleteData) - throws MetaException, NoSuchObjectException { - // assume that it is default database - try { - this.dropTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tableName, - deleteData, false); - } catch (NoSuchObjectException e) { - throw e; - } catch (Exception e) { - MetaStoreUtils.logAndThrowMetaException(e); - } - } - /** * @param new_part * @return the added partition @@ -255,19 +244,21 @@ public class HiveMetaStoreClient implements IMetaStoreClient { return deepCopy( client.append_partition_by_name(dbName, tableName, partName)); } + /** - * @param name - * @param location_uri + * Create a new Database + * @param db * @return true or false * @throws AlreadyExistsException + * @throws InvalidObjectException * @throws MetaException * @throws TException * @see org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#create_database(java.lang.String, * java.lang.String) */ - public boolean createDatabase(String name, String location_uri) - throws AlreadyExistsException, MetaException, TException { - return client.create_database(name, location_uri); + public void createDatabase(Database db) + throws AlreadyExistsException, InvalidObjectException, MetaException, TException { + client.create_database(db); } /** @@ -314,12 +305,29 @@ public class HiveMetaStoreClient implements IMetaStoreClient { /** * @param name * @return true or false + * @throws NoSuchObjectException + * @throws InvalidOperationException * @throws MetaException * @throws TException * @see org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#drop_database(java.lang.String) */ - public boolean dropDatabase(String name) throws MetaException, TException { - return client.drop_database(name); + public void dropDatabase(String name) + throws NoSuchObjectException, InvalidOperationException, MetaException, TException { + dropDatabase(name, true, false); + } + + + public void dropDatabase(String name, boolean deleteData, boolean ignoreUnknownDb) + throws NoSuchObjectException, InvalidOperationException, MetaException, TException { + try { + getDatabase(name); + } catch (NoSuchObjectException e) { + if (!ignoreUnknownDb) { + throw e; + } + return; + } + client.drop_database(name, deleteData); } /** @@ -377,6 +385,13 @@ public class HiveMetaStoreClient implements IMetaStoreClient { dropTable(dbname, name, true, true); } + /** {@inheritDoc} */ + @Deprecated + public void dropTable(String tableName, boolean deleteData) + throws MetaException, UnknownTableException, TException, NoSuchObjectException { + dropTable(DEFAULT_DATABASE_NAME, tableName, deleteData, false); + } + /** * @param dbname * @param name @@ -427,10 +442,11 @@ public class HiveMetaStoreClient implements IMetaStoreClient { * @param type * @return true if the type is dropped * @throws MetaException + * @throws NoSuchObjectException * @throws TException * @see org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#drop_type(java.lang.String) */ - public boolean dropType(String type) throws MetaException, TException { + public boolean dropType(String type) throws MetaException, NoSuchObjectException, TException { return client.drop_type(type); } @@ -454,14 +470,25 @@ public class HiveMetaStoreClient implements IMetaStoreClient { return result; } - /** - * @return the list of databases - * @throws MetaException - * @throws TException - * @see org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#get_databases() - */ - public List getDatabases() throws MetaException, TException { - return client.get_databases(); + /** {@inheritDoc} */ + public List getDatabases(String databasePattern) + throws MetaException { + try { + return client.get_databases(databasePattern); + } catch (Exception e) { + MetaStoreUtils.logAndThrowMetaException(e); + } + return null; + } + + /** {@inheritDoc} */ + public List getAllDatabases() throws MetaException { + try { + return client.get_all_databases(); + } catch (Exception e) { + MetaStoreUtils.logAndThrowMetaException(e); + } + return null; } /** @@ -531,19 +558,27 @@ public class HiveMetaStoreClient implements IMetaStoreClient { return deepCopy(client.get_table(dbname, name)); } + /** {@inheritDoc} */ + @Deprecated + public Table getTable(String tableName) throws MetaException, TException, + NoSuchObjectException { + return getTable(DEFAULT_DATABASE_NAME, tableName); + } + /** * @param name * @return the type * @throws MetaException + * @throws NoSuchObjectException * @throws TException * @see org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#get_type(java.lang.String) */ - public Type getType(String name) throws MetaException, TException { + public Type getType(String name) throws MetaException, NoSuchObjectException, TException { return deepCopy(client.get_type(name)); } - public List getTables(String dbname, String tablePattern) - throws MetaException { + /** {@inheritDoc} */ + public List getTables(String dbname, String tablePattern) throws MetaException { try { return client.get_tables(dbname, tablePattern); } catch (Exception e) { @@ -552,24 +587,31 @@ public class HiveMetaStoreClient implements IMetaStoreClient { return null; } - public List getTables(String tablePattern) throws MetaException { - String dbname = MetaStoreUtils.DEFAULT_DATABASE_NAME; - return this.getTables(dbname, tablePattern); + /** {@inheritDoc} */ + public List getAllTables(String dbname) throws MetaException { + try { + return client.get_all_tables(dbname); + } catch (Exception e) { + MetaStoreUtils.logAndThrowMetaException(e); + } + return null; } - public boolean tableExists(String tableName) throws MetaException, + public boolean tableExists(String databaseName, String tableName) throws MetaException, TException, UnknownDBException { try { - client.get_table(MetaStoreUtils.DEFAULT_DATABASE_NAME, tableName); + client.get_table(databaseName, tableName); } catch (NoSuchObjectException e) { return false; } return true; } - public Table getTable(String tableName) throws MetaException, TException, - NoSuchObjectException { - return getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tableName); + /** {@inheritDoc} */ + @Deprecated + public boolean tableExists(String tableName) throws MetaException, + TException, UnknownDBException { + return tableExists(DEFAULT_DATABASE_NAME, tableName); } public List listPartitionNames(String dbName, String tblName, diff --git metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java index 7cf3a91..2dcbbc1 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java @@ -23,6 +23,7 @@ import java.util.Map; import org.apache.hadoop.hive.metastore.api.AlreadyExistsException; import org.apache.hadoop.hive.metastore.api.ConfigValSecurityException; +import org.apache.hadoop.hive.metastore.api.Database; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.InvalidObjectException; import org.apache.hadoop.hive.metastore.api.InvalidOperationException; @@ -42,58 +43,115 @@ public interface IMetaStoreClient { public void close(); + /** + * Get the names of all databases in the MetaStore that match the given pattern. + * @param databasePattern + * @return List of database names. + * @throws MetaException + * @throws TException + */ + public List getDatabases(String databasePattern) + throws MetaException, TException; + + /** + * Get the names of all databases in the MetaStore. + * @return List of database names. + * @throws MetaException + * @throws TException + */ + public List getAllDatabases() + throws MetaException, TException; + + /** + * Get the names of all tables in the specified database that satisfy the supplied + * table name pattern. + * @param dbName + * @param tablePattern + * @return List of table names. + * @throws MetaException + * @throws TException + * @throws UnknownDBException + */ public List getTables(String dbName, String tablePattern) - throws MetaException, UnknownTableException, TException, - UnknownDBException; + throws MetaException, TException, UnknownDBException; + + /** + * Get the names of all tables in the specified database. + * @param dbName + * @return List of table names. + * @throws MetaException + * @throws TException + * @throws UnknownDBException + */ + public List getAllTables(String dbName) + throws MetaException, TException, UnknownDBException; + /** * Drop the table. * + * @param dbname + * The database for this table * @param tableName * The table to drop - * @param deleteData - * Should we delete the underlying data * @throws MetaException * Could not drop table properly. - * @throws UnknownTableException + * @throws NoSuchObjectException * The table wasn't found. * @throws TException * A thrift communication error occurred - * @throws NoSuchObjectException - * The table wasn't found. + * @throws ExistingDependentsException */ - public void dropTable(String tableName, boolean deleteData) - throws MetaException, UnknownTableException, TException, + public void dropTable(String dbname, String tableName, boolean deleteData, + boolean ignoreUknownTab) throws MetaException, TException, NoSuchObjectException; /** - * Drop the table. + * Drop the table in the DEFAULT database. * - * @param dbname - * The database for this table * @param tableName * The table to drop + * @param deleteData + * Should we delete the underlying data * @throws MetaException * Could not drop table properly. - * @throws NoSuchObjectException + * @throws UnknownTableException * The table wasn't found. * @throws TException * A thrift communication error occurred - * @throws ExistingDependentsException + * @throws NoSuchObjectException + * The table wasn't found. + * + * @deprecated As of release 0.6.0 replaced by {@link #dropTable(String, String, boolean, boolean)}. + * This method will be removed in release 0.7.0. */ - public void dropTable(String dbname, String tableName, boolean deleteData, - boolean ignoreUknownTab) throws MetaException, TException, + @Deprecated + public void dropTable(String tableName, boolean deleteData) + throws MetaException, UnknownTableException, TException, NoSuchObjectException; - // public void createTable(String tableName, Properties schema) throws - // MetaException, UnknownTableException, - // TException; + public void dropTable(String dbname, String tableName) + throws MetaException, TException, NoSuchObjectException; + + public boolean tableExists(String databaseName, String tableName) throws MetaException, + TException, UnknownDBException; + /** + * Check to see if the specified table exists in the DEFAULT database. + * @param tableName + * @return TRUE if DEFAULT.tableName exists, FALSE otherwise. + * @throws MetaException + * @throws TException + * @throws UnknownDBException + * @deprecated As of release 0.6.0 replaced by {@link #tableExists(String, String)}. + * This method will be removed in release 0.7.0. + */ + @Deprecated public boolean tableExists(String tableName) throws MetaException, TException, UnknownDBException; /** - * Get a table object. + * Get a table object from the DEFAULT database. * * @param tableName * Name of the table to fetch. @@ -104,11 +162,25 @@ public interface IMetaStoreClient { * A thrift communication error occurred * @throws NoSuchObjectException * In case the table wasn't found. + * @deprecated As of release 0.6.0 replaced by {@link #getTable(String, String)}. + * This method will be removed in release 0.7.0. */ + @Deprecated public Table getTable(String tableName) throws MetaException, TException, NoSuchObjectException; /** + * Get a Database Object + * @param databaseName name of the database to fetch + * @return + * @throws NoSuchObjectException The database does not exist + * @throws MetaException Could not fetch the database + * @throws TException A thrift communication error occurred + */ + public Database getDatabase(String databaseName) + throws NoSuchObjectException, MetaException, TException; + + /** * Get a table object. * * @param dbName @@ -225,10 +297,14 @@ public interface IMetaStoreClient { public void alter_table(String defaultDatabaseName, String tblName, Table table) throws InvalidOperationException, MetaException, TException; - public boolean createDatabase(String name, String location_uri) - throws AlreadyExistsException, MetaException, TException; + public void createDatabase(Database db) + throws InvalidObjectException, AlreadyExistsException, MetaException, TException; + + public void dropDatabase(String name) + throws NoSuchObjectException, InvalidOperationException, MetaException, TException; - public boolean dropDatabase(String name) throws MetaException, TException; + public void dropDatabase(String name, boolean deleteData, boolean ignoreUnknownDb) + throws NoSuchObjectException, InvalidOperationException, MetaException, TException; /** * @param db_name diff --git metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java index 6f3447b..f66ce9e 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java @@ -60,6 +60,7 @@ public class MetaStoreUtils { protected static final Log LOG = LogFactory.getLog("hive.log"); public static final String DEFAULT_DATABASE_NAME = "default"; + public static final String DEFAULT_DATABASE_COMMENT = "Default Hive database"; /** * printStackTrace @@ -324,134 +325,6 @@ public class MetaStoreUtils { return "map<" + k + "," + v + ">"; } - public static Table getTable(Configuration conf, Properties schema) - throws MetaException { - Table t = new Table(); - t.setSd(new StorageDescriptor()); - t - .setTableName(schema - .getProperty(org.apache.hadoop.hive.metastore.api.Constants.META_TABLE_NAME)); - t - .getSd() - .setLocation( - schema - .getProperty(org.apache.hadoop.hive.metastore.api.Constants.META_TABLE_LOCATION)); - t.getSd().setInputFormat( - schema.getProperty( - org.apache.hadoop.hive.metastore.api.Constants.FILE_INPUT_FORMAT, - org.apache.hadoop.mapred.SequenceFileInputFormat.class.getName())); - t.getSd().setOutputFormat( - schema.getProperty( - org.apache.hadoop.hive.metastore.api.Constants.FILE_OUTPUT_FORMAT, - org.apache.hadoop.mapred.SequenceFileOutputFormat.class.getName())); - t.setPartitionKeys(new ArrayList()); - t.setDbName(MetaStoreUtils.DEFAULT_DATABASE_NAME); - String part_cols_str = schema - .getProperty(org.apache.hadoop.hive.metastore.api.Constants.META_TABLE_PARTITION_COLUMNS); - t.setPartitionKeys(new ArrayList()); - if (part_cols_str != null && (part_cols_str.trim().length() != 0)) { - String[] part_keys = part_cols_str.trim().split("/"); - for (String key : part_keys) { - FieldSchema part = new FieldSchema(); - part.setName(key); - part.setType(org.apache.hadoop.hive.serde.Constants.STRING_TYPE_NAME); // default - // partition - // key - t.getPartitionKeys().add(part); - } - } - t.getSd() - .setNumBuckets( - Integer.parseInt(schema.getProperty( - org.apache.hadoop.hive.metastore.api.Constants.BUCKET_COUNT, - "-1"))); - String bucketFieldName = schema - .getProperty(org.apache.hadoop.hive.metastore.api.Constants.BUCKET_FIELD_NAME); - t.getSd().setBucketCols(new ArrayList(1)); - if ((bucketFieldName != null) && (bucketFieldName.trim().length() != 0)) { - t.getSd().setBucketCols(new ArrayList(1)); - t.getSd().getBucketCols().add(bucketFieldName); - } - - t.getSd().setSerdeInfo(new SerDeInfo()); - t.getSd().getSerdeInfo().setParameters(new HashMap()); - t.getSd().getSerdeInfo().setName(t.getTableName()); - t - .getSd() - .getSerdeInfo() - .setSerializationLib( - schema - .getProperty(org.apache.hadoop.hive.serde.Constants.SERIALIZATION_LIB)); - setSerdeParam(t.getSd().getSerdeInfo(), schema, - org.apache.hadoop.hive.serde.Constants.SERIALIZATION_CLASS); - setSerdeParam(t.getSd().getSerdeInfo(), schema, - org.apache.hadoop.hive.serde.Constants.SERIALIZATION_FORMAT); - if (org.apache.commons.lang.StringUtils - .isNotBlank(schema - .getProperty(org.apache.hadoop.hive.serde.Constants.SERIALIZATION_CLASS))) { - setSerdeParam(t.getSd().getSerdeInfo(), schema, - org.apache.hadoop.hive.metastore.api.Constants.META_TABLE_SERDE); - } - // needed for MetadataTypedColumnSetSerDe and LazySimpleSerDe - setSerdeParam(t.getSd().getSerdeInfo(), schema, - org.apache.hadoop.hive.metastore.api.Constants.META_TABLE_COLUMNS); - // needed for LazySimpleSerDe - setSerdeParam(t.getSd().getSerdeInfo(), schema, - org.apache.hadoop.hive.metastore.api.Constants.META_TABLE_COLUMN_TYPES); - // needed for DynamicSerDe - setSerdeParam(t.getSd().getSerdeInfo(), schema, - org.apache.hadoop.hive.serde.Constants.SERIALIZATION_DDL); - - String colstr = schema - .getProperty(org.apache.hadoop.hive.metastore.api.Constants.META_TABLE_COLUMNS); - List fields = new ArrayList(); - if (colstr != null) { - String[] cols = colstr.split(","); - for (String colName : cols) { - FieldSchema col = new FieldSchema(colName, - org.apache.hadoop.hive.serde.Constants.STRING_TYPE_NAME, - "'default'"); - fields.add(col); - } - } - - if (fields.size() == 0) { - // get the fields from serde - try { - fields = getFieldsFromDeserializer(t.getTableName(), getDeserializer( - conf, schema)); - } catch (SerDeException e) { - LOG.error(StringUtils.stringifyException(e)); - throw new MetaException("Invalid serde or schema. " + e.getMessage()); - } - } - t.getSd().setCols(fields); - - t.setOwner(schema.getProperty("creator")); - - // remove all the used up parameters to find out the remaining parameters - schema.remove(Constants.META_TABLE_NAME); - schema.remove(Constants.META_TABLE_LOCATION); - schema.remove(Constants.FILE_INPUT_FORMAT); - schema.remove(Constants.FILE_OUTPUT_FORMAT); - schema.remove(Constants.META_TABLE_PARTITION_COLUMNS); - schema.remove(Constants.BUCKET_COUNT); - schema.remove(Constants.BUCKET_FIELD_NAME); - schema.remove(org.apache.hadoop.hive.serde.Constants.SERIALIZATION_CLASS); - schema.remove(org.apache.hadoop.hive.serde.Constants.SERIALIZATION_FORMAT); - schema.remove(org.apache.hadoop.hive.serde.Constants.SERIALIZATION_LIB); - schema.remove(Constants.META_TABLE_SERDE); - schema.remove(Constants.META_TABLE_COLUMNS); - schema.remove(Constants.META_TABLE_COLUMN_TYPES); - - // add the remaining unknown parameters to the table's parameters - t.setParameters(new HashMap()); - for (Entry e : schema.entrySet()) { - t.getParameters().put(e.getKey().toString(), e.getValue().toString()); - } - - return t; - } public static void setSerdeParam(SerDeInfo sdi, Properties schema, String param) { diff --git metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java index 7b76a5d..aac0448 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java @@ -284,126 +284,133 @@ public class ObjectStore implements RawStore, Configurable { } } - public boolean createDatabase(Database db) { - boolean success = false; + + public void createDatabase(Database db) throws InvalidObjectException, MetaException { boolean commited = false; - MDatabase mdb = new MDatabase(db.getName().toLowerCase(), db - .getDescription()); + MDatabase mdb = new MDatabase(); + mdb.setName(db.getName().toLowerCase()); + mdb.setLocationUri(db.getLocationUri()); + mdb.setDescription(db.getDescription()); try { openTransaction(); pm.makePersistent(mdb); - success = true; commited = commitTransaction(); } finally { if (!commited) { rollbackTransaction(); } } - return success; - } - - public boolean createDatabase(String name) { - // TODO: get default path - Database db = new Database(name, "default_path"); - return this.createDatabase(db); } @SuppressWarnings("nls") private MDatabase getMDatabase(String name) throws NoSuchObjectException { - MDatabase db = null; + MDatabase mdb = null; boolean commited = false; try { openTransaction(); - name = name.toLowerCase(); + name = name.toLowerCase().trim(); Query query = pm.newQuery(MDatabase.class, "name == dbname"); query.declareParameters("java.lang.String dbname"); query.setUnique(true); - db = (MDatabase) query.execute(name.trim()); - pm.retrieve(db); + mdb = (MDatabase) query.execute(name); + pm.retrieve(mdb); commited = commitTransaction(); } finally { if (!commited) { rollbackTransaction(); } } - if (db == null) { + if (mdb == null) { throw new NoSuchObjectException("There is no database named " + name); } - return db; + return mdb; } public Database getDatabase(String name) throws NoSuchObjectException { - MDatabase db = null; + MDatabase mdb = null; boolean commited = false; try { openTransaction(); - db = getMDatabase(name); + mdb = getMDatabase(name); commited = commitTransaction(); } finally { if (!commited) { rollbackTransaction(); } } - return new Database(db.getName(), db.getDescription()); + Database db = new Database(); + db.setName(mdb.getName()); + db.setDescription(mdb.getDescription()); + db.setLocationUri(mdb.getLocationUri()); + return db; } - public boolean dropDatabase(String dbname) { - + public boolean dropDatabase(String dbname) throws NoSuchObjectException, MetaException { boolean success = false; - boolean commited = false; + LOG.info("Dropping database " + dbname + " along with all tables"); + dbname = dbname.toLowerCase(); try { openTransaction(); // first drop tables - dbname = dbname.toLowerCase(); - LOG.info("Dropping database along with all tables " + dbname); - Query q1 = pm.newQuery(MTable.class, "database.name == dbName"); - q1.declareParameters("java.lang.String dbName"); - List mtbls = (List) q1.execute(dbname.trim()); - pm.deletePersistentAll(mtbls); + for (String tableName : getAllTables(dbname)) { + dropTable(dbname, tableName); + } // then drop the database - Query query = pm.newQuery(MDatabase.class, "name == dbName"); - query.declareParameters("java.lang.String dbName"); - query.setUnique(true); - MDatabase db = (MDatabase) query.execute(dbname.trim()); + MDatabase db = getMDatabase(dbname); pm.retrieve(db); - - // StringIdentity id = new StringIdentity(MDatabase.class, dbname); - // MDatabase db = (MDatabase) pm.getObjectById(id); if (db != null) { pm.deletePersistent(db); } - commited = commitTransaction(); - success = true; - } catch (JDOObjectNotFoundException e) { - LOG.debug("database not found " + dbname, e); - commited = commitTransaction(); + success = commitTransaction(); } finally { - if (!commited) { + if (!success) { rollbackTransaction(); } } return success; } - public List getDatabases() { - List dbs = null; + public List getDatabases(String pattern) throws MetaException { boolean commited = false; + List databases = null; try { openTransaction(); - Query query = pm.newQuery(MDatabase.class); - query.setResult("name"); - query.setResultClass(String.class); - query.setOrdering("name asc"); - dbs = (List) query.execute(); + // Take the pattern and split it on the | to get all the composing + // patterns + String[] subpatterns = pattern.trim().split("\\|"); + String query = "select name from org.apache.hadoop.hive.metastore.model.MDatabase where ("; + boolean first = true; + for (String subpattern : subpatterns) { + subpattern = "(?i)" + subpattern.replaceAll("\\*", ".*"); + if (!first) { + query = query + " || "; + } + query = query + " name.matches(\"" + subpattern + "\")"; + first = false; + } + query = query + ")"; + + Query q = pm.newQuery(query); + q.setResult("name"); + q.setOrdering("name ascending"); + Collection names = (Collection) q.execute(); + databases = new ArrayList(); + for (Iterator i = names.iterator(); i.hasNext();) { + databases.add((String) i.next()); + } commited = commitTransaction(); } finally { if (!commited) { rollbackTransaction(); } } - return dbs; + return databases; + } + + public List getAllDatabases() throws MetaException { + return getDatabases(".*"); } private MType getMType(Type type) { @@ -507,7 +514,7 @@ public class ObjectStore implements RawStore, Configurable { } } - public boolean dropTable(String dbName, String tableName) { + public boolean dropTable(String dbName, String tableName) throws MetaException { boolean success = false; try { @@ -550,11 +557,13 @@ public class ObjectStore implements RawStore, Configurable { List tbls = null; try { openTransaction(); - dbName = dbName.toLowerCase(); + dbName = dbName.toLowerCase().trim(); // Take the pattern and split it on the | to get all the composing // patterns String[] subpatterns = pattern.trim().split("\\|"); - String query = "select tableName from org.apache.hadoop.hive.metastore.model.MTable where database.name == dbName && ("; + String query = + "select tableName from org.apache.hadoop.hive.metastore.model.MTable " + + "where database.name == dbName && ("; boolean first = true; for (String subpattern : subpatterns) { subpattern = "(?i)" + subpattern.replaceAll("\\*", ".*"); @@ -569,7 +578,8 @@ public class ObjectStore implements RawStore, Configurable { Query q = pm.newQuery(query); q.declareParameters("java.lang.String dbName"); q.setResult("tableName"); - Collection names = (Collection) q.execute(dbName.trim()); + q.setOrdering("tableName ascending"); + Collection names = (Collection) q.execute(dbName); tbls = new ArrayList(); for (Iterator i = names.iterator(); i.hasNext();) { tbls.add((String) i.next()); @@ -583,18 +593,21 @@ public class ObjectStore implements RawStore, Configurable { return tbls; } + public List getAllTables(String dbName) throws MetaException { + return getTables(dbName, ".*"); + } + private MTable getMTable(String db, String table) { MTable mtbl = null; boolean commited = false; try { openTransaction(); - db = db.toLowerCase(); - table = table.toLowerCase(); - Query query = pm.newQuery(MTable.class, - "tableName == table && database.name == db"); + db = db.toLowerCase().trim(); + table = table.toLowerCase().trim(); + Query query = pm.newQuery(MTable.class, "tableName == table && database.name == db"); query.declareParameters("java.lang.String table, java.lang.String db"); query.setUnique(true); - mtbl = (MTable) query.execute(table.trim(), db.trim()); + mtbl = (MTable) query.execute(table, db); pm.retrieve(mtbl); commited = commitTransaction(); } finally { @@ -639,7 +652,7 @@ public class ObjectStore implements RawStore, Configurable { } catch (NoSuchObjectException e) { LOG.error(StringUtils.stringifyException(e)); throw new InvalidObjectException("Database " + tbl.getDbName() - + " doesn't exsit."); + + " doesn't exist."); } // If the table has property EXTERNAL set, update table type @@ -788,8 +801,8 @@ public class ObjectStore implements RawStore, Configurable { boolean commited = false; try { openTransaction(); - dbName = dbName.toLowerCase(); - tableName = tableName.toLowerCase(); + dbName = dbName.toLowerCase().trim(); + tableName = tableName.toLowerCase().trim(); MTable mtbl = getMTable(dbName, tableName); if (mtbl == null) { commited = commitTransaction(); @@ -799,13 +812,11 @@ public class ObjectStore implements RawStore, Configurable { // redundant String name = Warehouse.makePartName(convertToFieldSchemas(mtbl .getPartitionKeys()), part_vals); - Query query = pm - .newQuery(MPartition.class, - "table.tableName == t1 && table.database.name == t2 && partitionName == t3"); - query - .declareParameters("java.lang.String t1, java.lang.String t2, java.lang.String t3"); + Query query = pm.newQuery(MPartition.class, + "table.tableName == t1 && table.database.name == t2 && partitionName == t3"); + query.declareParameters("java.lang.String t1, java.lang.String t2, java.lang.String t3"); query.setUnique(true); - mpart = (MPartition) query.execute(tableName.trim(), dbName.trim(), name); + mpart = (MPartition) query.execute(tableName, dbName, name); pm.retrieve(mpart); commited = commitTransaction(); } finally { @@ -886,14 +897,15 @@ public class ObjectStore implements RawStore, Configurable { try { openTransaction(); LOG.debug("Executing getPartitionNames"); - dbName = dbName.toLowerCase(); - tableName = tableName.toLowerCase(); - Query q = pm - .newQuery("select partitionName from org.apache.hadoop.hive.metastore.model.MPartition where table.database.name == t1 && table.tableName == t2 order by partitionName asc"); + dbName = dbName.toLowerCase().trim(); + tableName = tableName.toLowerCase().trim(); + Query q = pm.newQuery( + "select partitionName from org.apache.hadoop.hive.metastore.model.MPartition " + + "where table.database.name == t1 && table.tableName == t2 " + + "order by partitionName asc"); q.declareParameters("java.lang.String t1, java.lang.String t2"); q.setResult("partitionName"); - Collection names = (Collection) q - .execute(dbName.trim(), tableName.trim()); + Collection names = (Collection) q.execute(dbName, tableName); pns = new ArrayList(); for (Iterator i = names.iterator(); i.hasNext();) { pns.add((String) i.next()); @@ -915,13 +927,12 @@ public class ObjectStore implements RawStore, Configurable { try { openTransaction(); LOG.debug("Executing listMPartitions"); - dbName = dbName.toLowerCase(); - tableName = tableName.toLowerCase(); + dbName = dbName.toLowerCase().trim(); + tableName = tableName.toLowerCase().trim(); Query query = pm.newQuery(MPartition.class, "table.tableName == t1 && table.database.name == t2"); query.declareParameters("java.lang.String t1, java.lang.String t2"); - mparts = (List) query - .execute(tableName.trim(), dbName.trim()); + mparts = (List) query.execute(tableName, dbName); LOG.debug("Done executing query for listMPartitions"); pm.retrieveAll(mparts); success = commitTransaction(); diff --git metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java index 3451219..02bfd00 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java @@ -55,16 +55,18 @@ public interface RawStore extends Configurable { */ public abstract void rollbackTransaction(); - public abstract boolean createDatabase(Database db) throws MetaException; - - public abstract boolean createDatabase(String name) throws MetaException; + public abstract void createDatabase(Database db) + throws InvalidObjectException, MetaException; public abstract Database getDatabase(String name) throws NoSuchObjectException; - public abstract boolean dropDatabase(String dbname); + public abstract boolean dropDatabase(String dbname) + throws NoSuchObjectException, MetaException; + + public abstract List getDatabases(String pattern) throws MetaException; - public abstract List getDatabases() throws MetaException; + public abstract List getAllDatabases() throws MetaException; public abstract boolean createType(Type type); @@ -99,6 +101,8 @@ public interface RawStore extends Configurable { public List getTables(String dbName, String pattern) throws MetaException; + public List getAllTables(String dbName) throws MetaException; + public abstract List listPartitionNames(String db_name, String tbl_name, short max_parts) throws MetaException; diff --git metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java index e73ee31..6e526ca 100755 --- metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java @@ -18,6 +18,8 @@ package org.apache.hadoop.hive.metastore; +import static org.apache.hadoop.hive.metastore.MetaStoreUtils.DEFAULT_DATABASE_NAME; + import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; @@ -47,8 +49,10 @@ import org.apache.hadoop.hive.metastore.api.MetaException; public class Warehouse { private Path whRoot; private final Configuration conf; - String whRootString; + private final String whRootString; + private static final String DATABASE_WAREHOUSE_SUFFIX = ".db"; + public static final Log LOG = LogFactory.getLog("hive.metastore.warehouse"); public Warehouse(Configuration conf) throws MetaException { @@ -117,10 +121,10 @@ public class Warehouse { } public Path getDefaultDatabasePath(String dbName) throws MetaException { - if (dbName.equalsIgnoreCase(MetaStoreUtils.DEFAULT_DATABASE_NAME)) { + if (dbName.equalsIgnoreCase(DEFAULT_DATABASE_NAME)) { return getWhRoot(); } - return new Path(getWhRoot(), dbName.toLowerCase() + ".db"); + return new Path(getWhRoot(), dbName.toLowerCase() + DATABASE_WAREHOUSE_SUFFIX); } public Path getDefaultTablePath(String dbName, String tableName) diff --git metastore/src/model/org/apache/hadoop/hive/metastore/model/MDatabase.java metastore/src/model/org/apache/hadoop/hive/metastore/model/MDatabase.java index b3e098d..e9c81a5 100644 --- metastore/src/model/org/apache/hadoop/hive/metastore/model/MDatabase.java +++ metastore/src/model/org/apache/hadoop/hive/metastore/model/MDatabase.java @@ -27,6 +27,7 @@ package org.apache.hadoop.hive.metastore.model; */ public class MDatabase { private String name; + private String locationUri; private String description; /** @@ -37,11 +38,13 @@ public class MDatabase { /** * To create a database object * @param name of the database - * @param location future use + * @param locationUri Location of the database in the warehouse + * @param description Comment describing the database */ - public MDatabase(String name, String location) { + public MDatabase(String name, String locationUri, String description) { this.name = name; - this.description = location; + this.locationUri = locationUri; + this.description = description; } /** @@ -59,6 +62,20 @@ public class MDatabase { } /** + * @return the location_uri + */ + public String getLocationUri() { + return locationUri; + } + + /** + * @param locationUri the locationUri to set + */ + public void setLocationUri(String locationUri) { + this.locationUri = locationUri; + } + + /** * @return the description */ public String getDescription() { diff --git metastore/src/model/package.jdo metastore/src/model/package.jdo index 809de13..c075199 100644 --- metastore/src/model/package.jdo +++ metastore/src/model/package.jdo @@ -8,14 +8,17 @@ - + - - - + + + + + + - + diff --git metastore/src/test/org/apache/hadoop/hive/metastore/TestEmbeddedHiveMetaStore.java metastore/src/test/org/apache/hadoop/hive/metastore/TestEmbeddedHiveMetaStore.java new file mode 100644 index 0000000..8558ace --- /dev/null +++ metastore/src/test/org/apache/hadoop/hive/metastore/TestEmbeddedHiveMetaStore.java @@ -0,0 +1,49 @@ +/** + * 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 org.apache.hadoop.util.StringUtils; + +public class TestEmbeddedHiveMetaStore extends TestHiveMetaStore { + + @Override + protected void setUp() throws Exception { + super.setUp(); + + try { + client = new HiveMetaStoreClient(hiveConf, null); + } catch (Throwable e) { + System.err.println("Unable to open the metastore"); + System.err.println(StringUtils.stringifyException(e)); + throw new Exception(e); + } + } + + @Override + protected void tearDown() throws Exception { + try { + super.tearDown(); + client.close(); + } catch (Throwable e) { + System.err.println("Unable to close metastore"); + System.err.println(StringUtils.stringifyException(e)); + throw new Exception(e); + } + } +} diff --git metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java index f02c572..df09811 100644 --- metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java +++ metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java @@ -48,40 +48,25 @@ import org.apache.hadoop.hive.serde.Constants; import org.apache.hadoop.util.StringUtils; import org.apache.thrift.TException; -public class TestHiveMetaStore extends TestCase { - private HiveMetaStoreClient client; - private HiveConf hiveConf; +public abstract class TestHiveMetaStore extends TestCase { + protected static HiveMetaStoreClient client; + protected static HiveConf hiveConf; + protected static Warehouse warehouse; + protected static boolean isThriftClient = false; + + private static final String TEST_DB1_NAME = "testdb1"; + private static final String TEST_DB2_NAME = "testdb2"; @Override protected void setUp() throws Exception { - super.setUp(); hiveConf = new HiveConf(this.getClass()); + warehouse = new Warehouse(hiveConf); // set some values to use for getting conf. vars hiveConf.set("hive.key1", "value1"); hiveConf.set("hive.key2", "http://www.example.com"); hiveConf.set("hive.key3", ""); hiveConf.set("hive.key4", "0"); - - try { - client = new HiveMetaStoreClient(hiveConf, null); - } catch (Throwable e) { - System.err.println("Unable to open the metastore"); - System.err.println(StringUtils.stringifyException(e)); - throw new Exception(e); - } - } - - @Override - protected void tearDown() throws Exception { - try { - super.tearDown(); - client.close(); - } catch (Throwable e) { - System.err.println("Unable to close metastore"); - System.err.println(StringUtils.stringifyException(e)); - throw new Exception(e); - } } public void testNameMethods() { @@ -118,11 +103,11 @@ public class TestHiveMetaStore extends TestCase { * @throws Exception */ public void testPartition() throws Exception { - partitionTester(client, hiveConf, false); + partitionTester(client, hiveConf); } - public static void partitionTester(HiveMetaStoreClient client, HiveConf hiveConf, - boolean isThriftClient) throws Exception { + public static void partitionTester(HiveMetaStoreClient client, HiveConf hiveConf) + throws Exception { try { String dbName = "compdb"; String tblName = "comptbl"; @@ -139,9 +124,10 @@ public class TestHiveMetaStore extends TestCase { vals3.add("15"); client.dropTable(dbName, tblName); - client.dropDatabase(dbName); - boolean ret = client.createDatabase(dbName, "strange_loc"); - assertTrue("Unable to create the databse " + dbName, ret); + silentDropDatabase(dbName); + Database db = new Database(); + db.setName(dbName); + client.createDatabase(db); client.dropType(typeName); Type typ1 = new Type(); @@ -151,8 +137,7 @@ public class TestHiveMetaStore extends TestCase { new FieldSchema("name", Constants.STRING_TYPE_NAME, "")); typ1.getFields().add( new FieldSchema("income", Constants.INT_TYPE_NAME, "")); - ret = client.createType(typ1); - assertTrue("Unable to create type " + typeName, ret); + client.createType(typ1); Table tbl = new Table(); tbl.setDbName(dbName); @@ -181,7 +166,7 @@ public class TestHiveMetaStore extends TestCase { client.createTable(tbl); - if(isThriftClient) { + 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 @@ -303,12 +288,12 @@ public class TestHiveMetaStore extends TestCase { } assertTrue("Bad partition spec should have thrown an exception", exceptionThrown); - FileSystem fs = FileSystem.get(hiveConf); Path partPath = new Path(part2.getSd().getLocation()); + FileSystem fs = FileSystem.get(partPath.toUri(), hiveConf); + assertTrue(fs.exists(partPath)); - ret = client.dropPartition(dbName, tblName, part.getValues(), true); - assertTrue(ret); + client.dropPartition(dbName, tblName, part.getValues(), true); assertFalse(fs.exists(partPath)); // Test append_partition_by_name @@ -326,12 +311,11 @@ public class TestHiveMetaStore extends TestCase { // add the partition again so that drop table with a partition can be // tested retp = client.add_partition(part); - assertNotNull("Unable to create partition " + part, ret); + assertNotNull("Unable to create partition " + part, retp); client.dropTable(dbName, tblName); - ret = client.dropType(typeName); - assertTrue("Unable to drop type " + typeName, ret); + client.dropType(typeName); // recreate table as external, drop partition and it should // still exist @@ -343,8 +327,11 @@ public class TestHiveMetaStore extends TestCase { client.dropPartition(dbName, tblName, part.getValues(), true); assertTrue(fs.exists(partPath)); - ret = client.dropDatabase(dbName); - assertTrue("Unable to create the databse " + dbName, ret); + for (String tableName : client.getTables(dbName, "*")) { + client.dropTable(dbName, tableName); + } + + client.dropDatabase(dbName); } catch (Exception e) { System.err.println(StringUtils.stringifyException(e)); @@ -363,9 +350,11 @@ public class TestHiveMetaStore extends TestCase { vals.add("14"); client.dropTable(dbName, tblName); - client.dropDatabase(dbName); - boolean ret = client.createDatabase(dbName, "strange_loc"); - assertTrue("Unable to create the databse " + dbName, ret); + silentDropDatabase(dbName); + Database db = new Database(); + db.setName(dbName); + db.setDescription("Alter Partition Test database"); + client.createDatabase(db); ArrayList cols = new ArrayList(2); cols.add(new FieldSchema("name", Constants.STRING_TYPE_NAME, "")); @@ -398,6 +387,14 @@ public class TestHiveMetaStore extends TestCase { client.createTable(tbl); + 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); @@ -426,8 +423,7 @@ public class TestHiveMetaStore extends TestCase { client.dropTable(dbName, tblName); - ret = client.dropDatabase(dbName); - assertTrue("Unable to create the databse " + dbName, ret); + client.dropDatabase(dbName); } catch (Exception e) { System.err.println(StringUtils.stringifyException(e)); System.err.println("testPartition() failed."); @@ -438,40 +434,40 @@ public class TestHiveMetaStore extends TestCase { public void testDatabase() throws Throwable { try { // clear up any existing databases - client.dropDatabase("test1"); - client.dropDatabase("test2"); + silentDropDatabase(TEST_DB1_NAME); + silentDropDatabase(TEST_DB2_NAME); - boolean ret = client.createDatabase("test1", "strange_loc"); - assertTrue("Unable to create the databse", ret); + Database db = new Database(); + db.setName(TEST_DB1_NAME); + client.createDatabase(db); - Database db = client.getDatabase("test1"); + db = client.getDatabase(TEST_DB1_NAME); assertEquals("name of returned db is different from that of inserted db", - "test1", db.getName()); - assertEquals( - "location of the returned db is different from that of inserted db", - "strange_loc", db.getDescription()); + TEST_DB1_NAME, db.getName()); + assertEquals("location of the returned db is different from that of inserted db", + warehouse.getDefaultDatabasePath(TEST_DB1_NAME).toString(), db.getLocationUri()); - boolean ret2 = client.createDatabase("test2", "another_strange_loc"); - assertTrue("Unable to create the databse", ret2); + Database db2 = new Database(); + db2.setName(TEST_DB2_NAME); + client.createDatabase(db2); - Database db2 = client.getDatabase("test2"); + db2 = client.getDatabase(TEST_DB2_NAME); assertEquals("name of returned db is different from that of inserted db", - "test2", db2.getName()); - assertEquals( - "location of the returned db is different from that of inserted db", - "another_strange_loc", db2.getDescription()); + TEST_DB2_NAME, db2.getName()); + assertEquals("location of the returned db is different from that of inserted db", + warehouse.getDefaultDatabasePath(TEST_DB2_NAME).toString(), db2.getLocationUri()); - List dbs = client.getDatabases(); + List dbs = client.getDatabases(".*"); - assertTrue("first database is not test1", dbs.contains("test1")); - assertTrue("second database is not test2", dbs.contains("test2")); + assertTrue("first database is not " + TEST_DB1_NAME, dbs.contains(TEST_DB1_NAME)); + assertTrue("second database is not " + TEST_DB2_NAME, dbs.contains(TEST_DB2_NAME)); - ret = client.dropDatabase("test1"); - assertTrue("couldn't delete first database", ret); - ret = client.dropDatabase("test2"); - assertTrue("couldn't delete second database", ret); + client.dropDatabase(TEST_DB1_NAME); + client.dropDatabase(TEST_DB2_NAME); + silentDropDatabase(TEST_DB1_NAME); + silentDropDatabase(TEST_DB2_NAME); } catch (Throwable e) { System.err.println(StringUtils.stringifyException(e)); System.err.println("testDatabase() failed."); @@ -495,9 +491,13 @@ public class TestHiveMetaStore extends TestCase { ret = client.dropType(Constants.INT_TYPE_NAME); assertTrue("unable to drop type integer", ret); - Type typ1_3 = null; - typ1_3 = client.getType(Constants.INT_TYPE_NAME); - assertNull("unable to drop type integer", typ1_3); + boolean exceptionThrown = false; + try { + client.getType(Constants.INT_TYPE_NAME); + } catch (NoSuchObjectException e) { + exceptionThrown = true; + } + assertTrue("Expected NoSuchObjectException", exceptionThrown); } catch (Exception e) { System.err.println(StringUtils.stringifyException(e)); System.err.println("testSimpleTypeApi() failed."); @@ -554,9 +554,13 @@ public class TestHiveMetaStore extends TestCase { ret = client.dropType("Person"); assertTrue("unable to drop type Person", ret); - Type typ1_3 = null; - typ1_3 = client.getType("Person"); - assertNull("unable to drop type Person", typ1_3); + boolean exceptionThrown = false; + try { + client.getType("Person"); + } catch (NoSuchObjectException e) { + exceptionThrown = true; + } + assertTrue("Expected NoSuchObjectException", exceptionThrown); } catch (Exception e) { System.err.println(StringUtils.stringifyException(e)); System.err.println("testComplexTypeApi() failed."); @@ -572,9 +576,11 @@ public class TestHiveMetaStore extends TestCase { String typeName = "Person"; client.dropTable(dbName, tblName); - client.dropDatabase(dbName); - boolean ret = client.createDatabase(dbName, "strange_loc"); - assertTrue("Unable to create the databse " + dbName, ret); + silentDropDatabase(dbName); + + Database db = new Database(); + db.setName(dbName); + client.createDatabase(db); client.dropType(typeName); Type typ1 = new Type(); @@ -584,8 +590,7 @@ public class TestHiveMetaStore extends TestCase { new FieldSchema("name", Constants.STRING_TYPE_NAME, "")); typ1.getFields().add( new FieldSchema("income", Constants.INT_TYPE_NAME, "")); - ret = client.createType(typ1); - assertTrue("Unable to create type " + typeName, ret); + client.createType(typ1); Table tbl = new Table(); tbl.setDbName(dbName); @@ -610,6 +615,14 @@ public class TestHiveMetaStore extends TestCase { client.createTable(tbl); + 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); + } + Table tbl2 = client.getTable(dbName, tblName); assertNotNull(tbl2); assertEquals(tbl2.getDbName(), dbName); @@ -647,6 +660,9 @@ public class TestHiveMetaStore extends TestCase { } client.createTable(tbl2); + if (isThriftClient) { + tbl2 = client.getTable(tbl2.getDbName(), tbl2.getTableName()); + } Table tbl3 = client.getTable(dbName, tblName2); assertNotNull(tbl3); @@ -683,17 +699,15 @@ public class TestHiveMetaStore extends TestCase { (tbl2.getPartitionKeys() == null) || (tbl2.getPartitionKeys().size() == 0)); - FileSystem fs = FileSystem.get(hiveConf); + FileSystem fs = FileSystem.get((new Path(tbl.getSd().getLocation())).toUri(), hiveConf); client.dropTable(dbName, tblName); assertFalse(fs.exists(new Path(tbl.getSd().getLocation()))); client.dropTable(dbName, tblName2); assertTrue(fs.exists(new Path(tbl2.getSd().getLocation()))); - ret = client.dropType(typeName); - assertTrue("Unable to drop type " + typeName, ret); - ret = client.dropDatabase(dbName); - assertTrue("Unable to drop databse " + dbName, ret); + client.dropType(typeName); + client.dropDatabase(dbName); } catch (Exception e) { System.err.println(StringUtils.stringifyException(e)); System.err.println("testSimpleTable() failed."); @@ -702,15 +716,17 @@ public class TestHiveMetaStore extends TestCase { } public void testAlterTable() throws Exception { - try { - String dbName = "alterdb"; - String invTblName = "alter-tbl"; - String tblName = "altertbl"; + String dbName = "alterdb"; + String invTblName = "alter-tbl"; + String tblName = "altertbl"; + try { client.dropTable(dbName, tblName); - client.dropDatabase(dbName); - boolean ret = client.createDatabase(dbName, "strange_loc"); - assertTrue("Unable to create the databse " + dbName, ret); + silentDropDatabase(dbName); + + Database db = new Database(); + db.setName(dbName); + client.createDatabase(db); ArrayList invCols = new ArrayList(2); invCols.add(new FieldSchema("n-ame", Constants.STRING_TYPE_NAME, "")); @@ -752,6 +768,10 @@ public class TestHiveMetaStore extends TestCase { tbl.getSd().setCols(cols); client.createTable(tbl); + if (isThriftClient) { + tbl = client.getTable(tbl.getDbName(), tbl.getTableName()); + } + // now try to invalid alter table Table tbl2 = client.getTable(dbName, tblName); failed = false; @@ -775,17 +795,22 @@ public class TestHiveMetaStore extends TestCase { assertEquals("Alter table didn't succeed. Num buckets is different ", tbl2.getSd().getNumBuckets(), tbl3.getSd().getNumBuckets()); // check that data has moved - FileSystem fs = FileSystem.get(hiveConf); + FileSystem fs = FileSystem.get((new Path(tbl.getSd().getLocation())).toUri(), hiveConf); assertFalse("old table location still exists", fs.exists(new Path(tbl .getSd().getLocation()))); assertTrue("data did not move to new location", fs.exists(new Path(tbl3 .getSd().getLocation()))); - assertEquals("alter table didn't move data correct location", tbl3 - .getSd().getLocation(), tbl2.getSd().getLocation()); + + if (!isThriftClient) { + assertEquals("alter table didn't move data correct location", tbl3 + .getSd().getLocation(), tbl2.getSd().getLocation()); + } } catch (Exception e) { System.err.println(StringUtils.stringifyException(e)); System.err.println("testSimpleTable() failed."); throw e; + } finally { + silentDropDatabase(dbName); } } @@ -797,9 +822,10 @@ public class TestHiveMetaStore extends TestCase { try { client.dropTable(dbName, tblName); - client.dropDatabase(dbName); - boolean ret = client.createDatabase(dbName, "strange_loc"); - assertTrue("Unable to create the databse " + dbName, ret); + silentDropDatabase(dbName); + Database db = new Database(); + db.setName(dbName); + client.createDatabase(db); client.dropType(typeName); Type typ1 = new Type(); @@ -809,8 +835,7 @@ public class TestHiveMetaStore extends TestCase { new FieldSchema("name", Constants.STRING_TYPE_NAME, "")); typ1.getFields().add( new FieldSchema("income", Constants.INT_TYPE_NAME, "")); - ret = client.createType(typ1); - assertTrue("Unable to create type " + typeName, ret); + client.createType(typ1); Table tbl = new Table(); tbl.setDbName(dbName); @@ -887,8 +912,7 @@ public class TestHiveMetaStore extends TestCase { client.dropTable(dbName, tblName); boolean ret = client.dropType(typeName); assertTrue("Unable to drop type " + typeName, ret); - ret = client.dropDatabase(dbName); - assertTrue("Unable to create the databse " + dbName, ret); + client.dropDatabase(dbName); } } @@ -896,20 +920,21 @@ public class TestHiveMetaStore extends TestCase { String val = "value"; - try { - assertEquals(client.getConfigValue("hive.key1", val), "value1"); - assertEquals(client.getConfigValue("hive.key2", val), - "http://www.example.com"); - assertEquals(client.getConfigValue("hive.key3", val), ""); - assertEquals(client.getConfigValue("hive.key4", val), "0"); - assertEquals(client.getConfigValue("hive.key5", val), val); - assertEquals(client.getConfigValue(null, val), val); - } catch (TException e) { - e.printStackTrace(); - assert (false); - } catch (ConfigValSecurityException e) { - e.printStackTrace(); - assert (false); + if (!isThriftClient) { + try { + assertEquals(client.getConfigValue("hive.key1", val), "value1"); + assertEquals(client.getConfigValue("hive.key2", val), "http://www.example.com"); + assertEquals(client.getConfigValue("hive.key3", val), ""); + assertEquals(client.getConfigValue("hive.key4", val), "0"); + assertEquals(client.getConfigValue("hive.key5", val), val); + assertEquals(client.getConfigValue(null, val), val); + } catch (TException e) { + e.printStackTrace(); + assert (false); + } catch (ConfigValSecurityException e) { + e.printStackTrace(); + assert (false); + } } boolean threwException = false; @@ -932,4 +957,15 @@ public class TestHiveMetaStore extends TestCase { part.setCreateTime(part_get.getCreateTime()); part.putToParameters(org.apache.hadoop.hive.metastore.api.Constants.DDL_TIME, Long.toString(part_get.getCreateTime())); } + + private static void silentDropDatabase(String dbName) throws MetaException, TException { + try { + for (String tableName : client.getTables(dbName, "*")) { + client.dropTable(dbName, tableName); + } + client.dropDatabase(dbName); + } catch (NoSuchObjectException e) { + } catch (InvalidOperationException e) { + } + } } diff --git metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStoreRemote.java metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStoreRemote.java deleted file mode 100644 index bc950b9..0000000 --- metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStoreRemote.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * 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 junit.framework.TestCase; - -import org.apache.hadoop.hive.conf.HiveConf; - - -public class TestHiveMetaStoreRemote extends TestCase { - private static final String METASTORE_PORT = "29083"; -private HiveMetaStoreClient client; - private HiveConf hiveConf; - boolean isServerRunning = false; - - private static class RunMS implements Runnable { - - @Override - public void run() { - System.out.println("Running metastore!"); - String [] args = new String [1]; - args[0] = METASTORE_PORT; - HiveMetaStore.main(args); - } - - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - if(isServerRunning) { - return; - } - Thread t = new Thread(new RunMS()); - t.start(); - - // Wait a little bit for the metastore to start. Should probably have - // a better way of detecting if the metastore has started? - Thread.sleep(5000); - - // Set conf to connect to the local metastore. - hiveConf = new HiveConf(this.getClass()); - // hive.metastore.local should be defined in HiveConf - hiveConf.set("hive.metastore.local", "false"); - hiveConf.setVar(HiveConf.ConfVars.METASTOREURIS, "thrift://localhost:" + METASTORE_PORT); - hiveConf.setIntVar(HiveConf.ConfVars.METATORETHRIFTRETRIES, 3); - - client = new HiveMetaStoreClient(hiveConf); - // Now you have the client - run necessary tests. - isServerRunning = true; - } - - /** - * tests create table and partition and tries to drop the table without - * droppping the partition - * - * @throws Exception - */ - public void testPartition() throws Exception { - TestHiveMetaStore.partitionTester(client, hiveConf, true); - } - -} diff --git metastore/src/test/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStore.java metastore/src/test/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStore.java new file mode 100644 index 0000000..57648b6 --- /dev/null +++ metastore/src/test/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStore.java @@ -0,0 +1,65 @@ +/** + * 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 org.apache.hadoop.hive.conf.HiveConf; + + +public class TestRemoteHiveMetaStore extends TestHiveMetaStore { + private static final String METASTORE_PORT = "29083"; + private static boolean isServerRunning = false; + + private static class RunMS implements Runnable { + + @Override + public void run() { + System.out.println("Running metastore!"); + String [] args = new String [1]; + args[0] = METASTORE_PORT; + HiveMetaStore.main(args); + } + + } + + @Override + protected void setUp() throws Exception { + super.setUp(); + if(isServerRunning) { + return; + } + Thread t = new Thread(new RunMS()); + t.start(); + + // Wait a little bit for the metastore to start. Should probably have + // a better way of detecting if the metastore has started? + Thread.sleep(5000); + + // hive.metastore.local should be defined in HiveConf + hiveConf.set("hive.metastore.local", "false"); + hiveConf.setVar(HiveConf.ConfVars.METASTOREURIS, "thrift://localhost:" + METASTORE_PORT); + hiveConf.setIntVar(HiveConf.ConfVars.METATORETHRIFTRETRIES, 3); + + client = new HiveMetaStoreClient(hiveConf); + isThriftClient = true; + + // Now you have the client - run necessary tests. + isServerRunning = true; + } + +} diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java index 4a6c301..bcca905 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java @@ -52,9 +52,12 @@ import org.apache.hadoop.hive.conf.HiveConf.ConfVars; import org.apache.hadoop.hive.metastore.MetaStoreUtils; import org.apache.hadoop.hive.metastore.TableType; import org.apache.hadoop.hive.metastore.Warehouse; +import org.apache.hadoop.hive.metastore.api.AlreadyExistsException; +import org.apache.hadoop.hive.metastore.api.Database; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.InvalidOperationException; import org.apache.hadoop.hive.metastore.api.MetaException; +import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.Order; import org.apache.hadoop.hive.ql.DriverContext; import org.apache.hadoop.hive.ql.QueryPlan; @@ -71,18 +74,22 @@ import org.apache.hadoop.hive.ql.metadata.Table; import org.apache.hadoop.hive.ql.plan.AddPartitionDesc; import org.apache.hadoop.hive.ql.plan.AlterTableDesc; import org.apache.hadoop.hive.ql.plan.AlterTableSimpleDesc; +import org.apache.hadoop.hive.ql.plan.CreateDatabaseDesc; import org.apache.hadoop.hive.ql.plan.CreateTableDesc; import org.apache.hadoop.hive.ql.plan.CreateTableLikeDesc; import org.apache.hadoop.hive.ql.plan.CreateViewDesc; import org.apache.hadoop.hive.ql.plan.DDLWork; import org.apache.hadoop.hive.ql.plan.DescFunctionDesc; import org.apache.hadoop.hive.ql.plan.DescTableDesc; +import org.apache.hadoop.hive.ql.plan.DropDatabaseDesc; import org.apache.hadoop.hive.ql.plan.DropTableDesc; import org.apache.hadoop.hive.ql.plan.MsckDesc; +import org.apache.hadoop.hive.ql.plan.ShowDatabasesDesc; import org.apache.hadoop.hive.ql.plan.ShowFunctionsDesc; import org.apache.hadoop.hive.ql.plan.ShowPartitionsDesc; import org.apache.hadoop.hive.ql.plan.ShowTableStatusDesc; import org.apache.hadoop.hive.ql.plan.ShowTablesDesc; +import org.apache.hadoop.hive.ql.plan.SwitchDatabaseDesc; import org.apache.hadoop.hive.ql.plan.AlterTableDesc.AlterTableTypes; import org.apache.hadoop.hive.ql.plan.api.StageType; import org.apache.hadoop.hive.serde.Constants; @@ -139,6 +146,21 @@ public class DDLTask extends Task implements Serializable { try { db = Hive.get(conf); + CreateDatabaseDesc createDatabaseDesc = work.getCreateDatabaseDesc(); + if (null != createDatabaseDesc) { + return createDatabase(db, createDatabaseDesc); + } + + DropDatabaseDesc dropDatabaseDesc = work.getDropDatabaseDesc(); + if (dropDatabaseDesc != null) { + return dropDatabase(db, dropDatabaseDesc); + } + + SwitchDatabaseDesc switchDatabaseDesc = work.getSwitchDatabaseDesc(); + if (switchDatabaseDesc != null) { + return switchDatabase(db, switchDatabaseDesc); + } + CreateTableDesc crtTbl = work.getCreateTblDesc(); if (crtTbl != null) { return createTable(db, crtTbl); @@ -195,6 +217,11 @@ public class DDLTask extends Task implements Serializable { return describeFunction(descFunc); } + ShowDatabasesDesc showDatabases = work.getShowDatabasesDesc(); + if (showDatabases != null) { + return showDatabases(db, showDatabases); + } + ShowTablesDesc showTbls = work.getShowTblsDesc(); if (showTbls != null) { return showTables(db, showTbls); @@ -843,11 +870,10 @@ public class DDLTask extends Task implements Serializable { List repairOutput = new ArrayList(); try { HiveMetaStoreChecker checker = new HiveMetaStoreChecker(db); - checker.checkMetastore(MetaStoreUtils.DEFAULT_DATABASE_NAME, msckDesc + checker.checkMetastore(db.getCurrentDatabase(), msckDesc .getTableName(), msckDesc.getPartSpecs(), result); if (msckDesc.isRepairPartitions()) { - Table table = db.getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, - msckDesc.getTableName()); + Table table = db.getTable(msckDesc.getTableName()); for (CheckResult.PartitionResult part : result.getPartitionsNotInMs()) { try { db.createPartition(table, Warehouse.makeSpecFromName(part @@ -959,18 +985,17 @@ public class DDLTask extends Task implements Serializable { Table tbl = null; List parts = null; - tbl = db.getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tabName); + tbl = db.getTable(tabName); if (!tbl.isPartitioned()) { console.printError("Table " + tabName + " is not a partitioned table"); return 1; } if (showParts.getPartSpec() != null) { - parts = db.getPartitionNames(MetaStoreUtils.DEFAULT_DATABASE_NAME, + parts = db.getPartitionNames(db.getCurrentDatabase(), tbl.getTableName(), showParts.getPartSpec(), (short) -1); } else { - parts = db.getPartitionNames(MetaStoreUtils.DEFAULT_DATABASE_NAME, tbl - .getTableName(), (short) -1); + parts = db.getPartitionNames(db.getCurrentDatabase(), tbl.getTableName(), (short) -1); } // write the results in the file @@ -1000,6 +1025,50 @@ public class DDLTask extends Task implements Serializable { } /** + * Write a list of the available databases to a file. + * + * @param showDatabases + * These are the databases we're interested in. + * @return Returns 0 when execution succeeds and above 0 if it fails. + * @throws HiveException + * Throws this exception if an unexpected error occurs. + */ + private int showDatabases(Hive db, ShowDatabasesDesc showDatabasesDesc) throws HiveException { + // get the databases for the desired pattern - populate the output stream + List databases = null; + if (showDatabasesDesc.getPattern() != null) { + LOG.info("pattern: " + showDatabasesDesc.getPattern()); + databases = db.getDatabasesByPattern(showDatabasesDesc.getPattern()); + } else { + databases = db.getAllDatabases(); + } + LOG.info("results : " + databases.size()); + + // write the results in the file + try { + Path resFile = new Path(showDatabasesDesc.getResFile()); + FileSystem fs = resFile.getFileSystem(conf); + DataOutput outStream = fs.create(resFile); + + for (String database : databases) { + // create a row per database name + outStream.writeBytes(database); + outStream.write(terminator); + } + ((FSDataOutputStream) outStream).close(); + } catch (FileNotFoundException e) { + LOG.warn("show databases: " + stringifyException(e)); + return 1; + } catch (IOException e) { + LOG.warn("show databases: " + stringifyException(e)); + return 1; + } catch (Exception e) { + throw new HiveException(e.toString()); + } + return 0; + } + + /** * Write a list of the tables in the database to a file. * * @param db @@ -1294,7 +1363,7 @@ public class DDLTask extends Task implements Serializable { colPath.indexOf('.') == -1 ? colPath.length() : colPath.indexOf('.')); // describe the table - populate the output stream - Table tbl = db.getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tableName, + Table tbl = db.getTable(db.getCurrentDatabase(), tableName, false); Partition part = null; try { @@ -1546,8 +1615,7 @@ public class DDLTask extends Task implements Serializable { */ private int alterTable(Hive db, AlterTableDesc alterTbl) throws HiveException { // alter the table - Table tbl = db.getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, alterTbl - .getOldName()); + Table tbl = db.getTable(alterTbl.getOldName()); validateAlterTableType(tbl, alterTbl.getOp()); @@ -1767,8 +1835,7 @@ public class DDLTask extends Task implements Serializable { // post-execution hook Table tbl = null; try { - tbl = db.getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, dropTbl - .getTableName()); + tbl = db.getTable(dropTbl.getTableName()); } catch (InvalidTableException e) { // drop table is idempotent } @@ -1787,17 +1854,14 @@ public class DDLTask extends Task implements Serializable { if (dropTbl.getPartSpecs() == null) { // drop the table - db - .dropTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, dropTbl - .getTableName()); + db.dropTable(db.getCurrentDatabase(), dropTbl.getTableName()); if (tbl != null) { work.getOutputs().add(new WriteEntity(tbl)); } } else { // get all partitions of the table - List partitionNames = db.getPartitionNames( - MetaStoreUtils.DEFAULT_DATABASE_NAME, dropTbl.getTableName(), - (short) -1); + List partitionNames = + db.getPartitionNames(db.getCurrentDatabase(), dropTbl.getTableName(), (short) -1); Set> partitions = new HashSet>(); for (int i = 0; i < partitionNames.size(); i++) { try { @@ -1831,7 +1895,7 @@ public class DDLTask extends Task implements Serializable { // drop all existing partitions from the list for (Partition partition : partsToDelete) { console.printInfo("Dropping the partition " + partition.getName()); - db.dropPartition(MetaStoreUtils.DEFAULT_DATABASE_NAME, dropTbl + db.dropPartition(db.getCurrentDatabase(), dropTbl .getTableName(), partition.getValues(), true); // drop data for the // partition work.getOutputs().add(new WriteEntity(partition)); @@ -1856,6 +1920,56 @@ public class DDLTask extends Task implements Serializable { } /** + * Create a Database + * @param db + * @param crtDb + * @return Always returns 0 + * @throws HiveException + * @throws AlreadyExistsException + */ + private int createDatabase(Hive db, CreateDatabaseDesc crtDb) + throws HiveException, AlreadyExistsException { + Database database = new Database(); + database.setName(crtDb.getName()); + database.setDescription(crtDb.getComment()); + database.setLocationUri(crtDb.getLocationUri()); + + db.createDatabase(database, crtDb.getIfNotExists()); + return 0; + } + + /** + * Drop a Database + * @param db + * @param dropDb + * @return Always returns 0 + * @throws HiveException + * @throws NoSuchObjectException + */ + private int dropDatabase(Hive db, DropDatabaseDesc dropDb) + throws HiveException, NoSuchObjectException { + db.dropDatabase(dropDb.getDatabaseName(), true, dropDb.getIfExists()); + return 0; + } + + /** + * Switch to a different Database + * @param db + * @param switchDb + * @return Always returns 0 + * @throws HiveException + */ + private int switchDatabase(Hive db, SwitchDatabaseDesc switchDb) + throws HiveException { + String dbName = switchDb.getDatabaseName(); + if (!db.databaseExists(dbName)) { + throw new HiveException("ERROR: The database " + dbName + " does not exist."); + } + db.setCurrentDatabase(dbName); + return 0; + } + + /** * Create a new table. * * @param db @@ -1868,7 +1982,7 @@ public class DDLTask extends Task implements Serializable { */ private int createTable(Hive db, CreateTableDesc crtTbl) throws HiveException { // create the table - Table tbl = new Table(crtTbl.getTableName()); + Table tbl = new Table(db.getCurrentDatabase(), crtTbl.getTableName()); if (crtTbl.getPartCols() != null) { tbl.setPartCols(crtTbl.getPartCols()); } @@ -2027,8 +2141,7 @@ public class DDLTask extends Task implements Serializable { */ private int createTableLike(Hive db, CreateTableLikeDesc crtTbl) throws HiveException { // Get the existing table - Table tbl = db.getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, crtTbl - .getLikeTableName()); + Table tbl = db.getTable(crtTbl.getLikeTableName()); tbl.setTableName(crtTbl.getTableName()); @@ -2062,7 +2175,7 @@ public class DDLTask extends Task implements Serializable { * Throws this exception if an unexpected error occurs. */ private int createView(Hive db, CreateViewDesc crtView) throws HiveException { - Table tbl = new Table(crtView.getViewName()); + Table tbl = new Table(db.getCurrentDatabase(), crtView.getViewName()); tbl.setTableType(TableType.VIRTUAL_VIEW); tbl.setSerializationLib(null); tbl.clearSerDeInfo(); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java index ddf6bdc..0bb42fa 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java @@ -32,7 +32,6 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.metastore.MetaStoreUtils; import org.apache.hadoop.hive.ql.hooks.LineageInfo.DataContainer; import org.apache.hadoop.hive.ql.hooks.WriteEntity; import org.apache.hadoop.hive.ql.io.HiveFileFormatUtils; @@ -131,7 +130,7 @@ public class MoveTask extends Task implements Serializable { } String mesg_detail = " from " + tbd.getSourceDir(); console.printInfo(mesg.toString(), mesg_detail); - Table table = db.getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tbd + Table table = db.getTable(db.getCurrentDatabase(), tbd .getTable().getTableName()); if (work.getCheckFileFormat()) { diff --git ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java index b996a9d..3ffae03 100644 --- ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java +++ ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java @@ -18,6 +18,16 @@ package org.apache.hadoop.hive.ql.metadata; +import static org.apache.hadoop.hive.metastore.MetaStoreUtils.DEFAULT_DATABASE_NAME; +import static org.apache.hadoop.hive.metastore.api.Constants.META_TABLE_STORAGE; +import static org.apache.hadoop.hive.serde.Constants.COLLECTION_DELIM; +import static org.apache.hadoop.hive.serde.Constants.ESCAPE_CHAR; +import static org.apache.hadoop.hive.serde.Constants.FIELD_DELIM; +import static org.apache.hadoop.hive.serde.Constants.LINE_DELIM; +import static org.apache.hadoop.hive.serde.Constants.MAPKEY_DELIM; +import static org.apache.hadoop.hive.serde.Constants.SERIALIZATION_FORMAT; +import static org.apache.hadoop.hive.serde.Constants.STRING_TYPE_NAME; + import java.io.IOException; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -39,7 +49,7 @@ import org.apache.hadoop.hive.metastore.MetaStoreUtils; import org.apache.hadoop.hive.metastore.TableType; import org.apache.hadoop.hive.metastore.Warehouse; import org.apache.hadoop.hive.metastore.api.AlreadyExistsException; -import org.apache.hadoop.hive.metastore.api.Constants; +import org.apache.hadoop.hive.metastore.api.Database; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.InvalidOperationException; import org.apache.hadoop.hive.metastore.api.MetaException; @@ -65,6 +75,7 @@ public class Hive { private HiveConf conf = null; private IMetaStoreClient metaStoreClient; + private String currentDatabase; private static ThreadLocal hiveDB = new ThreadLocal() { @Override @@ -165,6 +176,68 @@ public class Hive { } /** + * Create a database + * @param db + * @param ifNotExist if true, will ignore AlreadyExistsException exception + * @throws AlreadyExistsException + * @throws HiveException + */ + public void createDatabase(Database db, boolean ifNotExist) + throws AlreadyExistsException, HiveException { + try { + getMSC().createDatabase(db); + } catch (AlreadyExistsException e) { + if (!ifNotExist) { + throw e; + } + } catch (Exception e) { + throw new HiveException(e); + } + } + + /** + * Create a Database. Raise an error if a database with the same name already exists. + * @param db + * @throws AlreadyExistsException + * @throws HiveException + */ + public void createDatabase(Database db) throws AlreadyExistsException, HiveException { + createDatabase(db, false); + } + + /** + * Drop a database. + * @param name + * @throws NoSuchObjectException + * @throws HiveException + * @see org.apache.hadoop.hive.metastore.HiveMetaStoreClient#dropDatabase(java.lang.String) + */ + public void dropDatabase(String name) throws HiveException, NoSuchObjectException { + dropDatabase(name, true, false); + } + + + /** + * Drop a database + * @param name + * @param deleteData + * @param ignoreUnknownDb if true, will ignore NoSuchObjectException + * @return + * @throws HiveException + * @throws NoSuchObjectException + */ + public void dropDatabase(String name, boolean deleteData, boolean ignoreUnknownDb) + throws HiveException, NoSuchObjectException { + try { + getMSC().dropDatabase(name, deleteData, ignoreUnknownDb); + } catch (NoSuchObjectException e) { + throw e; + } catch (Exception e) { + throw new HiveException(e); + } + } + + /** * Creates a table metdata and the directory for the table data * * @param tableName @@ -216,13 +289,12 @@ public class Hive { throw new HiveException("columns not specified for table " + tableName); } - Table tbl = new Table(tableName); + Table tbl = new Table(getCurrentDatabase(), tableName); tbl.setInputFormatClass(fileInputFormat.getName()); tbl.setOutputFormatClass(fileOutputFormat.getName()); for (String col : columns) { - FieldSchema field = new FieldSchema(col, - org.apache.hadoop.hive.serde.Constants.STRING_TYPE_NAME, "default"); + FieldSchema field = new FieldSchema(col, STRING_TYPE_NAME, "default"); tbl.getCols().add(field); } @@ -230,7 +302,7 @@ public class Hive { for (String partCol : partCols) { FieldSchema part = new FieldSchema(); part.setName(partCol); - part.setType(org.apache.hadoop.hive.serde.Constants.STRING_TYPE_NAME); // default + part.setType(STRING_TYPE_NAME); // default // partition // key tbl.getPartCols().add(part); @@ -256,7 +328,7 @@ public class Hive { public void alterTable(String tblName, Table newTbl) throws InvalidOperationException, HiveException { try { - getMSC().alter_table(MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, + getMSC().alter_table(getCurrentDatabase(), tblName, newTbl.getTTable()); } catch (MetaException e) { throw new HiveException("Unable to alter table.", e); @@ -279,7 +351,7 @@ public class Hive { public void alterPartition(String tblName, Partition newPart) throws InvalidOperationException, HiveException { try { - getMSC().alter_partition(MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, + getMSC().alter_partition(getCurrentDatabase(), tblName, newPart.getTPartition()); } catch (MetaException e) { @@ -311,6 +383,9 @@ public class Hive { */ public void createTable(Table tbl, boolean ifNotExists) throws HiveException { try { + if (tbl.getDbName() == null || "".equals(tbl.getDbName().trim())) { + tbl.setDbName(getCurrentDatabase()); + } if (tbl.getCols().size() == 0) { tbl.setFields(MetaStoreUtils.getFieldsFromDeserializer(tbl.getTableName(), tbl.getDeserializer())); @@ -337,6 +412,26 @@ public class Hive { * @throws HiveException * thrown if the drop fails */ + public void dropTable(String tableName) throws HiveException { + dropTable(getCurrentDatabase(), tableName, true, true); + } + + /** + * Drops table along with the data in it. If the table doesn't exist + * then it is a no-op + * @param dbName database where the table lives + * @param tableName table to drop + * @throws HiveException thrown if the drop fails + * Drops table along with the data in it. If the table doesn't exist then it + * is a no-op + * + * @param dbName + * database where the table lives + * @param tableName + * table to drop + * @throws HiveException + * thrown if the drop fails + */ public void dropTable(String dbName, String tableName) throws HiveException { dropTable(dbName, tableName, true, true); } @@ -370,7 +465,18 @@ public class Hive { } /** - * Returns metadata of the table. + * Returns metadata for the table named tableName in the current database. + * @param tableName the name of the table + * @return + * @throws HiveException if there's an internal error or if the + * table doesn't exist + */ + public Table getTable(final String tableName) throws HiveException { + return this.getTable(getCurrentDatabase(), tableName, true); + } + + /** + * Returns metadata of the table * * @param dbName * the name of the database @@ -380,12 +486,10 @@ public class Hive { * @exception HiveException * if there's an internal error or if the table doesn't exist */ - public Table getTable(final String dbName, final String tableName) - throws HiveException { - + public Table getTable(final String dbName, final String tableName) throws HiveException { return this.getTable(dbName, tableName, true); } - + /** * Returns metadata of the table * @@ -423,11 +527,11 @@ public class Hive { if (!TableType.VIRTUAL_VIEW.toString().equals(tTable.getTableType())) { // Fix the non-printable chars Map parameters = tTable.getSd().getParameters(); - String sf = parameters.get(org.apache.hadoop.hive.serde.Constants.SERIALIZATION_FORMAT); + String sf = parameters.get(SERIALIZATION_FORMAT); if (sf != null) { char[] b = sf.toCharArray(); if ((b.length == 1) && (b[0] < 10)) { // ^A, ^B, ^C, ^D, \t - parameters.put(org.apache.hadoop.hive.serde.Constants.SERIALIZATION_FORMAT, + parameters.put(SERIALIZATION_FORMAT, Integer.toString(b[0])); } } @@ -454,12 +558,27 @@ public class Hive { return table; } + /** + * Get all table names for the current database. + * @return List of table names + * @throws HiveException + */ public List getAllTables() throws HiveException { - return getTablesByPattern(".*"); + return getAllTables(getCurrentDatabase()); } /** - * returns all existing tables from default database which match the given + * Get all table names for the specified database. + * @param dbName + * @return List of table names + * @throws HiveException + */ + public List getAllTables(String dbName) throws HiveException { + return getTablesByPattern(dbName, ".*"); + } + + /** + * Returns all existing tables from default database which match the given * pattern. The matching occurs as per Java regular expressions * * @param tablePattern @@ -467,13 +586,28 @@ public class Hive { * @return list of table names * @throws HiveException */ - public List getTablesByPattern(String tablePattern) - throws HiveException { - return getTablesForDb(MetaStoreUtils.DEFAULT_DATABASE_NAME, tablePattern); + public List getTablesByPattern(String tablePattern) throws HiveException { + return getTablesByPattern(getCurrentDatabase(), tablePattern); + } + + /** + * Returns all existing tables from the specified database which match the given + * pattern. The matching occurs as per Java regular expressions. + * @param dbName + * @param tablePattern + * @return list of table names + * @throws HiveException + */ + public List getTablesByPattern(String dbName, String tablePattern) throws HiveException { + try { + return getMSC().getTables(dbName, tablePattern); + } catch (Exception e) { + throw new HiveException(e); + } } /** - * returns all existing tables from the given database which match the given + * Returns all existing tables from the given database which match the given * pattern. The matching occurs as per Java regular expressions * * @param database @@ -493,29 +627,55 @@ public class Hive { } /** - * @param name - * @param locationUri - * @return true or false - * @throws AlreadyExistsException - * @throws MetaException - * @throws TException - * @see org.apache.hadoop.hive.metastore.HiveMetaStoreClient#createDatabase(java.lang.String, - * java.lang.String) + * Get all existing database names. + * + * @return List of database names. + * @throws HiveException */ - protected boolean createDatabase(String name, String locationUri) - throws AlreadyExistsException, MetaException, TException { - return getMSC().createDatabase(name, locationUri); + public List getAllDatabases() throws HiveException { + try { + return getMSC().getAllDatabases(); + } catch (Exception e) { + throw new HiveException(e); + } } /** - * @param name - * @return true or false - * @throws MetaException - * @throws TException - * @see org.apache.hadoop.hive.metastore.HiveMetaStoreClient#dropDatabase(java.lang.String) + * Get all existing databases that match the given + * pattern. The matching occurs as per Java regular expressions + * + * @param databasePattern + * java re pattern + * @return list of database names + * @throws HiveException + */ + public List getDatabasesByPattern(String databasePattern) throws HiveException { + try { + return getMSC().getDatabases(databasePattern); + } catch (Exception e) { + throw new HiveException(e); + } + } + + /** + * Query metadata to see if a database with the given name already exists. + * + * @param dbName + * @return true if a database with the given name already exists, false if + * does not exist. + * @throws HiveException */ - protected boolean dropDatabase(String name) throws MetaException, TException { - return getMSC().dropDatabase(name); + public boolean databaseExists(String dbName) throws HiveException { + try { + if (null != getMSC().getDatabase(dbName)) { + return true; + } + return false; + } catch (NoSuchObjectException e) { + return false; + } catch (Exception e) { + throw new HiveException(e); + } } /** @@ -539,7 +699,7 @@ public class Hive { public void loadPartition(Path loadPath, String tableName, Map partSpec, boolean replace, Path tmpDirPath) throws HiveException { - Table tbl = getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tableName); + Table tbl = getTable(tableName); try { /** * Move files before creating the partition since down stream processes @@ -662,7 +822,7 @@ public class Hive { */ public void loadTable(Path loadPath, String tableName, boolean replace, Path tmpDirPath) throws HiveException { - Table tbl = getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tableName); + Table tbl = getTable(tableName); if (replace) { tbl.replaceFiles(loadPath, tmpDirPath); @@ -911,6 +1071,25 @@ public class Hive { return qlPartitions; } + /** + * Get the name of the current database + * @return + */ + public String getCurrentDatabase() { + if (null == currentDatabase) { + currentDatabase = DEFAULT_DATABASE_NAME; + } + return currentDatabase; + } + + /** + * Set the name of the current database + * @param currentDatabase + */ + public void setCurrentDatabase(String currentDatabase) { + this.currentDatabase = currentDatabase; + } + static private void checkPaths(FileSystem fs, FileStatus[] srcs, Path destf, boolean replace) throws HiveException { try { @@ -1075,7 +1254,7 @@ public class Hive { HiveStorageHandler storageHandler = HiveUtils.getStorageHandler( conf, - tbl.getParameters().get(Constants.META_TABLE_STORAGE)); + tbl.getParameters().get(META_TABLE_STORAGE)); if (storageHandler == null) { return null; } diff --git ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java index 2ecda01..ad9528c 100644 --- ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java +++ ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java @@ -58,7 +58,7 @@ import org.apache.hadoop.mapred.SequenceFileInputFormat; /** * A Hive Table: is a fundamental unit of data in Hive that shares a common schema/DDL. - * + * * Please note that the ql code should always go through methods of this class to access the * metadata, instead of directly accessing org.apache.hadoop.hive.metastore.api.Table. This * helps to isolate the metastore code and the ql code. @@ -79,7 +79,7 @@ public class Table implements Serializable { private Class inputFormatClass; private URI uri; private HiveStorageHandler storageHandler; - + /** * Used only for serialization. */ @@ -96,8 +96,8 @@ public class Table implements Serializable { } } - public Table(String name) { - this(getEmptyTable(name)); + public Table(String databaseName, String tableName) { + this(getEmptyTable(databaseName, tableName)); } /** @@ -108,18 +108,19 @@ public class Table implements Serializable { public org.apache.hadoop.hive.metastore.api.Table getTTable() { return tTable; } - + /** * This function should only be called by Java serialization. */ public void setTTable(org.apache.hadoop.hive.metastore.api.Table tTable) { this.tTable = tTable; } - + /** * Initialize an emtpy table. */ - static org.apache.hadoop.hive.metastore.api.Table getEmptyTable(String name) { + static org.apache.hadoop.hive.metastore.api.Table + getEmptyTable(String databaseName, String tableName) { StorageDescriptor sd = new StorageDescriptor(); { sd.setSerdeInfo(new SerDeInfo()); @@ -136,15 +137,16 @@ public class Table implements Serializable { sd.setInputFormat(SequenceFileInputFormat.class.getName()); sd.setOutputFormat(HiveSequenceFileOutputFormat.class.getName()); } - + org.apache.hadoop.hive.metastore.api.Table t = new org.apache.hadoop.hive.metastore.api.Table(); { t.setSd(sd); t.setPartitionKeys(new ArrayList()); t.setParameters(new HashMap()); t.setTableType(TableType.MANAGED_TABLE.toString()); - t.setTableName(name); - t.setDbName(MetaStoreUtils.DEFAULT_DATABASE_NAME); + t.setDbName(databaseName); + t.setTableName(tableName); + t.setDbName(databaseName); } return t; } @@ -179,7 +181,7 @@ public class Table implements Serializable { assert(getViewOriginalText() == null); assert(getViewExpandedText() == null); } - + Iterator iterCols = getCols().iterator(); List colNames = new ArrayList(); while (iterCols.hasNext()) { @@ -246,7 +248,7 @@ public class Table implements Serializable { } final public Deserializer getDeserializer() { - if (deserializer == null) { + if (deserializer == null) { try { deserializer = MetaStoreUtils.getDeserializer(Hive.get().getConf(), tTable); } catch (MetaException e) { @@ -290,12 +292,12 @@ public class Table implements Serializable { throw new RuntimeException(e); } } - return inputFormatClass; + return inputFormatClass; } final public Class getOutputFormatClass() { // Replace FileOutputFormat for backward compatibility - + if (outputFormatClass == null) { try { String className = tTable.getSd().getOutputFormat(); @@ -490,7 +492,7 @@ public class Table implements Serializable { /** * Returns a list of all the columns of the table (data columns + partition * columns in that order. - * + * * @return List */ public List getAllCols() { @@ -515,7 +517,7 @@ public class Table implements Serializable { /** * Replaces files in the partition with new data set specified by srcf. Works * by moving files - * + * * @param srcf * Files to be replaced. Leaf directories or globbed file paths * @param tmpd @@ -533,7 +535,7 @@ public class Table implements Serializable { /** * Inserts files specified into the partition. Works by moving files - * + * * @param srcf * Files to be moved. Leaf directories or globbed file paths */ @@ -662,15 +664,15 @@ public class Table implements Serializable { public void setTableName(String tableName) { tTable.setTableName(tableName); } - + public void setDbName(String databaseName) { tTable.setDbName(databaseName); } - + public List getPartitionKeys() { return tTable.getPartitionKeys(); } - + /** * @return the original view text, or null if this table is not a view */ @@ -713,7 +715,7 @@ public class Table implements Serializable { /** * Creates a partition name -> value spec map object - * + * * @param tp * Use the information from this partition. * @return Partition name to value mapping. @@ -735,7 +737,7 @@ public class Table implements Serializable { public Table copy() throws HiveException { return new Table(tTable.clone()); } - + public void setCreateTime(int createTime) { tTable.setCreateTime(createTime); } diff --git ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java index 8f0b4b6..e3c6dbc 100644 --- ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java +++ ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java @@ -31,7 +31,6 @@ import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.metastore.MetaStoreUtils; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.Order; import org.apache.hadoop.hive.ql.Context; @@ -457,8 +456,7 @@ public abstract class BaseSemanticAnalyzer { + tableName; } - tableHandle = db.getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, - tableName); + tableHandle = db.getTable(tableName); } catch (InvalidTableException ite) { throw new SemanticException(ErrorMsg.INVALID_TABLE.getMsg(ast .getChild(0)), ite); diff --git ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java index 89113ef..569e460 100644 --- ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java +++ ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java @@ -18,6 +18,14 @@ package org.apache.hadoop.hive.ql.parse; +import static org.apache.hadoop.hive.ql.parse.HiveParser.TOK_CREATEDATABASE; +import static org.apache.hadoop.hive.ql.parse.HiveParser.TOK_DATABASECOMMENT; +import static org.apache.hadoop.hive.ql.parse.HiveParser.TOK_DROPDATABASE; +import static org.apache.hadoop.hive.ql.parse.HiveParser.TOK_IFEXISTS; +import static org.apache.hadoop.hive.ql.parse.HiveParser.TOK_IFNOTEXISTS; +import static org.apache.hadoop.hive.ql.parse.HiveParser.TOK_SHOWDATABASES; +import static org.apache.hadoop.hive.ql.parse.HiveParser.TOK_SWITCHDATABASE; + import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -36,7 +44,6 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hadoop.hive.metastore.MetaStoreUtils; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.Order; import org.apache.hadoop.hive.ql.exec.FetchTask; @@ -45,16 +52,20 @@ import org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat; import org.apache.hadoop.hive.ql.plan.AddPartitionDesc; import org.apache.hadoop.hive.ql.plan.AlterTableDesc; import org.apache.hadoop.hive.ql.plan.AlterTableSimpleDesc; +import org.apache.hadoop.hive.ql.plan.CreateDatabaseDesc; import org.apache.hadoop.hive.ql.plan.DDLWork; import org.apache.hadoop.hive.ql.plan.DescFunctionDesc; import org.apache.hadoop.hive.ql.plan.DescTableDesc; +import org.apache.hadoop.hive.ql.plan.DropDatabaseDesc; import org.apache.hadoop.hive.ql.plan.DropTableDesc; import org.apache.hadoop.hive.ql.plan.FetchWork; import org.apache.hadoop.hive.ql.plan.MsckDesc; +import org.apache.hadoop.hive.ql.plan.ShowDatabasesDesc; import org.apache.hadoop.hive.ql.plan.ShowFunctionsDesc; import org.apache.hadoop.hive.ql.plan.ShowPartitionsDesc; import org.apache.hadoop.hive.ql.plan.ShowTableStatusDesc; import org.apache.hadoop.hive.ql.plan.ShowTablesDesc; +import org.apache.hadoop.hive.ql.plan.SwitchDatabaseDesc; import org.apache.hadoop.hive.ql.plan.TableDesc; import org.apache.hadoop.hive.ql.plan.AlterTableDesc.AlterTableTypes; import org.apache.hadoop.hive.serde.Constants; @@ -110,6 +121,9 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer { } else if (ast.getToken().getType() == HiveParser.TOK_DESCTABLE) { ctx.setResFile(new Path(ctx.getLocalTmpFileURI())); analyzeDescribeTable(ast); + } else if (ast.getToken().getType() == TOK_SHOWDATABASES) { + ctx.setResFile(new Path(ctx.getLocalTmpFileURI())); + analyzeShowDatabases(ast); } else if (ast.getToken().getType() == HiveParser.TOK_SHOWTABLES) { ctx.setResFile(new Path(ctx.getLocalTmpFileURI())); analyzeShowTables(ast); @@ -160,11 +174,65 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer { } else if (ast.getToken().getType() == HiveParser.TOK_SHOWPARTITIONS) { ctx.setResFile(new Path(ctx.getLocalTmpFileURI())); analyzeShowPartitions(ast); + } else if (ast.getToken().getType() == TOK_CREATEDATABASE) { + analyzeCreateDatabase(ast); + } else if (ast.getToken().getType() == TOK_DROPDATABASE) { + analyzeDropDatabase(ast); + } else if (ast.getToken().getType() == TOK_SWITCHDATABASE) { + analyzeSwitchDatabase(ast); } else { throw new SemanticException("Unsupported command."); } } + private void analyzeCreateDatabase(ASTNode ast) throws SemanticException { + String dbName = unescapeIdentifier(ast.getChild(0).getText()); + boolean ifNotExists = false; + String dbComment = null; + + for (int i = 1; i < ast.getChildCount(); i++) { + ASTNode childNode = (ASTNode) ast.getChild(i); + switch (childNode.getToken().getType()) { + case TOK_IFNOTEXISTS: + ifNotExists = true; + break; + case TOK_DATABASECOMMENT: + dbComment = unescapeSQLString(childNode.getChild(0).getText()); + break; + default: + throw new SemanticException("Unrecognized token in CREATE DATABASE statement"); + } + } + + CreateDatabaseDesc createDatabaseDesc = new CreateDatabaseDesc(); + createDatabaseDesc.setName(dbName); + createDatabaseDesc.setComment(dbComment); + createDatabaseDesc.setIfNotExists(ifNotExists); + createDatabaseDesc.setLocationUri(null); + + rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), + createDatabaseDesc), conf)); + } + + private void analyzeDropDatabase(ASTNode ast) throws SemanticException { + String dbName = unescapeIdentifier(ast.getChild(0).getText()); + boolean ifExists = false; + + if (null != ast.getFirstChildWithType(TOK_IFEXISTS)) { + ifExists = true; + } + + DropDatabaseDesc dropDatabaseDesc = new DropDatabaseDesc(dbName, ifExists); + rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), dropDatabaseDesc), conf)); + } + + private void analyzeSwitchDatabase(ASTNode ast) { + String dbName = unescapeIdentifier(ast.getChild(0).getText()); + SwitchDatabaseDesc switchDatabaseDesc = new SwitchDatabaseDesc(dbName); + rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), + switchDatabaseDesc), conf)); + } + private void analyzeDropTable(ASTNode ast, boolean expectView) throws SemanticException { String tableName = unescapeIdentifier(ast.getChild(0).getText()); @@ -383,6 +451,18 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer { setFetchTask(createFetchTask(showPartsDesc.getSchema())); } + private void analyzeShowDatabases(ASTNode ast) throws SemanticException { + ShowDatabasesDesc showDatabasesDesc; + if (ast.getChildCount() == 1) { + String databasePattern = unescapeSQLString(ast.getChild(0).getText()); + showDatabasesDesc = new ShowDatabasesDesc(ctx.getResFile(), databasePattern); + } else { + showDatabasesDesc = new ShowDatabasesDesc(ctx.getResFile()); + } + rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), showDatabasesDesc), conf)); + setFetchTask(createFetchTask(showDatabasesDesc.getSchema())); + } + private void analyzeShowTables(ASTNode ast) throws SemanticException { ShowTablesDesc showTblsDesc; if (ast.getChildCount() == 1) { @@ -399,7 +479,7 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer { private void analyzeShowTableStatus(ASTNode ast) throws SemanticException { ShowTableStatusDesc showTblStatusDesc; String tableNames = unescapeIdentifier(ast.getChild(0).getText()); - String dbName = MetaStoreUtils.DEFAULT_DATABASE_NAME; + String dbName = db.getCurrentDatabase(); int children = ast.getChildCount(); HashMap partSpec = null; if (children >= 2) { @@ -569,7 +649,7 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer { if (currentPart != null) { validatePartitionValues(currentPart); AddPartitionDesc addPartitionDesc = new AddPartitionDesc( - MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, currentPart, + db.getCurrentDatabase(), tblName, currentPart, currentLocation, ifNotExists); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), addPartitionDesc), conf)); @@ -591,7 +671,7 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer { if (currentPart != null) { validatePartitionValues(currentPart); AddPartitionDesc addPartitionDesc = new AddPartitionDesc( - MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, currentPart, + db.getCurrentDatabase(), tblName, currentPart, currentLocation, ifNotExists); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), addPartitionDesc), conf)); @@ -618,14 +698,14 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer { if (partSpecs.size() == 0) { AlterTableSimpleDesc touchDesc = new AlterTableSimpleDesc( - MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, null, + db.getCurrentDatabase(), tblName, null, AlterTableDesc.AlterTableTypes.TOUCH); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), touchDesc), conf)); } else { for (Map partSpec : partSpecs) { AlterTableSimpleDesc touchDesc = new AlterTableSimpleDesc( - MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, partSpec, + db.getCurrentDatabase(), tblName, partSpec, AlterTableDesc.AlterTableTypes.TOUCH); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), touchDesc), conf)); @@ -654,7 +734,7 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer { Map partSpec = partSpecs.get(0); AlterTableSimpleDesc archiveDesc = new AlterTableSimpleDesc( - MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, partSpec, + db.getCurrentDatabase(), tblName, partSpec, (isUnArchive ? AlterTableTypes.UNARCHIVE : AlterTableTypes.ARCHIVE)); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), archiveDesc), conf)); diff --git ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g index cb8dc80..6c742d8 100644 --- ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g +++ ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g @@ -85,6 +85,7 @@ TOK_STRING; TOK_LIST; TOK_STRUCT; TOK_MAP; +TOK_CREATEDATABASE; TOK_CREATETABLE; TOK_LIKETABLE; TOK_DESCTABLE; @@ -104,10 +105,14 @@ TOK_ALTERTABLE_FILEFORMAT; TOK_ALTERTABLE_PROPERTIES; TOK_ALTERTABLE_CHANGECOL_AFTER_POSITION; TOK_MSCK; +TOK_SHOWDATABASES; TOK_SHOWTABLES; TOK_SHOWFUNCTIONS; TOK_SHOWPARTITIONS; TOK_SHOW_TABLESTATUS; +TOK_SWITCHDATABASE; +TOK_DROPDATABASE; +TOK_DATABASECOMMENT; TOK_DROPTABLE; TOK_TABCOLLIST; TOK_TABCOL; @@ -146,6 +151,7 @@ TOK_TABTYPE; TOK_LIMIT; TOK_TABLEPROPERTY; TOK_IFNOTEXISTS; +TOK_IFEXISTS; TOK_HINTLIST; TOK_HINT; TOK_MAPJOIN; @@ -209,7 +215,10 @@ loadStatement ddlStatement @init { msgs.push("ddl statement"); } @after { msgs.pop(); } - : createTableStatement + : createDatabaseStatement + | switchDatabaseStatement + | dropDatabaseStatement + | createTableStatement | dropTableStatement | alterStatement | descStatement @@ -221,6 +230,13 @@ ddlStatement | dropFunctionStatement ; +ifExists +@init { msgs.push("if exists clause"); } +@after { msgs.pop(); } + : KW_IF KW_EXISTS + -> ^(TOK_IFEXISTS) + ; + ifNotExists @init { msgs.push("if not exists clause"); } @after { msgs.pop(); } @@ -228,6 +244,37 @@ ifNotExists -> ^(TOK_IFNOTEXISTS) ; +createDatabaseStatement +@init { msgs.push("create database statement"); } +@after { msgs.pop(); } + : KW_CREATE (KW_DATABASE|KW_SCHEMA) + ifNotExists? + name=Identifier + databaseComment? + -> ^(TOK_CREATEDATABASE $name ifNotExists? databaseComment?) + ; + +switchDatabaseStatement +@init { msgs.push("switch database statement"); } +@after { msgs.pop(); } + : KW_USE Identifier + -> ^(TOK_SWITCHDATABASE Identifier) + ; + +dropDatabaseStatement +@init { msgs.push("drop database statement"); } +@after { msgs.pop(); } + : KW_DROP (KW_DATABASE|KW_SCHEMA) ifExists? Identifier + -> ^(TOK_DROPDATABASE Identifier ifExists?) + ; + +databaseComment +@init { msgs.push("database's comment"); } +@after { msgs.pop(); } + : KW_COMMENT comment=StringLiteral + -> ^(TOK_DATABASECOMMENT $comment) + ; + createTableStatement @init { msgs.push("create table statement"); } @after { msgs.pop(); } @@ -438,7 +485,8 @@ descStatement showStatement @init { msgs.push("show statement"); } @after { msgs.pop(); } - : KW_SHOW KW_TABLES showStmtIdentifier? -> ^(TOK_SHOWTABLES showStmtIdentifier?) + : KW_SHOW (KW_DATABASES|KW_SCHEMAS) (KW_LIKE showStmtIdentifier)? -> ^(TOK_SHOWDATABASES showStmtIdentifier?) + | KW_SHOW KW_TABLES showStmtIdentifier? -> ^(TOK_SHOWTABLES showStmtIdentifier?) | KW_SHOW KW_FUNCTIONS showStmtIdentifier? -> ^(TOK_SHOWFUNCTIONS showStmtIdentifier?) | KW_SHOW KW_PARTITIONS Identifier partitionSpec? -> ^(TOK_SHOWPARTITIONS Identifier partitionSpec?) | KW_SHOW KW_TABLE KW_EXTENDED ((KW_FROM|KW_IN) db_name=Identifier)? KW_LIKE showStmtIdentifier partitionSpec? @@ -1617,6 +1665,7 @@ KW_INTERSECT: 'INTERSECT'; KW_VIEW: 'VIEW'; KW_IN: 'IN'; KW_DATABASE: 'DATABASE'; +KW_DATABASES: 'DATABASES'; KW_MATERIALIZED: 'MATERIALIZED'; KW_SCHEMA: 'SCHEMA'; KW_SCHEMAS: 'SCHEMAS'; @@ -1649,6 +1698,7 @@ KW_LATERAL: 'LATERAL'; KW_TOUCH: 'TOUCH'; KW_ARCHIVE: 'ARCHIVE'; KW_UNARCHIVE: 'UNARCHIVE'; +KW_USE: 'USE'; // Operators // NOTE: if you add a new function/operator, add it to sysFuncNames so that describe function _FUNC_ will work. diff --git ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java index f43dee3..fd66d9c 100644 --- ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java +++ ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java @@ -42,7 +42,6 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hive.common.FileUtils; import org.apache.hadoop.hive.common.JavaUtils; import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.metastore.MetaStoreUtils; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.Order; import org.apache.hadoop.hive.ql.exec.AbstractMapJoinOperator; @@ -738,7 +737,7 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer { String tab_name = qb.getTabNameForAlias(alias); Table tab = null; try { - tab = db.getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tab_name); + tab = db.getTable(tab_name); } catch (InvalidTableException ite) { throw new SemanticException(ErrorMsg.INVALID_TABLE.getMsg(qb .getParseInfo().getSrcForAlias(alias))); @@ -6605,9 +6604,8 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer { // check for existence of table if (ifNotExists) { try { - List tables = db.getTablesByPattern(tableName); - if (tables != null && tables.size() > 0) { // table exists - return null; + if (null != db.getTable(db.getCurrentDatabase(), tableName, false)) { + return null; } } catch (HiveException e) { e.printStackTrace(); @@ -6641,8 +6639,8 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer { // check for existence of table. Throw an exception if it exists. try { - Table tab = db.getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, - tableName, false); // do not throw exception if table does not exist + Table tab = db.getTable(db.getCurrentDatabase(), tableName, false); + // do not throw exception if table does not exist if (tab != null) { throw new SemanticException(ErrorMsg.TABLE_ALREADY_EXISTS diff --git ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java index 18af63b..c67e8f9 100644 --- ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java +++ ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java @@ -34,6 +34,9 @@ public final class SemanticAnalyzerFactory { static { commandType.put(HiveParser.TOK_EXPLAIN, "EXPLAIN"); commandType.put(HiveParser.TOK_LOAD, "LOAD"); + commandType.put(HiveParser.TOK_CREATEDATABASE, "CREATEDATABASE"); + commandType.put(HiveParser.TOK_DROPDATABASE, "DROPDATABASE"); + commandType.put(HiveParser.TOK_SWITCHDATABASE, "SWITCHDATABASE"); commandType.put(HiveParser.TOK_CREATETABLE, "CREATETABLE"); commandType.put(HiveParser.TOK_DROPTABLE, "DROPTABLE"); commandType.put(HiveParser.TOK_DESCTABLE, "DESCTABLE"); @@ -51,6 +54,7 @@ public final class SemanticAnalyzerFactory { commandType.put(HiveParser.TOK_ALTERTABLE_PROPERTIES, "ALTERTABLE_PROPERTIES"); commandType.put(HiveParser.TOK_ALTERTABLE_SERIALIZER, "ALTERTABLE_SERIALIZER"); commandType.put(HiveParser.TOK_ALTERTABLE_SERDEPROPERTIES, "ALTERTABLE_SERDEPROPERTIES"); + commandType.put(HiveParser.TOK_SHOWDATABASES, "SHOWDATABASES"); commandType.put(HiveParser.TOK_SHOWTABLES, "SHOWTABLES"); commandType.put(HiveParser.TOK_SHOW_TABLESTATUS, "SHOW_TABLESTATUS"); commandType.put(HiveParser.TOK_SHOWFUNCTIONS, "SHOWFUNCTIONS"); @@ -78,6 +82,9 @@ public final class SemanticAnalyzerFactory { return new ExplainSemanticAnalyzer(conf); case HiveParser.TOK_LOAD: return new LoadSemanticAnalyzer(conf); + case HiveParser.TOK_CREATEDATABASE: + case HiveParser.TOK_DROPDATABASE: + case HiveParser.TOK_SWITCHDATABASE: case HiveParser.TOK_DROPTABLE: case HiveParser.TOK_DROPVIEW: case HiveParser.TOK_DESCTABLE: @@ -93,6 +100,7 @@ public final class SemanticAnalyzerFactory { case HiveParser.TOK_ALTERTABLE_SERIALIZER: case HiveParser.TOK_ALTERTABLE_SERDEPROPERTIES: case HiveParser.TOK_ALTERVIEW_PROPERTIES: + case HiveParser.TOK_SHOWDATABASES: case HiveParser.TOK_SHOWTABLES: case HiveParser.TOK_SHOW_TABLESTATUS: case HiveParser.TOK_SHOWFUNCTIONS: diff --git ql/src/java/org/apache/hadoop/hive/ql/plan/CreateDatabaseDesc.java ql/src/java/org/apache/hadoop/hive/ql/plan/CreateDatabaseDesc.java new file mode 100644 index 0000000..57ccf94 --- /dev/null +++ ql/src/java/org/apache/hadoop/hive/ql/plan/CreateDatabaseDesc.java @@ -0,0 +1,93 @@ +/** + * 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.ql.plan; + +import java.io.Serializable; + +/** + * CreateDatabaseDesc. + * + */ +@Explain(displayName = "Create Database") +public class CreateDatabaseDesc extends DDLDesc implements Serializable { + + private static final long serialVersionUID = 1L; + + String databaseName; + String locationUri; + String comment; + boolean ifNotExists; + + /** + * For serialization only. + */ + public CreateDatabaseDesc() { + } + + public CreateDatabaseDesc(String databaseName, String comment, + String locationUri, boolean ifNotExists) { + super(); + this.databaseName = databaseName; + this.comment = comment; + this.locationUri = locationUri; + this.ifNotExists = ifNotExists; + } + + public CreateDatabaseDesc(String databaseName, boolean ifNotExists) { + this(databaseName, null, null, ifNotExists); + } + + + + @Explain(displayName="if not exists") + public boolean getIfNotExists() { + return ifNotExists; + } + + public void setIfNotExists(boolean ifNotExists) { + this.ifNotExists = ifNotExists; + } + + @Explain(displayName="name") + public String getName() { + return databaseName; + } + + public void setName(String databaseName) { + this.databaseName = databaseName; + } + + @Explain(displayName="comment") + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + @Explain(displayName="locationUri") + public String getLocationUri() { + return locationUri; + } + + public void setLocationUri(String locationUri) { + this.locationUri = locationUri; + } +} diff --git ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java index d125b0e..72cca52 100644 --- ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java +++ ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java @@ -31,11 +31,15 @@ import org.apache.hadoop.hive.ql.hooks.WriteEntity; public class DDLWork implements Serializable { private static final long serialVersionUID = 1L; + private CreateDatabaseDesc createDatabaseDesc; + private SwitchDatabaseDesc switchDatabaseDesc; + private DropDatabaseDesc dropDatabaseDesc; private CreateTableDesc createTblDesc; private CreateTableLikeDesc createTblLikeDesc; private CreateViewDesc createVwDesc; private DropTableDesc dropTblDesc; private AlterTableDesc alterTblDesc; + private ShowDatabasesDesc showDatabasesDesc; private ShowTablesDesc showTblsDesc; private ShowFunctionsDesc showFuncsDesc; private DescFunctionDesc descFunctionDesc; @@ -64,6 +68,36 @@ public class DDLWork implements Serializable { } /** + * @param createDatabaseDesc + * Create Database descriptor + */ + public DDLWork(HashSet inputs, HashSet outputs, + CreateDatabaseDesc createDatabaseDesc) { + this(inputs, outputs); + this.createDatabaseDesc = createDatabaseDesc; + } + + /** + * @param dropDatabaseDesc + * Drop Database descriptor + */ + public DDLWork(HashSet inputs, HashSet outputs, + DropDatabaseDesc dropDatabaseDesc) { + this(inputs, outputs); + this.dropDatabaseDesc = dropDatabaseDesc; + } + + /** + * @param switchDatabaseDesc + * Switch Database descriptor + */ + public DDLWork(HashSet inputs, HashSet outputs, + SwitchDatabaseDesc switchDatabaseDesc) { + this(inputs, outputs); + this.switchDatabaseDesc = switchDatabaseDesc; + } + + /** * @param alterTblDesc * alter table descriptor */ @@ -128,6 +162,16 @@ public class DDLWork implements Serializable { } /** + * @param showDatabasesDesc + */ + public DDLWork(HashSet inputs, HashSet outputs, + ShowDatabasesDesc showDatabasesDesc) { + this(inputs, outputs); + + this.showDatabasesDesc = showDatabasesDesc; + } + + /** * @param showTblsDesc */ public DDLWork(HashSet inputs, HashSet outputs, @@ -208,6 +252,51 @@ public class DDLWork implements Serializable { } /** + * @return Create Database descriptor + */ + public CreateDatabaseDesc getCreateDatabaseDesc() { + return createDatabaseDesc; + } + + /** + * Set Create Database descriptor + * @param createDatabaseDesc + */ + public void setCreateDatabaseDesc(CreateDatabaseDesc createDatabaseDesc) { + this.createDatabaseDesc = createDatabaseDesc; + } + + /** + * @return Drop Database descriptor + */ + public DropDatabaseDesc getDropDatabaseDesc() { + return dropDatabaseDesc; + } + + /** + * Set Drop Database descriptor + * @param dropDatabaseDesc + */ + public void setDropDatabaseDesc(DropDatabaseDesc dropDatabaseDesc) { + this.dropDatabaseDesc = dropDatabaseDesc; + } + + /** + * @return Switch Database descriptor + */ + public SwitchDatabaseDesc getSwitchDatabaseDesc() { + return switchDatabaseDesc; + } + + /** + * Set Switch Database descriptor + * @param switchDatabaseDesc + */ + public void setSwitchDatabaseDesc(SwitchDatabaseDesc switchDatabaseDesc) { + this.switchDatabaseDesc = switchDatabaseDesc; + } + + /** * @return the createTblDesc */ @Explain(displayName = "Create Table Operator") @@ -288,6 +377,22 @@ public class DDLWork implements Serializable { } /** + * @return the showDatabasesDesc + */ + @Explain(displayName = "Show Databases Operator") + public ShowDatabasesDesc getShowDatabasesDesc() { + return showDatabasesDesc; + } + + /** + * @param showDatabasesDesc + * the showDatabasesDesc to set + */ + public void setShowDatabasesDesc(ShowDatabasesDesc showDatabasesDesc) { + this.showDatabasesDesc = showDatabasesDesc; + } + + /** * @return the showTblsDesc */ @Explain(displayName = "Show Table Operator") diff --git ql/src/java/org/apache/hadoop/hive/ql/plan/DropDatabaseDesc.java ql/src/java/org/apache/hadoop/hive/ql/plan/DropDatabaseDesc.java new file mode 100644 index 0000000..ac47eb1 --- /dev/null +++ ql/src/java/org/apache/hadoop/hive/ql/plan/DropDatabaseDesc.java @@ -0,0 +1,57 @@ +/** + * 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.ql.plan; + +import java.io.Serializable; + +/** + * DropDatabaseDesc. + * + */ +@Explain(displayName = "Drop Database") +public class DropDatabaseDesc extends DDLDesc implements Serializable { + private static final long serialVersionUID = 1L; + + String databaseName; + boolean ifExists; + + public DropDatabaseDesc(String databaseName, boolean ifExists) { + super(); + this.databaseName = databaseName; + this.ifExists = ifExists; + } + + @Explain(displayName = "database") + public String getDatabaseName() { + return databaseName; + } + + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + @Explain(displayName = "if exists") + public boolean getIfExists() { + return ifExists; + } + + public void setIfExists(boolean ifExists) { + this.ifExists = ifExists; + } +} diff --git ql/src/java/org/apache/hadoop/hive/ql/plan/ShowDatabasesDesc.java ql/src/java/org/apache/hadoop/hive/ql/plan/ShowDatabasesDesc.java new file mode 100644 index 0000000..0ad0658 --- /dev/null +++ ql/src/java/org/apache/hadoop/hive/ql/plan/ShowDatabasesDesc.java @@ -0,0 +1,104 @@ +/** + * 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.ql.plan; + +import java.io.Serializable; + +import org.apache.hadoop.fs.Path; + +/** + * ShowDatabasesDesc. + * + */ +@Explain(displayName = "Show Databases") +public class ShowDatabasesDesc extends DDLDesc implements Serializable { + private static final long serialVersionUID = 1L; + String pattern; + String resFile; + + /** + * table name for the result of show databases. + */ + private static final String table = "show_databases"; + + /** + * thrift ddl for the result of show databases. + */ + private static final String schema = "database_name#string"; + + public String getTable() { + return table; + } + + public String getSchema() { + return schema; + } + + public ShowDatabasesDesc() { + } + + /** + * @param resFile + */ + public ShowDatabasesDesc(Path resFile) { + this.resFile = resFile.toString(); + pattern = null; + } + + /** + * @param pattern + * names of databases to show + */ + public ShowDatabasesDesc(Path resFile, String pattern) { + this.resFile = resFile.toString(); + this.pattern = pattern; + } + + /** + * @return the pattern + */ + @Explain(displayName = "pattern") + public String getPattern() { + return pattern; + } + + /** + * @param pattern + * the pattern to set + */ + public void setPattern(String pattern) { + this.pattern = pattern; + } + + /** + * @return the resFile + */ + @Explain(displayName = "result file", normalExplain = false) + public String getResFile() { + return resFile; + } + + /** + * @param resFile + * the resFile to set + */ + public void setResFile(String resFile) { + this.resFile = resFile; + } +} diff --git ql/src/java/org/apache/hadoop/hive/ql/plan/SwitchDatabaseDesc.java ql/src/java/org/apache/hadoop/hive/ql/plan/SwitchDatabaseDesc.java new file mode 100644 index 0000000..0cad7c1 --- /dev/null +++ ql/src/java/org/apache/hadoop/hive/ql/plan/SwitchDatabaseDesc.java @@ -0,0 +1,50 @@ +/** + * 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.ql.plan; + +import java.io.Serializable; + +/** + * SwitchDatabaseDesc. + * + */ +@Explain(displayName = "Switch Database") +public class SwitchDatabaseDesc extends DDLDesc implements Serializable { + + private static final long serialVersionUID = 1L; + + String databaseName; + + public SwitchDatabaseDesc() { + } + + public SwitchDatabaseDesc(String databaseName) { + super(); + this.databaseName = databaseName; + } + + @Explain(displayName = "name") + public String getDatabaseName() { + return databaseName; + } + + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } +} diff --git ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java index 9b4e89c..d1fa5e1 100644 --- ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java +++ ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java @@ -18,6 +18,8 @@ package org.apache.hadoop.hive.ql; +import static org.apache.hadoop.hive.metastore.MetaStoreUtils.DEFAULT_DATABASE_NAME; + import java.io.BufferedInputStream; import java.io.DataInputStream; import java.io.File; @@ -26,8 +28,8 @@ import java.io.FileOutputStream; import java.io.FileWriter; import java.io.PrintStream; import java.io.Serializable; -import java.net.URI; import java.util.ArrayList; +import java.util.Arrays; import java.util.Deque; import java.util.HashMap; import java.util.HashSet; @@ -84,11 +86,15 @@ public class QTestUtil { private final String logDir; private final TreeMap qMap; private final Set qSkipSet; - private final LinkedList srcTables; + public static final HashSet srcTables = new HashSet + (Arrays.asList(new String [] { + "src", "src1", "srcbucket", "srcbucket2", "src_json", "src_thrift", + "src_sequencefile", "srcpart" + })); private ParseDriver pd; private Hive db; - protected final HiveConf conf; + protected HiveConf conf; private Driver drv; private SemanticAnalyzer sem; private FileSystem fs; @@ -184,6 +190,18 @@ public class QTestUtil { return null; } + public void initConf() { + if (miniMr) { + String fsName = conf.get("fs.default.name"); + assert fsName != null; + // hive.metastore.warehouse.dir needs to be set relative to the jobtracker + conf.set("hive.metastore.warehouse.dir", fsName + .concat("/build/ql/test/data/warehouse/")); + conf.set("mapred.job.tracker", "localhost:" + mr.getJobTrackerPort()); + } + + } + public QTestUtil(String outDir, String logDir, boolean miniMr, String hadoopVer) throws Exception { this.outDir = outDir; this.logDir = logDir; @@ -197,17 +215,10 @@ public class QTestUtil { dfs = ShimLoader.getHadoopShims().getMiniDfs(conf, 4, true, null); FileSystem fs = dfs.getFileSystem(); mr = new MiniMRCluster(4, fs.getUri().toString(), 1); - - // hive.metastore.warehouse.dir needs to be set relative to the jobtracker - String fsName = conf.get("fs.default.name"); - assert fsName != null; - conf.set("hive.metastore.warehouse.dir", fsName - .concat("/build/ql/test/data/warehouse/")); - - conf.set("mapred.job.tracker", "localhost:" + mr.getJobTrackerPort()); } - // System.out.println(conf.toString()); + initConf(); + testFiles = conf.get("test.data.files").replace('\\', '/') .replace("c:", ""); @@ -217,8 +228,6 @@ public class QTestUtil { overWrite = true; } - srcTables = new LinkedList(); - init(); } @@ -290,18 +299,50 @@ public class QTestUtil { dis.close(); } + /** + * Clear out any side effects of running tests + */ + public void clearTestSideEffects () throws Exception { + // Delete any tables other than the source tables + // and any databases other than the default database. + for (String dbName : db.getAllDatabases()) { + db.setCurrentDatabase(dbName); + for (String tblName : db.getAllTables()) { + if (!DEFAULT_DATABASE_NAME.equals(dbName) || !srcTables.contains(tblName)) { + db.dropTable(dbName, tblName); + } + } + if (!DEFAULT_DATABASE_NAME.equals(dbName)) { + db.dropDatabase(dbName); + } + } + db.setCurrentDatabase(DEFAULT_DATABASE_NAME); + // allocate and initialize a new conf since a test can + // modify conf by using 'set' commands + conf = new HiveConf (Driver.class); + initConf(); + } + + public void cleanUp() throws Exception { - String warehousePath = ((new URI(testWarehouse)).getPath()); // Drop any tables that remain due to unsuccessful runs - for (String s : new String[] {"src", "src1", "src_json", "src_thrift", - "src_sequencefile", "srcpart", "srcbucket", "srcbucket2", "dest1", - "dest2", "dest3", "dest4", "dest4_sequencefile", "dest_j1", "dest_j2", - "dest_g1", "dest_g2", "fetchtask_ioexception"}) { - db.dropTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, s); + for (String dbName : db.getAllDatabases()) { + for (String tableName : db.getAllTables(dbName)) { + db.dropTable(dbName, tableName, true, true); + } + if (!DEFAULT_DATABASE_NAME.equalsIgnoreCase(dbName)) { + db.dropDatabase(dbName, true, true); + } } - for (String s : new String[] {"dest4.out", "union.out"}) { - deleteDirectory(new File(warehousePath, s)); + + // delete any contents in the warehouse dir + Path p = new Path(testWarehouse); + FileSystem fs = p.getFileSystem(conf); + FileStatus [] ls = fs.listStatus(p); + for (int i=0; (ls != null) && (i cols = new LinkedList(); @@ -340,7 +382,6 @@ public class QTestUtil { part_cols.add("hr"); db.createTable("srcpart", cols, part_cols, TextInputFormat.class, IgnoreKeyTextOutputFormat.class); - srcTables.add("srcpart"); Path fpath; Path newfpath; @@ -367,7 +408,6 @@ public class QTestUtil { runCreateTableCmd("CREATE TABLE srcbucket(key int, value string) CLUSTERED BY (key) INTO 2 BUCKETS STORED AS TEXTFILE"); // db.createTable("srcbucket", cols, null, TextInputFormat.class, // IgnoreKeyTextOutputFormat.class, 2, bucketCols); - srcTables.add("srcbucket"); for (String fname : new String[] {"srcbucket0.txt", "srcbucket1.txt"}) { fpath = new Path(testFiles, fname); newfpath = new Path(tmppath, fname); @@ -380,7 +420,6 @@ public class QTestUtil { + "CLUSTERED BY (key) INTO 4 BUCKETS STORED AS TEXTFILE"); // db.createTable("srcbucket", cols, null, TextInputFormat.class, // IgnoreKeyTextOutputFormat.class, 2, bucketCols); - srcTables.add("srcbucket2"); for (String fname : new String[] {"srcbucket20.txt", "srcbucket21.txt", "srcbucket22.txt", "srcbucket23.txt"}) { fpath = new Path(testFiles, fname); @@ -393,13 +432,11 @@ public class QTestUtil { for (String tname : new String[] {"src", "src1"}) { db.createTable(tname, cols, null, TextInputFormat.class, IgnoreKeyTextOutputFormat.class); - srcTables.add(tname); } db.createTable("src_sequencefile", cols, null, SequenceFileInputFormat.class, SequenceFileOutputFormat.class); - srcTables.add("src_sequencefile"); - Table srcThrift = new Table("src_thrift"); + Table srcThrift = new Table(db.getCurrentDatabase(), "src_thrift"); srcThrift.setInputFormatClass(SequenceFileInputFormat.class.getName()); srcThrift.setOutputFormatClass(SequenceFileOutputFormat.class.getName()); srcThrift.setSerializationLib(ThriftDeserializer.class.getName()); @@ -408,13 +445,11 @@ public class QTestUtil { srcThrift.setSerdeParam(Constants.SERIALIZATION_FORMAT, TBinaryProtocol.class.getName()); db.createTable(srcThrift); - srcTables.add("src_thrift"); LinkedList json_cols = new LinkedList(); json_cols.add("json"); db.createTable("src_json", json_cols, null, TextInputFormat.class, IgnoreKeyTextOutputFormat.class); - srcTables.add("src_json"); // load the input data into the src table fpath = new Path(testFiles, "kv1.txt"); @@ -489,7 +524,7 @@ public class QTestUtil { db.createTable("dest3", cols, part_cols, TextInputFormat.class, IgnoreKeyTextOutputFormat.class); - Table dest3 = db.getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, "dest3"); + Table dest3 = db.getTable("dest3"); HashMap part_spec = new HashMap(); part_spec.put("ds", "2008-04-08"); @@ -512,7 +547,7 @@ public class QTestUtil { createSources(); } - CliSessionState ss = new CliSessionState(conf); + CliSessionState ss = new CliSessionState(new HiveConf(Driver.class)); assert ss != null; ss.in = System.in; @@ -973,6 +1008,7 @@ public class QTestUtil { for (int i = 0; i < qfiles.length; i++) { qt[i] = new QTestUtil(resDirs[i], logDirs[i]); qt[i].addFile(qfiles[i]); + qt[i].clearTestSideEffects(); } if (mt) { @@ -980,6 +1016,7 @@ public class QTestUtil { qt[0].cleanUp(); qt[0].createSources(); + qt[0].clearTestSideEffects(); QTRunner[] qtRunners = new QTestUtil.QTRunner[qfiles.length]; Thread[] qtThread = new Thread[qfiles.length]; diff --git ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java index ead8352..fab429b 100755 --- ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java +++ ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java @@ -18,6 +18,8 @@ package org.apache.hadoop.hive.ql.metadata; +import static org.apache.hadoop.hive.metastore.MetaStoreUtils.DEFAULT_DATABASE_NAME; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; @@ -29,6 +31,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.MetaStoreUtils; import org.apache.hadoop.hive.metastore.Warehouse; +import org.apache.hadoop.hive.metastore.api.Database; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat; import org.apache.hadoop.hive.serde.Constants; @@ -90,7 +93,7 @@ public class TestHive extends TestCase { e1.printStackTrace(); assertTrue("Unable to drop table", false); } - Table tbl = new Table(tableName); + Table tbl = new Table(DEFAULT_DATABASE_NAME, tableName); List fields = tbl.getCols(); fields.add(new FieldSchema("col1", Constants.INT_TYPE_NAME, @@ -158,6 +161,7 @@ public class TestHive extends TestCase { .getOwner(), ft.getOwner()); assertEquals("Table retention didn't match for table: " + tableName, tbl.getRetention(), ft.getRetention()); + String dbPath = wh.getDefaultDatabasePath(DEFAULT_DATABASE_NAME).toString(); assertEquals("Data location is not set correctly", wh .getDefaultTablePath(MetaStoreUtils.DEFAULT_DATABASE_NAME, tableName).toString(), ft.getDataLocation().toString()); @@ -205,7 +209,7 @@ public class TestHive extends TestCase { System.err.println(StringUtils.stringifyException(e1)); assertTrue("Unable to drop table", false); } - Table tbl = new Table(tableName); + Table tbl = new Table(DEFAULT_DATABASE_NAME, tableName); tbl.setInputFormatClass(SequenceFileInputFormat.class.getName()); tbl.setOutputFormatClass(SequenceFileOutputFormat.class.getName()); tbl.setSerializationLib(ThriftDeserializer.class.getName()); @@ -256,8 +260,7 @@ public class TestHive extends TestCase { } private static Table createTestTable(String dbName, String tableName) throws HiveException { - Table tbl = new Table(tableName); - tbl.setDbName(dbName); + Table tbl = new Table(dbName, tableName); tbl.setInputFormatClass(SequenceFileInputFormat.class.getName()); tbl.setOutputFormatClass(SequenceFileOutputFormat.class.getName()); tbl.setSerializationLib(ThriftDeserializer.class.getName()); @@ -283,8 +286,11 @@ public class TestHive extends TestCase { try { String dbName = "db_for_testgettables"; String table1Name = "table1"; - hm.dropDatabase(dbName); - hm.createDatabase(dbName, ""); + hm.dropDatabase(dbName, true, true); + + Database db = new Database(); + db.setName(dbName); + hm.createDatabase(db); List ts = new ArrayList(2); ts.add(table1Name); @@ -313,6 +319,10 @@ public class TestHive extends TestCase { hm.dropTable(dbName, table1Name); assertFalse(fs.exists(table1.getPath())); + // Drop all tables + for (String tableName : hm.getAllTables(dbName)) { + hm.dropTable(dbName, tableName); + } hm.dropDatabase(dbName); } catch (Throwable e) { System.err.println(StringUtils.stringifyException(e)); diff --git ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreChecker.java ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreChecker.java index 26cc71a..0a85530 100644 --- ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreChecker.java +++ ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreChecker.java @@ -11,8 +11,10 @@ import junit.framework.TestCase; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hive.metastore.api.AlreadyExistsException; +import org.apache.hadoop.hive.metastore.api.Database; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.MetaException; +import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat; import org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat; import org.apache.hadoop.hive.serde.Constants; @@ -60,7 +62,11 @@ public class TestHiveMetaStoreChecker extends TestCase { // cleanup hive.dropTable(dbName, tableName, true, true); - hive.dropDatabase(dbName); + try { + hive.dropDatabase(dbName); + } catch (NoSuchObjectException e) { + // ignore + } } @Override @@ -89,9 +95,11 @@ public class TestHiveMetaStoreChecker extends TestCase { assertTrue(result.getPartitionsNotOnFs().isEmpty()); assertTrue(result.getPartitionsNotInMs().isEmpty()); - hive.createDatabase(dbName, ""); + Database db = new Database(); + db.setName(dbName); + hive.createDatabase(db); - Table table = new Table(tableName); + Table table = new Table(dbName, tableName); table.setDbName(dbName); table.setInputFormatClass(TextInputFormat.class); table.setOutputFormatClass(HiveIgnoreKeyTextOutputFormat.class); @@ -159,10 +167,11 @@ public class TestHiveMetaStoreChecker extends TestCase { public void testPartitionsCheck() throws HiveException, MetaException, IOException, TException, AlreadyExistsException { - hive.createDatabase(dbName, ""); + Database db = new Database(); + db.setName(dbName); + hive.createDatabase(db); - Table table = new Table(tableName); - table.setDbName(dbName); + Table table = new Table(dbName, tableName); table.setInputFormatClass(TextInputFormat.class); table.setOutputFormatClass(HiveIgnoreKeyTextOutputFormat.class); table.setPartCols(partCols); diff --git ql/src/test/org/apache/hadoop/hive/ql/metadata/TestPartition.java ql/src/test/org/apache/hadoop/hive/ql/metadata/TestPartition.java index 790abf6..92d834d 100644 --- ql/src/test/org/apache/hadoop/hive/ql/metadata/TestPartition.java +++ ql/src/test/org/apache/hadoop/hive/ql/metadata/TestPartition.java @@ -39,7 +39,7 @@ public class TestPartition extends TestCase { List partCols = new ArrayList(); partCols.add(new FieldSchema(PARTITION_COL, "string", "")); - Table tbl = new Table(TABLENAME); + Table tbl = new Table("default", TABLENAME); tbl.setDataLocation(new URI("tmplocation")); tbl.setPartCols(partCols); diff --git ql/src/test/queries/clientnegative/database_create_already_exists.q ql/src/test/queries/clientnegative/database_create_already_exists.q new file mode 100644 index 0000000..3af7607 --- /dev/null +++ ql/src/test/queries/clientnegative/database_create_already_exists.q @@ -0,0 +1,5 @@ +SHOW DATABASES; + +-- Try to create a database that already exists +CREATE DATABASE test_db; +CREATE DATABASE test_db; diff --git ql/src/test/queries/clientnegative/database_create_invalid_name.q ql/src/test/queries/clientnegative/database_create_invalid_name.q new file mode 100644 index 0000000..5d67495 --- /dev/null +++ ql/src/test/queries/clientnegative/database_create_invalid_name.q @@ -0,0 +1,4 @@ +SHOW DATABASES; + +-- Try to create a database with an invalid name +CREATE DATABASE `test.db`; diff --git ql/src/test/queries/clientnegative/database_drop_does_not_exist.q ql/src/test/queries/clientnegative/database_drop_does_not_exist.q new file mode 100644 index 0000000..66a940e --- /dev/null +++ ql/src/test/queries/clientnegative/database_drop_does_not_exist.q @@ -0,0 +1,4 @@ +SHOW DATABASES; + +-- Try to drop a database that does not exist +DROP DATABASE does_not_exist; diff --git ql/src/test/queries/clientnegative/database_drop_not_empty.q ql/src/test/queries/clientnegative/database_drop_not_empty.q new file mode 100644 index 0000000..ae5a443 --- /dev/null +++ ql/src/test/queries/clientnegative/database_drop_not_empty.q @@ -0,0 +1,8 @@ +SHOW DATABASES; + +-- Try to drop a non-empty database +CREATE DATABASE test_db; +USE test_db; +CREATE TABLE t(a INT); +USE default; +DROP DATABASE test_db; diff --git ql/src/test/queries/clientnegative/database_switch_does_not_exist.q ql/src/test/queries/clientnegative/database_switch_does_not_exist.q new file mode 100644 index 0000000..5cd4697 --- /dev/null +++ ql/src/test/queries/clientnegative/database_switch_does_not_exist.q @@ -0,0 +1,4 @@ +SHOW DATABASES; + +-- Try to switch to a database that does not exist +USE does_not_exist; diff --git ql/src/test/queries/clientpositive/add_part_exist.q ql/src/test/queries/clientpositive/add_part_exist.q index 3c8120d..ae97384 100644 --- ql/src/test/queries/clientpositive/add_part_exist.q +++ ql/src/test/queries/clientpositive/add_part_exist.q @@ -14,3 +14,26 @@ ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-01') PARTITIO SHOW PARTITIONS add_part_test; DROP TABLE add_part_test; + +DROP TABLE add_part_test; +SHOW TABLES; + +-- Test ALTER TABLE ADD PARTITION in non-default Database +CREATE DATABASE add_part_test_db; +USE add_part_test_db; +SHOW TABLES; + +CREATE TABLE add_part_test (key STRING, value STRING) PARTITIONED BY (ds STRING); +SHOW PARTITIONS add_part_test; + +ALTER TABLE add_part_test ADD PARTITION (ds='2010-01-01'); +SHOW PARTITIONS add_part_test; + +ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-01'); +SHOW PARTITIONS add_part_test; + +ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-02'); +SHOW PARTITIONS add_part_test; + +ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-01') PARTITION (ds='2010-01-02') PARTITION (ds='2010-01-03'); +SHOW PARTITIONS add_part_test; diff --git ql/src/test/queries/clientpositive/alter1.q ql/src/test/queries/clientpositive/alter1.q index 485dec6..935e257 100644 --- ql/src/test/queries/clientpositive/alter1.q +++ ql/src/test/queries/clientpositive/alter1.q @@ -27,3 +27,48 @@ alter table alter1 replace columns (a int, b int, c string); describe alter1; drop table alter1; + +-- Cleanup +DROP TABLE alter1; +SHOW TABLES; + +-- With non-default Database + +CREATE DATABASE alter1_db; +USE alter1_db; +SHOW TABLES; + +CREATE TABLE alter1(a INT, b INT); +DESCRIBE EXTENDED alter1; + +ALTER TABLE alter1 SET TBLPROPERTIES ('a'='1', 'c'='3'); +DESCRIBE EXTENDED alter1; + +ALTER TABLE alter1 SET TBLPROPERTIES ('a'='1', 'c'='4', 'd'='3'); +DESCRIBE EXTENDED alter1; + +ALTER TABLE alter1 SET TBLPROPERTIES ('EXTERNAL'='TRUE'); +DESCRIBE EXTENDED alter1; + +ALTER TABLE alter1 SET TBLPROPERTIES ('EXTERNAL'='FALSE'); +DESCRIBE EXTENDED alter1; + +ALTER TABLE alter1 SET SERDEPROPERTIES('s1'='9'); +DESCRIBE EXTENDED alter1; + +ALTER TABLE alter1 SET SERDEPROPERTIES('s1'='10', 's2' ='20'); +DESCRIBE EXTENDED alter1; + +add jar ../data/files/TestSerDe.jar; +ALTER TABLE alter1 SET SERDE 'org.apache.hadoop.hive.serde2.TestSerDe' WITH SERDEPROPERTIES ('s1'='9'); +DESCRIBE EXTENDED alter1; + +ALTER TABLE alter1 SET SERDE 'org.apache.hadoop.hive.serde2.MetadataTypedColumnsetSerDe'; +DESCRIBE EXTENDED alter1; + +ALTER TABLE alter1 REPLACE COLUMNS (a int, b int, c string); +DESCRIBE alter1; + +DROP TABLE alter1; +USE default; +DROP DATABASE alter1_db; diff --git ql/src/test/queries/clientpositive/alter2.q ql/src/test/queries/clientpositive/alter2.q index 8568970..ffc2a0f 100644 --- ql/src/test/queries/clientpositive/alter2.q +++ ql/src/test/queries/clientpositive/alter2.q @@ -19,4 +19,39 @@ show partitions alter2; alter table alter2 add partition (insertdate='2008-01-02') location '2008/01/02'; describe extended alter2; show partitions alter2; -drop table alter2; \ No newline at end of file +drop table alter2; + +-- Cleanup +DROP TABLE alter2; +SHOW TABLES; + +-- Using non-default Database + +CREATE DATABASE alter2_db; +USE alter2_db; +SHOW TABLES; + +CREATE TABLE alter2(a int, b int) PARTITIONED BY (insertdate string); +DESCRIBE EXTENDED alter2; +SHOW PARTITIONS alter2; +ALTER TABLE alter2 ADD PARTITION (insertdate='2008-01-01') LOCATION '2008/01/01'; +DESCRIBE EXTENDED alter2; +SHOW PARTITIONS alter2; +ALTER TABLE alter2 ADD PARTITION (insertdate='2008-01-02') LOCATION '2008/01/02'; +DESCRIBE EXTENDED alter2; +SHOW PARTITIONS alter2; +DROP TABLE alter2; + +CREATE EXTERNAL TABLE alter2(a int, b int) PARTITIONED BY (insertdate string); +DESCRIBE EXTENDED alter2; +SHOW PARTITIONS alter2; +ALTER TABLE alter2 ADD PARTITION (insertdate='2008-01-01') LOCATION '2008/01/01'; +DESCRIBE EXTENDED alter2; +SHOW PARTITIONS alter2; +ALTER TABLE alter2 ADD PARTITION (insertdate='2008-01-02') LOCATION '2008/01/02'; +DESCRIBE EXTENDED alter2; +SHOW PARTITIONS alter2; + +DROP TABLE alter2; +USE default; +DROP DATABASE alter2_db; diff --git ql/src/test/queries/clientpositive/alter3.q ql/src/test/queries/clientpositive/alter3.q index bc97f21..248410f 100644 --- ql/src/test/queries/clientpositive/alter3.q +++ ql/src/test/queries/clientpositive/alter3.q @@ -29,3 +29,37 @@ drop table alter3_src; drop table alter3; drop table alter3_renamed; drop table alter3_like_renamed; + +-- Cleanup +DROP TABLE alter3_src; +DROP TABLE alter3_renamed; +DROP TABLE alter3_like_renamed; +SHOW TABLES; + +-- With non-default Database + +CREATE DATABASE alter3_db; +USE alter3_db; +SHOW TABLES; + +CREATE TABLE alter3_src (col1 STRING) STORED AS TEXTFILE ; +LOAD DATA LOCAL INPATH '../data/files/test.dat' OVERWRITE INTO TABLE alter3_src ; + +CREATE TABLE alter3 (col1 STRING) PARTITIONED BY (pcol1 STRING, pcol2 STRING) STORED AS SEQUENCEFILE; + +CREATE TABLE alter3_like LIKE alter3; + +INSERT OVERWRITE TABLE alter3 PARTITION (pCol1='test_part', pcol2='test_part') SELECT col1 FROM alter3_src ; +SELECT * FROM alter3 WHERE pcol1='test_part' AND pcol2='test_part'; + +ALTER TABLE alter3 RENAME TO alter3_renamed; +DESCRIBE EXTENDED alter3_renamed; +DESCRIBE EXTENDED alter3_renamed PARTITION (pCol1='test_part', pcol2='test_part'); +SELECT * FROM alter3_renamed WHERE pcol1='test_part' AND pcol2='test_part'; + +INSERT OVERWRITE TABLE alter3_like +PARTITION (pCol1='test_part', pcol2='test_part') +SELECT col1 FROM alter3_src; +ALTER TABLE alter3_like RENAME TO alter3_like_renamed; + +DESCRIBE EXTENDED alter3_like_renamed; diff --git ql/src/test/queries/clientpositive/database.q ql/src/test/queries/clientpositive/database.q new file mode 100644 index 0000000..2b6c911 --- /dev/null +++ ql/src/test/queries/clientpositive/database.q @@ -0,0 +1,91 @@ +SHOW DATABASES; + +-- CREATE with comment +CREATE DATABASE test_db COMMENT 'Hive test database'; +SHOW DATABASES; + +-- CREATE INE already exists +CREATE DATABASE IF NOT EXISTS test_db; +SHOW DATABASES; + +-- SHOW DATABASES synonym +SHOW SCHEMAS; + +-- DROP +DROP DATABASE test_db; +SHOW DATABASES; + +-- CREATE INE doesn't exist +CREATE DATABASE IF NOT EXISTS test_db COMMENT 'Hive test database'; +SHOW DATABASES; + +-- DROP IE exists +DROP DATABASE IF EXISTS test_db; +SHOW DATABASES; + +-- DROP IE doesn't exist +DROP DATABASE IF EXISTS test_db; + +-- SHOW +CREATE DATABASE test_db; +SHOW DATABASES; + +-- SHOW pattern +SHOW DATABASES LIKE 'test*'; + +-- SHOW pattern +SHOW DATABASES LIKE '*ef*'; + + +USE test_db; +SHOW DATABASES; + +-- CREATE table in non-default DB +CREATE TABLE test_table (col1 STRING) STORED AS TEXTFILE; +SHOW TABLES; + +-- DESCRIBE table in non-default DB +DESCRIBE test_table; + +-- DESCRIBE EXTENDED in non-default DB +DESCRIBE EXTENDED test_table; + +-- CREATE LIKE in non-default DB +CREATE TABLE test_table_like LIKE test_table; +SHOW TABLES; +DESCRIBE EXTENDED test_table_like; + +-- LOAD and SELECT +LOAD DATA LOCAL INPATH '../data/files/test.dat' OVERWRITE INTO TABLE test_table ; +SELECT * FROM test_table; + +-- DROP and CREATE w/o LOAD +DROP TABLE test_table; +SHOW TABLES; + +CREATE TABLE test_table (col1 STRING) STORED AS TEXTFILE; +SHOW TABLES; + +SELECT * FROM test_table; + +-- CREATE table that already exists in DEFAULT +USE test_db; +CREATE TABLE src (col1 STRING) STORED AS TEXTFILE; +SHOW TABLES; + +SELECT * FROM src LIMIT 10; + +USE default; +SELECT * FROM src LIMIT 10; + +-- DROP DATABASE +USE test_db; + +DROP TABLE src; +DROP TABLE test_table; +DROP TABLE test_table_like; +SHOW TABLES; + +USE default; +DROP DATABASE test_db; +SHOW DATABASES; diff --git ql/src/test/queries/clientpositive/rename_column.q ql/src/test/queries/clientpositive/rename_column.q index e982ebc..dfc8c11 100644 --- ql/src/test/queries/clientpositive/rename_column.q +++ ql/src/test/queries/clientpositive/rename_column.q @@ -24,3 +24,36 @@ DESCRIBE kv_rename_test; DROP TABLE kv_rename_test; +DROP TABLE kv_rename_test; +SHOW TABLES; + +-- Using non-default Database +CREATE DATABASE kv_rename_test_db; +USE kv_rename_test_db; + +CREATE TABLE kv_rename_test(a int, b int, c int); +DESCRIBE kv_rename_test; + +ALTER TABLE kv_rename_test CHANGE a a STRING; +DESCRIBE kv_rename_test; + +ALTER TABLE kv_rename_test CHANGE a a1 INT; +DESCRIBE kv_rename_test; + +ALTER TABLE kv_rename_test CHANGE a1 a2 INT FIRST; +DESCRIBE kv_rename_test; + +ALTER TABLE kv_rename_test CHANGE a2 a INT AFTER b; +DESCRIBE kv_rename_test; + +ALTER TABLE kv_rename_test CHANGE a a1 INT COMMENT 'test comment1'; +DESCRIBE kv_rename_test; + +ALTER TABLE kv_rename_test CHANGE a1 a2 INT COMMENT 'test comment2' FIRST; +DESCRIBE kv_rename_test; + +ALTER TABLE kv_rename_test CHANGE COLUMN a2 a INT AFTER b; +DESCRIBE kv_rename_test; + +DROP TABLE kv_rename_test; +SHOW TABLES; diff --git ql/src/test/results/clientnegative/database_create_already_exists.q.out ql/src/test/results/clientnegative/database_create_already_exists.q.out new file mode 100644 index 0000000..08c04f9 --- /dev/null +++ ql/src/test/results/clientnegative/database_create_already_exists.q.out @@ -0,0 +1,15 @@ +PREHOOK: query: SHOW DATABASES +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: SHOW DATABASES +POSTHOOK: type: SHOWDATABASES +default +PREHOOK: query: -- Try to create a database that already exists +CREATE DATABASE test_db +PREHOOK: type: CREATEDATABASE +POSTHOOK: query: -- Try to create a database that already exists +CREATE DATABASE test_db +POSTHOOK: type: CREATEDATABASE +PREHOOK: query: CREATE DATABASE test_db +PREHOOK: type: CREATEDATABASE +Failed with exception Database test_db already exists +FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask diff --git ql/src/test/results/clientnegative/database_create_invalid_name.q.out ql/src/test/results/clientnegative/database_create_invalid_name.q.out new file mode 100644 index 0000000..1e58089 --- /dev/null +++ ql/src/test/results/clientnegative/database_create_invalid_name.q.out @@ -0,0 +1,10 @@ +PREHOOK: query: SHOW DATABASES +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: SHOW DATABASES +POSTHOOK: type: SHOWDATABASES +default +PREHOOK: query: -- Try to create a database with an invalid name +CREATE DATABASE `test.db` +PREHOOK: type: CREATEDATABASE +FAILED: Error in metadata: InvalidObjectException(message:test.db is not a valid database name) +FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask diff --git ql/src/test/results/clientnegative/database_drop_does_not_exist.q.out ql/src/test/results/clientnegative/database_drop_does_not_exist.q.out new file mode 100644 index 0000000..80c00cd --- /dev/null +++ ql/src/test/results/clientnegative/database_drop_does_not_exist.q.out @@ -0,0 +1,10 @@ +PREHOOK: query: SHOW DATABASES +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: SHOW DATABASES +POSTHOOK: type: SHOWDATABASES +default +PREHOOK: query: -- Try to drop a database that does not exist +DROP DATABASE does_not_exist +PREHOOK: type: DROPDATABASE +Failed with exception There is no database named does_not_exist +FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask diff --git ql/src/test/results/clientnegative/database_drop_not_empty.q.out ql/src/test/results/clientnegative/database_drop_not_empty.q.out new file mode 100644 index 0000000..baa8f37 --- /dev/null +++ ql/src/test/results/clientnegative/database_drop_not_empty.q.out @@ -0,0 +1,28 @@ +PREHOOK: query: SHOW DATABASES +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: SHOW DATABASES +POSTHOOK: type: SHOWDATABASES +default +PREHOOK: query: -- Try to drop a non-empty database +CREATE DATABASE test_db +PREHOOK: type: CREATEDATABASE +POSTHOOK: query: -- Try to drop a non-empty database +CREATE DATABASE test_db +POSTHOOK: type: CREATEDATABASE +PREHOOK: query: USE test_db +PREHOOK: type: SWITCHDATABASE +POSTHOOK: query: USE test_db +POSTHOOK: type: SWITCHDATABASE +PREHOOK: query: CREATE TABLE t(a INT) +PREHOOK: type: CREATETABLE +POSTHOOK: query: CREATE TABLE t(a INT) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: test_db@t +PREHOOK: query: USE default +PREHOOK: type: SWITCHDATABASE +POSTHOOK: query: USE default +POSTHOOK: type: SWITCHDATABASE +PREHOOK: query: DROP DATABASE test_db +PREHOOK: type: DROPDATABASE +FAILED: Error in metadata: InvalidOperationException(message:Database test_db is not empty) +FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask diff --git ql/src/test/results/clientnegative/database_switch_does_not_exist.q.out ql/src/test/results/clientnegative/database_switch_does_not_exist.q.out new file mode 100644 index 0000000..8b5674d --- /dev/null +++ ql/src/test/results/clientnegative/database_switch_does_not_exist.q.out @@ -0,0 +1,10 @@ +PREHOOK: query: SHOW DATABASES +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: SHOW DATABASES +POSTHOOK: type: SHOWDATABASES +default +PREHOOK: query: -- Try to switch to a database that does not exist +USE does_not_exist +PREHOOK: type: SWITCHDATABASE +FAILED: Error in metadata: ERROR: The database does_not_exist does not exist. +FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask diff --git ql/src/test/results/clientpositive/add_part_exist.q.out ql/src/test/results/clientpositive/add_part_exist.q.out index 47edf68..da39098 100644 --- ql/src/test/results/clientpositive/add_part_exist.q.out +++ ql/src/test/results/clientpositive/add_part_exist.q.out @@ -54,3 +54,84 @@ PREHOOK: type: DROPTABLE POSTHOOK: query: DROP TABLE add_part_test POSTHOOK: type: DROPTABLE POSTHOOK: Output: default@add_part_test +PREHOOK: query: DROP TABLE add_part_test +PREHOOK: type: DROPTABLE +POSTHOOK: query: DROP TABLE add_part_test +POSTHOOK: type: DROPTABLE +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +src +src1 +src_json +src_sequencefile +src_thrift +srcbucket +srcbucket2 +srcpart +PREHOOK: query: -- Test ALTER TABLE ADD PARTITION in non-default Database +CREATE DATABASE add_part_test_db +PREHOOK: type: CREATEDATABASE +POSTHOOK: query: -- Test ALTER TABLE ADD PARTITION in non-default Database +CREATE DATABASE add_part_test_db +POSTHOOK: type: CREATEDATABASE +PREHOOK: query: USE add_part_test_db +PREHOOK: type: SWITCHDATABASE +POSTHOOK: query: USE add_part_test_db +POSTHOOK: type: SWITCHDATABASE +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +PREHOOK: query: CREATE TABLE add_part_test (key STRING, value STRING) PARTITIONED BY (ds STRING) +PREHOOK: type: CREATETABLE +POSTHOOK: query: CREATE TABLE add_part_test (key STRING, value STRING) PARTITIONED BY (ds STRING) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: add_part_test_db@add_part_test +PREHOOK: query: SHOW PARTITIONS add_part_test +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: SHOW PARTITIONS add_part_test +POSTHOOK: type: SHOWPARTITIONS +PREHOOK: query: ALTER TABLE add_part_test ADD PARTITION (ds='2010-01-01') +PREHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: query: ALTER TABLE add_part_test ADD PARTITION (ds='2010-01-01') +POSTHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: Output: add_part_test_db@add_part_test@ds=2010-01-01 +PREHOOK: query: SHOW PARTITIONS add_part_test +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: SHOW PARTITIONS add_part_test +POSTHOOK: type: SHOWPARTITIONS +ds=2010-01-01 +PREHOOK: query: ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-01') +PREHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: query: ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-01') +POSTHOOK: type: ALTERTABLE_ADDPARTS +PREHOOK: query: SHOW PARTITIONS add_part_test +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: SHOW PARTITIONS add_part_test +POSTHOOK: type: SHOWPARTITIONS +ds=2010-01-01 +PREHOOK: query: ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-02') +PREHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: query: ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-02') +POSTHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: Output: add_part_test_db@add_part_test@ds=2010-01-02 +PREHOOK: query: SHOW PARTITIONS add_part_test +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: SHOW PARTITIONS add_part_test +POSTHOOK: type: SHOWPARTITIONS +ds=2010-01-01 +ds=2010-01-02 +PREHOOK: query: ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-01') PARTITION (ds='2010-01-02') PARTITION (ds='2010-01-03') +PREHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: query: ALTER TABLE add_part_test ADD IF NOT EXISTS PARTITION (ds='2010-01-01') PARTITION (ds='2010-01-02') PARTITION (ds='2010-01-03') +POSTHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: Output: add_part_test_db@add_part_test@ds=2010-01-03 +PREHOOK: query: SHOW PARTITIONS add_part_test +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: SHOW PARTITIONS add_part_test +POSTHOOK: type: SHOWPARTITIONS +ds=2010-01-01 +ds=2010-01-02 +ds=2010-01-03 diff --git ql/src/test/results/clientpositive/alter1.q.out ql/src/test/results/clientpositive/alter1.q.out index 648459c..a4afdcb 100644 --- ql/src/test/results/clientpositive/alter1.q.out +++ ql/src/test/results/clientpositive/alter1.q.out @@ -14,7 +14,7 @@ POSTHOOK: type: DESCTABLE a int b int -Detailed Table Information Table(tableName:alter1, dbName:default, owner:jsichi, createTime:1272933245, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1272933245}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +Detailed Table Information Table(tableName:alter1, dbName:default, owner:carl, createTime:1284507368, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1284507368}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: alter table alter1 set tblproperties ('a'='1', 'c'='3') PREHOOK: type: ALTERTABLE_PROPERTIES POSTHOOK: query: alter table alter1 set tblproperties ('a'='1', 'c'='3') @@ -28,7 +28,7 @@ POSTHOOK: type: DESCTABLE a int b int -Detailed Table Information Table(tableName:alter1, dbName:default, owner:jsichi, createTime:1272933245, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{last_modified_by=jsichi,c=3,last_modified_time=1272933245,a=1,transient_lastDdlTime=1272933245}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +Detailed Table Information Table(tableName:alter1, dbName:default, owner:carl, createTime:1284507368, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{last_modified_by=carl, c=3, last_modified_time=1284507369, a=1, transient_lastDdlTime=1284507369}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: alter table alter1 set tblproperties ('a'='1', 'c'='4', 'd'='3') PREHOOK: type: ALTERTABLE_PROPERTIES POSTHOOK: query: alter table alter1 set tblproperties ('a'='1', 'c'='4', 'd'='3') @@ -42,7 +42,7 @@ POSTHOOK: type: DESCTABLE a int b int -Detailed Table Information Table(tableName:alter1, dbName:default, owner:jsichi, createTime:1272933245, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{d=3,last_modified_by=jsichi,c=4,last_modified_time=1272933245,a=1,transient_lastDdlTime=1272933245}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +Detailed Table Information Table(tableName:alter1, dbName:default, owner:carl, createTime:1284507368, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{d=3, last_modified_by=carl, c=4, last_modified_time=1284507369, a=1, transient_lastDdlTime=1284507369}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: alter table alter1 set tblproperties ('EXTERNAL'='TRUE') PREHOOK: type: ALTERTABLE_PROPERTIES POSTHOOK: query: alter table alter1 set tblproperties ('EXTERNAL'='TRUE') @@ -56,7 +56,7 @@ POSTHOOK: type: DESCTABLE a int b int -Detailed Table Information Table(tableName:alter1, dbName:default, owner:jsichi, createTime:1272933245, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{d=3,EXTERNAL=TRUE,last_modified_by=jsichi,c=4,last_modified_time=1272933245,a=1,transient_lastDdlTime=1272933245}, viewOriginalText:null, viewExpandedText:null, tableType:EXTERNAL_TABLE) +Detailed Table Information Table(tableName:alter1, dbName:default, owner:carl, createTime:1284507368, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{EXTERNAL=TRUE, d=3, last_modified_by=carl, c=4, last_modified_time=1284507369, a=1, transient_lastDdlTime=1284507369}, viewOriginalText:null, viewExpandedText:null, tableType:EXTERNAL_TABLE) PREHOOK: query: alter table alter1 set tblproperties ('EXTERNAL'='FALSE') PREHOOK: type: ALTERTABLE_PROPERTIES POSTHOOK: query: alter table alter1 set tblproperties ('EXTERNAL'='FALSE') @@ -70,7 +70,7 @@ POSTHOOK: type: DESCTABLE a int b int -Detailed Table Information Table(tableName:alter1, dbName:default, owner:jsichi, createTime:1272933245, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{d=3,EXTERNAL=FALSE,last_modified_by=jsichi,c=4,last_modified_time=1272933246,a=1,transient_lastDdlTime=1272933246}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +Detailed Table Information Table(tableName:alter1, dbName:default, owner:carl, createTime:1284507368, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{EXTERNAL=FALSE, d=3, last_modified_by=carl, c=4, last_modified_time=1284507369, a=1, transient_lastDdlTime=1284507369}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: alter table alter1 set serdeproperties('s1'='9') PREHOOK: type: ALTERTABLE_SERDEPROPERTIES POSTHOOK: query: alter table alter1 set serdeproperties('s1'='9') @@ -84,7 +84,7 @@ POSTHOOK: type: DESCTABLE a int b int -Detailed Table Information Table(tableName:alter1, dbName:default, owner:jsichi, createTime:1272933245, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{s1=9,serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{d=3,EXTERNAL=FALSE,last_modified_by=jsichi,c=4,last_modified_time=1272933246,a=1,transient_lastDdlTime=1272933246}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +Detailed Table Information Table(tableName:alter1, dbName:default, owner:carl, createTime:1284507368, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{s1=9, serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{EXTERNAL=FALSE, d=3, last_modified_by=carl, c=4, last_modified_time=1284507369, a=1, transient_lastDdlTime=1284507369}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: alter table alter1 set serdeproperties('s1'='10', 's2' ='20') PREHOOK: type: ALTERTABLE_SERDEPROPERTIES POSTHOOK: query: alter table alter1 set serdeproperties('s1'='10', 's2' ='20') @@ -98,7 +98,7 @@ POSTHOOK: type: DESCTABLE a int b int -Detailed Table Information Table(tableName:alter1, dbName:default, owner:jsichi, createTime:1272933245, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{s2=20,s1=10,serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{d=3,EXTERNAL=FALSE,last_modified_by=jsichi,c=4,last_modified_time=1272933246,a=1,transient_lastDdlTime=1272933246}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +Detailed Table Information Table(tableName:alter1, dbName:default, owner:carl, createTime:1284507368, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{s2=20, s1=10, serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{EXTERNAL=FALSE, d=3, last_modified_by=carl, c=4, last_modified_time=1284507370, a=1, transient_lastDdlTime=1284507370}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: alter table alter1 set serde 'org.apache.hadoop.hive.serde2.TestSerDe' with serdeproperties('s1'='9') PREHOOK: type: ALTERTABLE_SERIALIZER POSTHOOK: query: alter table alter1 set serde 'org.apache.hadoop.hive.serde2.TestSerDe' with serdeproperties('s1'='9') @@ -112,7 +112,7 @@ POSTHOOK: type: DESCTABLE a string from deserializer b string from deserializer -Detailed Table Information Table(tableName:alter1, dbName:default, owner:jsichi, createTime:1272933245, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:from deserializer), FieldSchema(name:b, type:int, comment:from deserializer)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.TestSerDe, parameters:{s2=20,s1=9,serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{d=3,EXTERNAL=FALSE,last_modified_by=jsichi,c=4,last_modified_time=1272933246,a=1,transient_lastDdlTime=1272933246}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +Detailed Table Information Table(tableName:alter1, dbName:default, owner:carl, createTime:1284507368, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:from deserializer), FieldSchema(name:b, type:int, comment:from deserializer)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.TestSerDe, parameters:{s2=20, s1=9, serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{EXTERNAL=FALSE, d=3, last_modified_by=carl, c=4, last_modified_time=1284507370, a=1, transient_lastDdlTime=1284507370}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: alter table alter1 set serde 'org.apache.hadoop.hive.serde2.MetadataTypedColumnsetSerDe' PREHOOK: type: ALTERTABLE_SERIALIZER POSTHOOK: query: alter table alter1 set serde 'org.apache.hadoop.hive.serde2.MetadataTypedColumnsetSerDe' @@ -126,7 +126,7 @@ POSTHOOK: type: DESCTABLE a string from deserializer b string from deserializer -Detailed Table Information Table(tableName:alter1, dbName:default, owner:jsichi, createTime:1272933245, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:string, comment:from deserializer), FieldSchema(name:b, type:string, comment:from deserializer)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{s2=20,s1=9,serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{d=3,EXTERNAL=FALSE,last_modified_by=jsichi,c=4,last_modified_time=1272933246,a=1,transient_lastDdlTime=1272933246}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +Detailed Table Information Table(tableName:alter1, dbName:default, owner:carl, createTime:1284507368, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:string, comment:from deserializer), FieldSchema(name:b, type:string, comment:from deserializer)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{s2=20, s1=9, serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{EXTERNAL=FALSE, d=3, last_modified_by=carl, c=4, last_modified_time=1284507370, a=1, transient_lastDdlTime=1284507370}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: alter table alter1 replace columns (a int, b int, c string) PREHOOK: type: ALTERTABLE_REPLACECOLS POSTHOOK: query: alter table alter1 replace columns (a int, b int, c string) @@ -145,3 +145,188 @@ PREHOOK: type: DROPTABLE POSTHOOK: query: drop table alter1 POSTHOOK: type: DROPTABLE POSTHOOK: Output: default@alter1 +PREHOOK: query: -- Cleanup +DROP TABLE alter1 +PREHOOK: type: DROPTABLE +POSTHOOK: query: -- Cleanup +DROP TABLE alter1 +POSTHOOK: type: DROPTABLE +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +src +src1 +src_json +src_sequencefile +src_thrift +srcbucket +srcbucket2 +srcpart +PREHOOK: query: -- With non-default Database + +CREATE DATABASE alter1_db +PREHOOK: type: CREATEDATABASE +POSTHOOK: query: -- With non-default Database + +CREATE DATABASE alter1_db +POSTHOOK: type: CREATEDATABASE +PREHOOK: query: USE alter1_db +PREHOOK: type: SWITCHDATABASE +POSTHOOK: query: USE alter1_db +POSTHOOK: type: SWITCHDATABASE +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +PREHOOK: query: CREATE TABLE alter1(a INT, b INT) +PREHOOK: type: CREATETABLE +POSTHOOK: query: CREATE TABLE alter1(a INT, b INT) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: alter1_db@alter1 +PREHOOK: query: DESCRIBE EXTENDED alter1 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter1 +POSTHOOK: type: DESCTABLE +a int +b int + +Detailed Table Information Table(tableName:alter1, dbName:alter1_db, owner:carl, createTime:1284507371, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1_db.db/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1284507371}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +PREHOOK: query: ALTER TABLE alter1 SET TBLPROPERTIES ('a'='1', 'c'='3') +PREHOOK: type: ALTERTABLE_PROPERTIES +POSTHOOK: query: ALTER TABLE alter1 SET TBLPROPERTIES ('a'='1', 'c'='3') +POSTHOOK: type: ALTERTABLE_PROPERTIES +POSTHOOK: Input: alter1_db@alter1 +POSTHOOK: Output: alter1_db@alter1 +PREHOOK: query: DESCRIBE EXTENDED alter1 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter1 +POSTHOOK: type: DESCTABLE +a int +b int + +Detailed Table Information Table(tableName:alter1, dbName:alter1_db, owner:carl, createTime:1284507371, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1_db.db/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{last_modified_by=carl, c=3, last_modified_time=1284507371, a=1, transient_lastDdlTime=1284507371}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +PREHOOK: query: ALTER TABLE alter1 SET TBLPROPERTIES ('a'='1', 'c'='4', 'd'='3') +PREHOOK: type: ALTERTABLE_PROPERTIES +POSTHOOK: query: ALTER TABLE alter1 SET TBLPROPERTIES ('a'='1', 'c'='4', 'd'='3') +POSTHOOK: type: ALTERTABLE_PROPERTIES +POSTHOOK: Input: alter1_db@alter1 +POSTHOOK: Output: alter1_db@alter1 +PREHOOK: query: DESCRIBE EXTENDED alter1 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter1 +POSTHOOK: type: DESCTABLE +a int +b int + +Detailed Table Information Table(tableName:alter1, dbName:alter1_db, owner:carl, createTime:1284507371, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1_db.db/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{d=3, last_modified_by=carl, c=4, last_modified_time=1284507371, a=1, transient_lastDdlTime=1284507371}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +PREHOOK: query: ALTER TABLE alter1 SET TBLPROPERTIES ('EXTERNAL'='TRUE') +PREHOOK: type: ALTERTABLE_PROPERTIES +POSTHOOK: query: ALTER TABLE alter1 SET TBLPROPERTIES ('EXTERNAL'='TRUE') +POSTHOOK: type: ALTERTABLE_PROPERTIES +POSTHOOK: Input: alter1_db@alter1 +POSTHOOK: Output: alter1_db@alter1 +PREHOOK: query: DESCRIBE EXTENDED alter1 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter1 +POSTHOOK: type: DESCTABLE +a int +b int + +Detailed Table Information Table(tableName:alter1, dbName:alter1_db, owner:carl, createTime:1284507371, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1_db.db/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{EXTERNAL=TRUE, d=3, last_modified_by=carl, c=4, last_modified_time=1284507371, a=1, transient_lastDdlTime=1284507371}, viewOriginalText:null, viewExpandedText:null, tableType:EXTERNAL_TABLE) +PREHOOK: query: ALTER TABLE alter1 SET TBLPROPERTIES ('EXTERNAL'='FALSE') +PREHOOK: type: ALTERTABLE_PROPERTIES +POSTHOOK: query: ALTER TABLE alter1 SET TBLPROPERTIES ('EXTERNAL'='FALSE') +POSTHOOK: type: ALTERTABLE_PROPERTIES +POSTHOOK: Input: alter1_db@alter1 +POSTHOOK: Output: alter1_db@alter1 +PREHOOK: query: DESCRIBE EXTENDED alter1 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter1 +POSTHOOK: type: DESCTABLE +a int +b int + +Detailed Table Information Table(tableName:alter1, dbName:alter1_db, owner:carl, createTime:1284507371, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1_db.db/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{EXTERNAL=FALSE, d=3, last_modified_by=carl, c=4, last_modified_time=1284507371, a=1, transient_lastDdlTime=1284507371}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +PREHOOK: query: ALTER TABLE alter1 SET SERDEPROPERTIES('s1'='9') +PREHOOK: type: ALTERTABLE_SERDEPROPERTIES +POSTHOOK: query: ALTER TABLE alter1 SET SERDEPROPERTIES('s1'='9') +POSTHOOK: type: ALTERTABLE_SERDEPROPERTIES +POSTHOOK: Input: alter1_db@alter1 +POSTHOOK: Output: alter1_db@alter1 +PREHOOK: query: DESCRIBE EXTENDED alter1 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter1 +POSTHOOK: type: DESCTABLE +a int +b int + +Detailed Table Information Table(tableName:alter1, dbName:alter1_db, owner:carl, createTime:1284507371, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1_db.db/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{s1=9, serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{EXTERNAL=FALSE, d=3, last_modified_by=carl, c=4, last_modified_time=1284507371, a=1, transient_lastDdlTime=1284507371}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +PREHOOK: query: ALTER TABLE alter1 SET SERDEPROPERTIES('s1'='10', 's2' ='20') +PREHOOK: type: ALTERTABLE_SERDEPROPERTIES +POSTHOOK: query: ALTER TABLE alter1 SET SERDEPROPERTIES('s1'='10', 's2' ='20') +POSTHOOK: type: ALTERTABLE_SERDEPROPERTIES +POSTHOOK: Input: alter1_db@alter1 +POSTHOOK: Output: alter1_db@alter1 +PREHOOK: query: DESCRIBE EXTENDED alter1 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter1 +POSTHOOK: type: DESCTABLE +a int +b int + +Detailed Table Information Table(tableName:alter1, dbName:alter1_db, owner:carl, createTime:1284507371, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1_db.db/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{s2=20, s1=10, serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{EXTERNAL=FALSE, d=3, last_modified_by=carl, c=4, last_modified_time=1284507371, a=1, transient_lastDdlTime=1284507371}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +PREHOOK: query: ALTER TABLE alter1 SET SERDE 'org.apache.hadoop.hive.serde2.TestSerDe' WITH SERDEPROPERTIES ('s1'='9') +PREHOOK: type: ALTERTABLE_SERIALIZER +POSTHOOK: query: ALTER TABLE alter1 SET SERDE 'org.apache.hadoop.hive.serde2.TestSerDe' WITH SERDEPROPERTIES ('s1'='9') +POSTHOOK: type: ALTERTABLE_SERIALIZER +POSTHOOK: Input: alter1_db@alter1 +POSTHOOK: Output: alter1_db@alter1 +PREHOOK: query: DESCRIBE EXTENDED alter1 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter1 +POSTHOOK: type: DESCTABLE +a string from deserializer +b string from deserializer + +Detailed Table Information Table(tableName:alter1, dbName:alter1_db, owner:carl, createTime:1284507371, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:from deserializer), FieldSchema(name:b, type:int, comment:from deserializer)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1_db.db/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.TestSerDe, parameters:{s2=20, s1=9, serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{EXTERNAL=FALSE, d=3, last_modified_by=carl, c=4, last_modified_time=1284507372, a=1, transient_lastDdlTime=1284507372}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +PREHOOK: query: ALTER TABLE alter1 SET SERDE 'org.apache.hadoop.hive.serde2.MetadataTypedColumnsetSerDe' +PREHOOK: type: ALTERTABLE_SERIALIZER +POSTHOOK: query: ALTER TABLE alter1 SET SERDE 'org.apache.hadoop.hive.serde2.MetadataTypedColumnsetSerDe' +POSTHOOK: type: ALTERTABLE_SERIALIZER +POSTHOOK: Input: alter1_db@alter1 +POSTHOOK: Output: alter1_db@alter1 +PREHOOK: query: DESCRIBE EXTENDED alter1 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter1 +POSTHOOK: type: DESCTABLE +a string from deserializer +b string from deserializer + +Detailed Table Information Table(tableName:alter1, dbName:alter1_db, owner:carl, createTime:1284507371, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:string, comment:from deserializer), FieldSchema(name:b, type:string, comment:from deserializer)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter1_db.db/alter1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{s2=20, s1=9, serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{EXTERNAL=FALSE, d=3, last_modified_by=carl, c=4, last_modified_time=1284507372, a=1, transient_lastDdlTime=1284507372}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +PREHOOK: query: ALTER TABLE alter1 REPLACE COLUMNS (a int, b int, c string) +PREHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: query: ALTER TABLE alter1 REPLACE COLUMNS (a int, b int, c string) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: alter1_db@alter1 +POSTHOOK: Output: alter1_db@alter1 +PREHOOK: query: DESCRIBE alter1 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE alter1 +POSTHOOK: type: DESCTABLE +a int +b int +c string +PREHOOK: query: DROP TABLE alter1 +PREHOOK: type: DROPTABLE +POSTHOOK: query: DROP TABLE alter1 +POSTHOOK: type: DROPTABLE +POSTHOOK: Output: alter1_db@alter1 +PREHOOK: query: USE default +PREHOOK: type: SWITCHDATABASE +POSTHOOK: query: USE default +POSTHOOK: type: SWITCHDATABASE +PREHOOK: query: DROP DATABASE alter1_db +PREHOOK: type: DROPDATABASE +POSTHOOK: query: DROP DATABASE alter1_db +POSTHOOK: type: DROPDATABASE diff --git ql/src/test/results/clientpositive/alter2.q.out ql/src/test/results/clientpositive/alter2.q.out index 89125ce..78d7680 100644 --- ql/src/test/results/clientpositive/alter2.q.out +++ ql/src/test/results/clientpositive/alter2.q.out @@ -15,7 +15,7 @@ a int b int insertdate string -Detailed Table Information Table(tableName:alter2, dbName:default, owner:njain, createTime:1253779701, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/data/users/njain/hive5/hive5/build/ql/test/data/warehouse/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{}) +Detailed Table Information Table(tableName:alter2, dbName:default, owner:carl, createTime:1284496261, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{transient_lastDdlTime=1284496261}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: show partitions alter2 PREHOOK: type: SHOWPARTITIONS POSTHOOK: query: show partitions alter2 @@ -33,7 +33,7 @@ a int b int insertdate string -Detailed Table Information Table(tableName:alter2, dbName:default, owner:njain, createTime:1253779701, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/data/users/njain/hive5/hive5/build/ql/test/data/warehouse/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{}) +Detailed Table Information Table(tableName:alter2, dbName:default, owner:carl, createTime:1284496261, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{transient_lastDdlTime=1284496261}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: show partitions alter2 PREHOOK: type: SHOWPARTITIONS POSTHOOK: query: show partitions alter2 @@ -52,7 +52,7 @@ a int b int insertdate string -Detailed Table Information Table(tableName:alter2, dbName:default, owner:njain, createTime:1253779701, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/data/users/njain/hive5/hive5/build/ql/test/data/warehouse/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{}) +Detailed Table Information Table(tableName:alter2, dbName:default, owner:carl, createTime:1284496261, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{transient_lastDdlTime=1284496261}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: show partitions alter2 PREHOOK: type: SHOWPARTITIONS POSTHOOK: query: show partitions alter2 @@ -77,7 +77,7 @@ a int b int insertdate string -Detailed Table Information Table(tableName:alter2, dbName:default, owner:njain, createTime:1253779702, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/data/users/njain/hive5/hive5/build/ql/test/data/warehouse/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{EXTERNAL=TRUE}) +Detailed Table Information Table(tableName:alter2, dbName:default, owner:carl, createTime:1284496262, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{EXTERNAL=TRUE, transient_lastDdlTime=1284496262}, viewOriginalText:null, viewExpandedText:null, tableType:EXTERNAL_TABLE) PREHOOK: query: show partitions alter2 PREHOOK: type: SHOWPARTITIONS POSTHOOK: query: show partitions alter2 @@ -95,7 +95,7 @@ a int b int insertdate string -Detailed Table Information Table(tableName:alter2, dbName:default, owner:njain, createTime:1253779702, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/data/users/njain/hive5/hive5/build/ql/test/data/warehouse/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{EXTERNAL=TRUE}) +Detailed Table Information Table(tableName:alter2, dbName:default, owner:carl, createTime:1284496262, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{EXTERNAL=TRUE, transient_lastDdlTime=1284496262}, viewOriginalText:null, viewExpandedText:null, tableType:EXTERNAL_TABLE) PREHOOK: query: show partitions alter2 PREHOOK: type: SHOWPARTITIONS POSTHOOK: query: show partitions alter2 @@ -114,7 +114,7 @@ a int b int insertdate string -Detailed Table Information Table(tableName:alter2, dbName:default, owner:njain, createTime:1253779702, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/data/users/njain/hive5/hive5/build/ql/test/data/warehouse/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{EXTERNAL=TRUE}) +Detailed Table Information Table(tableName:alter2, dbName:default, owner:carl, createTime:1284496262, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{EXTERNAL=TRUE, transient_lastDdlTime=1284496262}, viewOriginalText:null, viewExpandedText:null, tableType:EXTERNAL_TABLE) PREHOOK: query: show partitions alter2 PREHOOK: type: SHOWPARTITIONS POSTHOOK: query: show partitions alter2 @@ -126,3 +126,169 @@ PREHOOK: type: DROPTABLE POSTHOOK: query: drop table alter2 POSTHOOK: type: DROPTABLE POSTHOOK: Output: default@alter2 +PREHOOK: query: -- Cleanup +DROP TABLE alter2 +PREHOOK: type: DROPTABLE +POSTHOOK: query: -- Cleanup +DROP TABLE alter2 +POSTHOOK: type: DROPTABLE +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +src +src1 +src_json +src_sequencefile +src_thrift +srcbucket +srcbucket2 +srcpart +PREHOOK: query: -- Using non-default Database + +CREATE DATABASE alter2_db +PREHOOK: type: CREATEDATABASE +POSTHOOK: query: -- Using non-default Database + +CREATE DATABASE alter2_db +POSTHOOK: type: CREATEDATABASE +PREHOOK: query: USE alter2_db +PREHOOK: type: SWITCHDATABASE +POSTHOOK: query: USE alter2_db +POSTHOOK: type: SWITCHDATABASE +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +PREHOOK: query: CREATE TABLE alter2(a int, b int) PARTITIONED BY (insertdate string) +PREHOOK: type: CREATETABLE +POSTHOOK: query: CREATE TABLE alter2(a int, b int) PARTITIONED BY (insertdate string) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: alter2_db@alter2 +PREHOOK: query: DESCRIBE EXTENDED alter2 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter2 +POSTHOOK: type: DESCTABLE +a int +b int +insertdate string + +Detailed Table Information Table(tableName:alter2, dbName:alter2_db, owner:carl, createTime:1284496263, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter2_db.db/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{transient_lastDdlTime=1284496263}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +PREHOOK: query: SHOW PARTITIONS alter2 +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: SHOW PARTITIONS alter2 +POSTHOOK: type: SHOWPARTITIONS +PREHOOK: query: ALTER TABLE alter2 ADD PARTITION (insertdate='2008-01-01') LOCATION '2008/01/01' +PREHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: query: ALTER TABLE alter2 ADD PARTITION (insertdate='2008-01-01') LOCATION '2008/01/01' +POSTHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: Output: alter2_db@alter2@insertdate=2008-01-01 +PREHOOK: query: DESCRIBE EXTENDED alter2 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter2 +POSTHOOK: type: DESCTABLE +a int +b int +insertdate string + +Detailed Table Information Table(tableName:alter2, dbName:alter2_db, owner:carl, createTime:1284496263, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter2_db.db/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{transient_lastDdlTime=1284496263}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +PREHOOK: query: SHOW PARTITIONS alter2 +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: SHOW PARTITIONS alter2 +POSTHOOK: type: SHOWPARTITIONS +insertdate=2008-01-01 +PREHOOK: query: ALTER TABLE alter2 ADD PARTITION (insertdate='2008-01-02') LOCATION '2008/01/02' +PREHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: query: ALTER TABLE alter2 ADD PARTITION (insertdate='2008-01-02') LOCATION '2008/01/02' +POSTHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: Output: alter2_db@alter2@insertdate=2008-01-02 +PREHOOK: query: DESCRIBE EXTENDED alter2 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter2 +POSTHOOK: type: DESCTABLE +a int +b int +insertdate string + +Detailed Table Information Table(tableName:alter2, dbName:alter2_db, owner:carl, createTime:1284496263, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter2_db.db/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{transient_lastDdlTime=1284496263}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +PREHOOK: query: SHOW PARTITIONS alter2 +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: SHOW PARTITIONS alter2 +POSTHOOK: type: SHOWPARTITIONS +insertdate=2008-01-01 +insertdate=2008-01-02 +PREHOOK: query: DROP TABLE alter2 +PREHOOK: type: DROPTABLE +POSTHOOK: query: DROP TABLE alter2 +POSTHOOK: type: DROPTABLE +POSTHOOK: Output: alter2_db@alter2 +PREHOOK: query: CREATE EXTERNAL TABLE alter2(a int, b int) PARTITIONED BY (insertdate string) +PREHOOK: type: CREATETABLE +POSTHOOK: query: CREATE EXTERNAL TABLE alter2(a int, b int) PARTITIONED BY (insertdate string) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: alter2_db@alter2 +PREHOOK: query: DESCRIBE EXTENDED alter2 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter2 +POSTHOOK: type: DESCTABLE +a int +b int +insertdate string + +Detailed Table Information Table(tableName:alter2, dbName:alter2_db, owner:carl, createTime:1284496264, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter2_db.db/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{EXTERNAL=TRUE, transient_lastDdlTime=1284496264}, viewOriginalText:null, viewExpandedText:null, tableType:EXTERNAL_TABLE) +PREHOOK: query: SHOW PARTITIONS alter2 +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: SHOW PARTITIONS alter2 +POSTHOOK: type: SHOWPARTITIONS +PREHOOK: query: ALTER TABLE alter2 ADD PARTITION (insertdate='2008-01-01') LOCATION '2008/01/01' +PREHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: query: ALTER TABLE alter2 ADD PARTITION (insertdate='2008-01-01') LOCATION '2008/01/01' +POSTHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: Output: alter2_db@alter2@insertdate=2008-01-01 +PREHOOK: query: DESCRIBE EXTENDED alter2 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter2 +POSTHOOK: type: DESCTABLE +a int +b int +insertdate string + +Detailed Table Information Table(tableName:alter2, dbName:alter2_db, owner:carl, createTime:1284496264, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter2_db.db/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{EXTERNAL=TRUE, transient_lastDdlTime=1284496264}, viewOriginalText:null, viewExpandedText:null, tableType:EXTERNAL_TABLE) +PREHOOK: query: SHOW PARTITIONS alter2 +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: SHOW PARTITIONS alter2 +POSTHOOK: type: SHOWPARTITIONS +insertdate=2008-01-01 +PREHOOK: query: ALTER TABLE alter2 ADD PARTITION (insertdate='2008-01-02') LOCATION '2008/01/02' +PREHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: query: ALTER TABLE alter2 ADD PARTITION (insertdate='2008-01-02') LOCATION '2008/01/02' +POSTHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: Output: alter2_db@alter2@insertdate=2008-01-02 +PREHOOK: query: DESCRIBE EXTENDED alter2 +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter2 +POSTHOOK: type: DESCTABLE +a int +b int +insertdate string + +Detailed Table Information Table(tableName:alter2, dbName:alter2_db, owner:carl, createTime:1284496264, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:int, comment:null), FieldSchema(name:b, type:int, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter2_db.db/alter2, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:insertdate, type:string, comment:null)], parameters:{EXTERNAL=TRUE, transient_lastDdlTime=1284496264}, viewOriginalText:null, viewExpandedText:null, tableType:EXTERNAL_TABLE) +PREHOOK: query: SHOW PARTITIONS alter2 +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: SHOW PARTITIONS alter2 +POSTHOOK: type: SHOWPARTITIONS +insertdate=2008-01-01 +insertdate=2008-01-02 +PREHOOK: query: DROP TABLE alter2 +PREHOOK: type: DROPTABLE +POSTHOOK: query: DROP TABLE alter2 +POSTHOOK: type: DROPTABLE +POSTHOOK: Output: alter2_db@alter2 +PREHOOK: query: USE default +PREHOOK: type: SWITCHDATABASE +POSTHOOK: query: USE default +POSTHOOK: type: SWITCHDATABASE +PREHOOK: query: DROP DATABASE alter2_db +PREHOOK: type: DROPDATABASE +POSTHOOK: query: DROP DATABASE alter2_db +POSTHOOK: type: DROPDATABASE diff --git ql/src/test/results/clientpositive/alter3.q.out ql/src/test/results/clientpositive/alter3.q.out index 0f4e5a2..bf1083b 100644 --- ql/src/test/results/clientpositive/alter3.q.out +++ ql/src/test/results/clientpositive/alter3.q.out @@ -46,11 +46,11 @@ POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE PREHOOK: query: select * from alter3 where pcol1='test_part' and pcol2='test_part' PREHOOK: type: QUERY PREHOOK: Input: default@alter3@pcol1=test_part/pcol2=test_part -PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/hive_2010-05-03_13-59-16_257_4588179538253670650/10000 +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_13-31-11_925_8933176668977861887/10000 POSTHOOK: query: select * from alter3 where pcol1='test_part' and pcol2='test_part' POSTHOOK: type: QUERY POSTHOOK: Input: default@alter3@pcol1=test_part/pcol2=test_part -POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/hive_2010-05-03_13-59-16_257_4588179538253670650/10000 +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_13-31-11_925_8933176668977861887/10000 POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] 1 test_part test_part 2 test_part test_part @@ -74,7 +74,7 @@ col1 string pcol1 string pcol2 string -Detailed Table Information Table(tableName:alter3_renamed, dbName:default, owner:jsichi, createTime:1272920351, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:col1, type:string, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/alter3_renamed, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:pcol1, type:string, comment:null), FieldSchema(name:pcol2, type:string, comment:null)], parameters:{last_modified_by=jsichi,last_modified_time=1272920356,transient_lastDdlTime=1272920356}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +Detailed Table Information Table(tableName:alter3_renamed, dbName:default, owner:carl, createTime:1284496267, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:col1, type:string, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter3_renamed, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:pcol1, type:string, comment:null), FieldSchema(name:pcol2, type:string, comment:null)], parameters:{last_modified_by=carl, last_modified_time=1284496272, transient_lastDdlTime=1284496272}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: describe extended alter3_renamed partition (pCol1='test_part', pcol2='test_part') PREHOOK: type: DESCTABLE POSTHOOK: query: describe extended alter3_renamed partition (pCol1='test_part', pcol2='test_part') @@ -84,15 +84,15 @@ col1 string pcol1 string pcol2 string -Detailed Partition Information Partition(values:[test_part, test_part], dbName:default, tableName:alter3_renamed, createTime:1272920356, lastAccessTime:0, sd:StorageDescriptor(cols:[FieldSchema(name:col1, type:string, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/alter3_renamed/pcol1=test_part/pcol2=test_part, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), parameters:{transient_lastDdlTime=1272920356}) +Detailed Partition Information Partition(values:[test_part, test_part], dbName:default, tableName:alter3_renamed, createTime:1284496271, lastAccessTime:0, sd:StorageDescriptor(cols:[FieldSchema(name:col1, type:string, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter3_renamed/pcol1=test_part/pcol2=test_part, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), parameters:{transient_lastDdlTime=1284496271}) PREHOOK: query: select * from alter3_renamed where pcol1='test_part' and pcol2='test_part' PREHOOK: type: QUERY PREHOOK: Input: default@alter3_renamed@pcol1=test_part/pcol2=test_part -PREHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/hive_2010-05-03_13-59-16_800_7077748274776018895/10000 +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_13-31-12_502_4515887975662985132/10000 POSTHOOK: query: select * from alter3_renamed where pcol1='test_part' and pcol2='test_part' POSTHOOK: type: QUERY POSTHOOK: Input: default@alter3_renamed@pcol1=test_part/pcol2=test_part -POSTHOOK: Output: file:/Users/jsichi/open/hive-trunk/build/ql/scratchdir/hive_2010-05-03_13-59-16_800_7077748274776018895/10000 +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_13-31-12_502_4515887975662985132/10000 POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] 1 test_part test_part 2 test_part test_part @@ -132,7 +132,7 @@ col1 string pcol1 string pcol2 string -Detailed Table Information Table(tableName:alter3_like_renamed, dbName:default, owner:jsichi, createTime:1272920352, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:col1, type:string, comment:null)], location:file:/Users/jsichi/open/hive-trunk/build/ql/test/data/warehouse/alter3_like_renamed, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:pcol1, type:string, comment:null), FieldSchema(name:pcol2, type:string, comment:null)], parameters:{EXTERNAL=FALSE,last_modified_by=jsichi,last_modified_time=1272920360,transient_lastDdlTime=1272920360}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +Detailed Table Information Table(tableName:alter3_like_renamed, dbName:default, owner:carl, createTime:1284496267, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:col1, type:string, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter3_like_renamed, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:pcol1, type:string, comment:null), FieldSchema(name:pcol2, type:string, comment:null)], parameters:{EXTERNAL=FALSE, last_modified_by=carl, last_modified_time=1284496275, transient_lastDdlTime=1284496275}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: drop table alter3_src PREHOOK: type: DROPTABLE POSTHOOK: query: drop table alter3_src @@ -160,3 +160,204 @@ POSTHOOK: type: DROPTABLE POSTHOOK: Output: default@alter3_like_renamed POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: -- Cleanup +DROP TABLE alter3_src +PREHOOK: type: DROPTABLE +POSTHOOK: query: -- Cleanup +DROP TABLE alter3_src +POSTHOOK: type: DROPTABLE +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: DROP TABLE alter3_renamed +PREHOOK: type: DROPTABLE +POSTHOOK: query: DROP TABLE alter3_renamed +POSTHOOK: type: DROPTABLE +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: DROP TABLE alter3_like_renamed +PREHOOK: type: DROPTABLE +POSTHOOK: query: DROP TABLE alter3_like_renamed +POSTHOOK: type: DROPTABLE +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +src +src1 +src_json +src_sequencefile +src_thrift +srcbucket +srcbucket2 +srcpart +PREHOOK: query: -- With non-default Database + +CREATE DATABASE alter3_db +PREHOOK: type: CREATEDATABASE +POSTHOOK: query: -- With non-default Database + +CREATE DATABASE alter3_db +POSTHOOK: type: CREATEDATABASE +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: USE alter3_db +PREHOOK: type: SWITCHDATABASE +POSTHOOK: query: USE alter3_db +POSTHOOK: type: SWITCHDATABASE +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: CREATE TABLE alter3_src (col1 STRING) STORED AS TEXTFILE +PREHOOK: type: CREATETABLE +POSTHOOK: query: CREATE TABLE alter3_src (col1 STRING) STORED AS TEXTFILE +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: alter3_db@alter3_src +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: LOAD DATA LOCAL INPATH '../data/files/test.dat' OVERWRITE INTO TABLE alter3_src +PREHOOK: type: LOAD +POSTHOOK: query: LOAD DATA LOCAL INPATH '../data/files/test.dat' OVERWRITE INTO TABLE alter3_src +POSTHOOK: type: LOAD +POSTHOOK: Output: alter3_db@alter3_src +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: CREATE TABLE alter3 (col1 STRING) PARTITIONED BY (pcol1 STRING, pcol2 STRING) STORED AS SEQUENCEFILE +PREHOOK: type: CREATETABLE +POSTHOOK: query: CREATE TABLE alter3 (col1 STRING) PARTITIONED BY (pcol1 STRING, pcol2 STRING) STORED AS SEQUENCEFILE +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: alter3_db@alter3 +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: CREATE TABLE alter3_like LIKE alter3 +PREHOOK: type: CREATETABLE +POSTHOOK: query: CREATE TABLE alter3_like LIKE alter3 +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: alter3_db@alter3_like +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: INSERT OVERWRITE TABLE alter3 PARTITION (pCol1='test_part', pcol2='test_part') SELECT col1 FROM alter3_src +PREHOOK: type: QUERY +PREHOOK: Input: alter3_db@alter3_src +PREHOOK: Output: alter3_db@alter3@pcol1=test_part/pcol2=test_part +POSTHOOK: query: INSERT OVERWRITE TABLE alter3 PARTITION (pCol1='test_part', pcol2='test_part') SELECT col1 FROM alter3_src +POSTHOOK: type: QUERY +POSTHOOK: Input: alter3_db@alter3_src +POSTHOOK: Output: alter3_db@alter3@pcol1=test_part/pcol2=test_part +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: SELECT * FROM alter3 WHERE pcol1='test_part' AND pcol2='test_part' +PREHOOK: type: QUERY +PREHOOK: Input: alter3_db@alter3@pcol1=test_part/pcol2=test_part +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_13-31-20_509_1163750068575464727/10000 +POSTHOOK: query: SELECT * FROM alter3 WHERE pcol1='test_part' AND pcol2='test_part' +POSTHOOK: type: QUERY +POSTHOOK: Input: alter3_db@alter3@pcol1=test_part/pcol2=test_part +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_13-31-20_509_1163750068575464727/10000 +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +1 test_part test_part +2 test_part test_part +3 test_part test_part +4 test_part test_part +5 test_part test_part +6 test_part test_part +PREHOOK: query: ALTER TABLE alter3 RENAME TO alter3_renamed +PREHOOK: type: ALTERTABLE_RENAME +POSTHOOK: query: ALTER TABLE alter3 RENAME TO alter3_renamed +POSTHOOK: type: ALTERTABLE_RENAME +POSTHOOK: Input: alter3_db@alter3 +POSTHOOK: Output: alter3_db@alter3_renamed +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: DESCRIBE EXTENDED alter3_renamed +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter3_renamed +POSTHOOK: type: DESCTABLE +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +col1 string +pcol1 string +pcol2 string + +Detailed Table Information Table(tableName:alter3_renamed, dbName:alter3_db, owner:carl, createTime:1284496276, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:col1, type:string, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter3_db.db/alter3_renamed, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:pcol1, type:string, comment:null), FieldSchema(name:pcol2, type:string, comment:null)], parameters:{last_modified_by=carl, last_modified_time=1284496280, transient_lastDdlTime=1284496280}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +PREHOOK: query: DESCRIBE EXTENDED alter3_renamed PARTITION (pCol1='test_part', pcol2='test_part') +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter3_renamed PARTITION (pCol1='test_part', pcol2='test_part') +POSTHOOK: type: DESCTABLE +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +col1 string +pcol1 string +pcol2 string + +Detailed Partition Information Partition(values:[test_part, test_part], dbName:alter3_db, tableName:alter3_renamed, createTime:1284496280, lastAccessTime:0, sd:StorageDescriptor(cols:[FieldSchema(name:col1, type:string, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter3_db.db/alter3_renamed/pcol1=test_part/pcol2=test_part, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), parameters:{transient_lastDdlTime=1284496280}) +PREHOOK: query: SELECT * FROM alter3_renamed WHERE pcol1='test_part' AND pcol2='test_part' +PREHOOK: type: QUERY +PREHOOK: Input: alter3_db@alter3_renamed@pcol1=test_part/pcol2=test_part +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_13-31-20_810_8295963312837280856/10000 +POSTHOOK: query: SELECT * FROM alter3_renamed WHERE pcol1='test_part' AND pcol2='test_part' +POSTHOOK: type: QUERY +POSTHOOK: Input: alter3_db@alter3_renamed@pcol1=test_part/pcol2=test_part +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_13-31-20_810_8295963312837280856/10000 +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +1 test_part test_part +2 test_part test_part +3 test_part test_part +4 test_part test_part +5 test_part test_part +6 test_part test_part +PREHOOK: query: INSERT OVERWRITE TABLE alter3_like +PARTITION (pCol1='test_part', pcol2='test_part') +SELECT col1 FROM alter3_src +PREHOOK: type: QUERY +PREHOOK: Input: alter3_db@alter3_src +PREHOOK: Output: alter3_db@alter3_like@pcol1=test_part/pcol2=test_part +POSTHOOK: query: INSERT OVERWRITE TABLE alter3_like +PARTITION (pCol1='test_part', pcol2='test_part') +SELECT col1 FROM alter3_src +POSTHOOK: type: QUERY +POSTHOOK: Input: alter3_db@alter3_src +POSTHOOK: Output: alter3_db@alter3_like@pcol1=test_part/pcol2=test_part +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: ALTER TABLE alter3_like RENAME TO alter3_like_renamed +PREHOOK: type: ALTERTABLE_RENAME +POSTHOOK: query: ALTER TABLE alter3_like RENAME TO alter3_like_renamed +POSTHOOK: type: ALTERTABLE_RENAME +POSTHOOK: Input: alter3_db@alter3_like +POSTHOOK: Output: alter3_db@alter3_like_renamed +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: DESCRIBE EXTENDED alter3_like_renamed +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED alter3_like_renamed +POSTHOOK: type: DESCTABLE +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3 PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter3_like PARTITION(pcol1=test_part,pcol2=test_part).col1 SIMPLE [(alter3_src)alter3_src.FieldSchema(name:col1, type:string, comment:null), ] +col1 string +pcol1 string +pcol2 string + +Detailed Table Information Table(tableName:alter3_like_renamed, dbName:alter3_db, owner:carl, createTime:1284496276, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:col1, type:string, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/alter3_db.db/alter3_like_renamed, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:pcol1, type:string, comment:null), FieldSchema(name:pcol2, type:string, comment:null)], parameters:{EXTERNAL=FALSE, last_modified_by=carl, last_modified_time=1284496287, transient_lastDdlTime=1284496287}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) diff --git ql/src/test/results/clientpositive/archive.q.out ql/src/test/results/clientpositive/archive.q.out index b1a18c7..b1d122b 100644 --- ql/src/test/results/clientpositive/archive.q.out +++ ql/src/test/results/clientpositive/archive.q.out @@ -5,7 +5,7 @@ FROM (SELECT * FROM srcpart WHERE ds='2008-04-08') subq1) subq2 PREHOOK: type: QUERY PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=11 PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=12 -PREHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-12_801_8718664231713136788/10000 +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-03-06_744_8916435999875497294/10000 POSTHOOK: query: -- EXCLUDE_HADOOP_MAJOR_VERSIONS(0.17, 0.18, 0.19) SELECT SUM(hash(col)) FROM (SELECT transform(*) using 'tr "\t" "_"' AS col @@ -13,7 +13,7 @@ FROM (SELECT * FROM srcpart WHERE ds='2008-04-08') subq1) subq2 POSTHOOK: type: QUERY POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=11 POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12 -POSTHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-12_801_8718664231713136788/10000 +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-03-06_744_8916435999875497294/10000 48479881068 PREHOOK: query: ALTER TABLE srcpart ARCHIVE PARTITION (ds='2008-04-08', hr='12') PREHOOK: type: ALTERTABLE_ARCHIVE @@ -24,35 +24,35 @@ FROM (SELECT * FROM srcpart WHERE ds='2008-04-08') subq1) subq2 PREHOOK: type: QUERY PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=11 PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=12 -PREHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-20_510_5269010142014944519/10000 +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-03-17_452_7700081165719278084/10000 POSTHOOK: query: SELECT SUM(hash(col)) FROM (SELECT transform(*) using 'tr "\t" "_"' AS col FROM (SELECT * FROM srcpart WHERE ds='2008-04-08') subq1) subq2 POSTHOOK: type: QUERY POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=11 POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12 -POSTHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-20_510_5269010142014944519/10000 +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-03-17_452_7700081165719278084/10000 48479881068 PREHOOK: query: SELECT key, count(1) FROM srcpart WHERE ds='2008-04-08' AND hr='12' AND key='0' GROUP BY key PREHOOK: type: QUERY PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=12 -PREHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-26_238_1201801305984652550/10000 +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-03-23_946_2094505434448555442/10000 POSTHOOK: query: SELECT key, count(1) FROM srcpart WHERE ds='2008-04-08' AND hr='12' AND key='0' GROUP BY key POSTHOOK: type: QUERY POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12 -POSTHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-26_238_1201801305984652550/10000 +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-03-23_946_2094505434448555442/10000 0 3 PREHOOK: query: SELECT * FROM srcpart a JOIN src b ON a.key=b.key WHERE a.ds='2008-04-08' AND a.hr='12' AND a.key='0' PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=12 -PREHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-32_413_8808816186480793926/10000 +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-03-30_831_8165847365866183825/10000 POSTHOOK: query: SELECT * FROM srcpart a JOIN src b ON a.key=b.key WHERE a.ds='2008-04-08' AND a.hr='12' AND a.key='0' POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12 -POSTHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-32_413_8808816186480793926/10000 +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-03-30_831_8165847365866183825/10000 0 val_0 2008-04-08 12 0 val_0 0 val_0 2008-04-08 12 0 val_0 0 val_0 2008-04-08 12 0 val_0 @@ -71,13 +71,13 @@ FROM (SELECT * FROM srcpart WHERE ds='2008-04-08') subq1) subq2 PREHOOK: type: QUERY PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=11 PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=12 -PREHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-37_857_7662280812791374354/10000 +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-03-37_295_5023082209691925621/10000 POSTHOOK: query: SELECT SUM(hash(col)) FROM (SELECT transform(*) using 'tr "\t" "_"' AS col FROM (SELECT * FROM srcpart WHERE ds='2008-04-08') subq1) subq2 POSTHOOK: type: QUERY POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=11 POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12 -POSTHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-37_857_7662280812791374354/10000 +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-03-37_295_5023082209691925621/10000 48479881068 PREHOOK: query: CREATE TABLE harbucket(key INT) PARTITIONED by (ds STRING) @@ -100,11 +100,11 @@ POSTHOOK: Lineage: harbucket PARTITION(ds=1).key EXPRESSION [(src)src.FieldSchem PREHOOK: query: SELECT key FROM harbucket TABLESAMPLE(BUCKET 1 OUT OF 10) SORT BY key PREHOOK: type: QUERY PREHOOK: Input: default@harbucket@ds=1 -PREHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-47_247_5412318794268628077/10000 +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-03-51_572_2003242428445607548/10000 POSTHOOK: query: SELECT key FROM harbucket TABLESAMPLE(BUCKET 1 OUT OF 10) SORT BY key POSTHOOK: type: QUERY POSTHOOK: Input: default@harbucket@ds=1 -POSTHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-47_247_5412318794268628077/10000 +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-03-51_572_2003242428445607548/10000 POSTHOOK: Lineage: harbucket PARTITION(ds=1).key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 0 0 @@ -120,11 +120,11 @@ POSTHOOK: Lineage: harbucket PARTITION(ds=1).key EXPRESSION [(src)src.FieldSchem PREHOOK: query: SELECT key FROM harbucket TABLESAMPLE(BUCKET 1 OUT OF 10) SORT BY key PREHOOK: type: QUERY PREHOOK: Input: default@harbucket@ds=1 -PREHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-52_696_6661366062442712305/10000 +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-03-58_779_5304096215450593102/10000 POSTHOOK: query: SELECT key FROM harbucket TABLESAMPLE(BUCKET 1 OUT OF 10) SORT BY key POSTHOOK: type: QUERY POSTHOOK: Input: default@harbucket@ds=1 -POSTHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-52_696_6661366062442712305/10000 +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-03-58_779_5304096215450593102/10000 POSTHOOK: Lineage: harbucket PARTITION(ds=1).key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 0 0 @@ -140,11 +140,11 @@ POSTHOOK: Lineage: harbucket PARTITION(ds=1).key EXPRESSION [(src)src.FieldSchem PREHOOK: query: SELECT key FROM harbucket TABLESAMPLE(BUCKET 1 OUT OF 10) SORT BY key PREHOOK: type: QUERY PREHOOK: Input: default@harbucket@ds=1 -PREHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-56_920_7660869602739278397/10000 +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-04-05_087_8005100322945969669/10000 POSTHOOK: query: SELECT key FROM harbucket TABLESAMPLE(BUCKET 1 OUT OF 10) SORT BY key POSTHOOK: type: QUERY POSTHOOK: Input: default@harbucket@ds=1 -POSTHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-29-56_920_7660869602739278397/10000 +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-04-05_087_8005100322945969669/10000 POSTHOOK: Lineage: harbucket PARTITION(ds=1).key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 0 0 @@ -186,12 +186,12 @@ PREHOOK: query: SELECT SUM(hash(col)) FROM (SELECT transform(*) using 'tr "\t" " FROM (SELECT * FROM old_name WHERE ds='1') subq1) subq2 PREHOOK: type: QUERY PREHOOK: Input: default@old_name@ds=1 -PREHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-30-06_143_8274193601305228676/10000 +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-04-20_329_4150518762263527965/10000 POSTHOOK: query: SELECT SUM(hash(col)) FROM (SELECT transform(*) using 'tr "\t" "_"' AS col FROM (SELECT * FROM old_name WHERE ds='1') subq1) subq2 POSTHOOK: type: QUERY POSTHOOK: Input: default@old_name@ds=1 -POSTHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-30-06_143_8274193601305228676/10000 +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-04-20_329_4150518762263527965/10000 POSTHOOK: Lineage: harbucket PARTITION(ds=1).key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: old_name PARTITION(ds=1).key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 48656137 @@ -207,12 +207,12 @@ PREHOOK: query: SELECT SUM(hash(col)) FROM (SELECT transform(*) using 'tr "\t" " FROM (SELECT * FROM new_name WHERE ds='1') subq1) subq2 PREHOOK: type: QUERY PREHOOK: Input: default@new_name@ds=1 -PREHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-30-10_661_5999329953207292038/10000 +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-04-27_284_3620843794297400178/10000 POSTHOOK: query: SELECT SUM(hash(col)) FROM (SELECT transform(*) using 'tr "\t" "_"' AS col FROM (SELECT * FROM new_name WHERE ds='1') subq1) subq2 POSTHOOK: type: QUERY POSTHOOK: Input: default@new_name@ds=1 -POSTHOOK: Output: file:/data/users/pyang/task/trunk/VENDOR.hive/trunk/build/ql/scratchdir/hive_2010-06-21_17-30-10_661_5999329953207292038/10000 +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_16-04-27_284_3620843794297400178/10000 POSTHOOK: Lineage: harbucket PARTITION(ds=1).key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: old_name PARTITION(ds=1).key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] NULL diff --git ql/src/test/results/clientpositive/database.q.out ql/src/test/results/clientpositive/database.q.out new file mode 100644 index 0000000..46d2a2f --- /dev/null +++ ql/src/test/results/clientpositive/database.q.out @@ -0,0 +1,299 @@ +PREHOOK: query: SHOW DATABASES +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: SHOW DATABASES +POSTHOOK: type: SHOWDATABASES +default +PREHOOK: query: -- CREATE with comment +CREATE DATABASE test_db COMMENT 'Hive test database' +PREHOOK: type: CREATEDATABASE +POSTHOOK: query: -- CREATE with comment +CREATE DATABASE test_db COMMENT 'Hive test database' +POSTHOOK: type: CREATEDATABASE +PREHOOK: query: SHOW DATABASES +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: SHOW DATABASES +POSTHOOK: type: SHOWDATABASES +default +test_db +PREHOOK: query: -- CREATE INE already exists +CREATE DATABASE IF NOT EXISTS test_db +PREHOOK: type: CREATEDATABASE +POSTHOOK: query: -- CREATE INE already exists +CREATE DATABASE IF NOT EXISTS test_db +POSTHOOK: type: CREATEDATABASE +PREHOOK: query: SHOW DATABASES +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: SHOW DATABASES +POSTHOOK: type: SHOWDATABASES +default +test_db +PREHOOK: query: -- SHOW DATABASES synonym +SHOW SCHEMAS +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: -- SHOW DATABASES synonym +SHOW SCHEMAS +POSTHOOK: type: SHOWDATABASES +default +test_db +PREHOOK: query: -- DROP +DROP DATABASE test_db +PREHOOK: type: DROPDATABASE +POSTHOOK: query: -- DROP +DROP DATABASE test_db +POSTHOOK: type: DROPDATABASE +PREHOOK: query: SHOW DATABASES +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: SHOW DATABASES +POSTHOOK: type: SHOWDATABASES +default +PREHOOK: query: -- CREATE INE doesn't exist +CREATE DATABASE IF NOT EXISTS test_db COMMENT 'Hive test database' +PREHOOK: type: CREATEDATABASE +POSTHOOK: query: -- CREATE INE doesn't exist +CREATE DATABASE IF NOT EXISTS test_db COMMENT 'Hive test database' +POSTHOOK: type: CREATEDATABASE +PREHOOK: query: SHOW DATABASES +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: SHOW DATABASES +POSTHOOK: type: SHOWDATABASES +default +test_db +PREHOOK: query: -- DROP IE exists +DROP DATABASE IF EXISTS test_db +PREHOOK: type: DROPDATABASE +POSTHOOK: query: -- DROP IE exists +DROP DATABASE IF EXISTS test_db +POSTHOOK: type: DROPDATABASE +PREHOOK: query: SHOW DATABASES +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: SHOW DATABASES +POSTHOOK: type: SHOWDATABASES +default +PREHOOK: query: -- DROP IE doesn't exist +DROP DATABASE IF EXISTS test_db +PREHOOK: type: DROPDATABASE +POSTHOOK: query: -- DROP IE doesn't exist +DROP DATABASE IF EXISTS test_db +POSTHOOK: type: DROPDATABASE +PREHOOK: query: -- SHOW +CREATE DATABASE test_db +PREHOOK: type: CREATEDATABASE +POSTHOOK: query: -- SHOW +CREATE DATABASE test_db +POSTHOOK: type: CREATEDATABASE +PREHOOK: query: SHOW DATABASES +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: SHOW DATABASES +POSTHOOK: type: SHOWDATABASES +default +test_db +PREHOOK: query: -- SHOW pattern +SHOW DATABASES LIKE 'test*' +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: -- SHOW pattern +SHOW DATABASES LIKE 'test*' +POSTHOOK: type: SHOWDATABASES +test_db +PREHOOK: query: -- SHOW pattern +SHOW DATABASES LIKE '*ef*' +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: -- SHOW pattern +SHOW DATABASES LIKE '*ef*' +POSTHOOK: type: SHOWDATABASES +default +PREHOOK: query: USE test_db +PREHOOK: type: SWITCHDATABASE +POSTHOOK: query: USE test_db +POSTHOOK: type: SWITCHDATABASE +PREHOOK: query: SHOW DATABASES +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: SHOW DATABASES +POSTHOOK: type: SHOWDATABASES +default +test_db +PREHOOK: query: -- CREATE table in non-default DB +CREATE TABLE test_table (col1 STRING) STORED AS TEXTFILE +PREHOOK: type: CREATETABLE +POSTHOOK: query: -- CREATE table in non-default DB +CREATE TABLE test_table (col1 STRING) STORED AS TEXTFILE +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: test_db@test_table +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +test_table +PREHOOK: query: -- DESCRIBE table in non-default DB +DESCRIBE test_table +PREHOOK: type: DESCTABLE +POSTHOOK: query: -- DESCRIBE table in non-default DB +DESCRIBE test_table +POSTHOOK: type: DESCTABLE +col1 string +PREHOOK: query: -- DESCRIBE EXTENDED in non-default DB +DESCRIBE EXTENDED test_table +PREHOOK: type: DESCTABLE +POSTHOOK: query: -- DESCRIBE EXTENDED in non-default DB +DESCRIBE EXTENDED test_table +POSTHOOK: type: DESCTABLE +col1 string + +Detailed Table Information Table(tableName:test_table, dbName:test_db, owner:carl, createTime:1284501298, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:col1, type:string, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/test_db.db/test_table, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1284501298}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +PREHOOK: query: -- CREATE LIKE in non-default DB +CREATE TABLE test_table_like LIKE test_table +PREHOOK: type: CREATETABLE +POSTHOOK: query: -- CREATE LIKE in non-default DB +CREATE TABLE test_table_like LIKE test_table +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: test_db@test_table_like +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +test_table +test_table_like +PREHOOK: query: DESCRIBE EXTENDED test_table_like +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE EXTENDED test_table_like +POSTHOOK: type: DESCTABLE +col1 string + +Detailed Table Information Table(tableName:test_table_like, dbName:test_db, owner:carl, createTime:1284501298, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:col1, type:string, comment:null)], location:file:/Users/carl/Projects/hive/build/ql/test/data/warehouse/test_db.db/test_table_like, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{EXTERNAL=FALSE, transient_lastDdlTime=1284501298}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) +PREHOOK: query: -- LOAD and SELECT +LOAD DATA LOCAL INPATH '../data/files/test.dat' OVERWRITE INTO TABLE test_table +PREHOOK: type: LOAD +POSTHOOK: query: -- LOAD and SELECT +LOAD DATA LOCAL INPATH '../data/files/test.dat' OVERWRITE INTO TABLE test_table +POSTHOOK: type: LOAD +POSTHOOK: Output: test_db@test_table +PREHOOK: query: SELECT * FROM test_table +PREHOOK: type: QUERY +PREHOOK: Input: test_db@test_table +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_14-54-59_036_8662052512016164070/10000 +POSTHOOK: query: SELECT * FROM test_table +POSTHOOK: type: QUERY +POSTHOOK: Input: test_db@test_table +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_14-54-59_036_8662052512016164070/10000 +1 +2 +3 +4 +5 +6 +PREHOOK: query: -- DROP and CREATE w/o LOAD +DROP TABLE test_table +PREHOOK: type: DROPTABLE +POSTHOOK: query: -- DROP and CREATE w/o LOAD +DROP TABLE test_table +POSTHOOK: type: DROPTABLE +POSTHOOK: Output: test_db@test_table +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +test_table_like +PREHOOK: query: CREATE TABLE test_table (col1 STRING) STORED AS TEXTFILE +PREHOOK: type: CREATETABLE +POSTHOOK: query: CREATE TABLE test_table (col1 STRING) STORED AS TEXTFILE +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: test_db@test_table +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +test_table +test_table_like +PREHOOK: query: SELECT * FROM test_table +PREHOOK: type: QUERY +PREHOOK: Input: test_db@test_table +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_14-54-59_509_4858564912752179967/10000 +POSTHOOK: query: SELECT * FROM test_table +POSTHOOK: type: QUERY +POSTHOOK: Input: test_db@test_table +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_14-54-59_509_4858564912752179967/10000 +PREHOOK: query: -- CREATE table that already exists in DEFAULT +USE test_db +PREHOOK: type: SWITCHDATABASE +POSTHOOK: query: -- CREATE table that already exists in DEFAULT +USE test_db +POSTHOOK: type: SWITCHDATABASE +PREHOOK: query: CREATE TABLE src (col1 STRING) STORED AS TEXTFILE +PREHOOK: type: CREATETABLE +POSTHOOK: query: CREATE TABLE src (col1 STRING) STORED AS TEXTFILE +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: test_db@src +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +src +test_table +test_table_like +PREHOOK: query: SELECT * FROM src LIMIT 10 +PREHOOK: type: QUERY +PREHOOK: Input: test_db@src +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_14-54-59_668_2139780231948111367/10000 +POSTHOOK: query: SELECT * FROM src LIMIT 10 +POSTHOOK: type: QUERY +POSTHOOK: Input: test_db@src +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_14-54-59_668_2139780231948111367/10000 +PREHOOK: query: USE default +PREHOOK: type: SWITCHDATABASE +POSTHOOK: query: USE default +POSTHOOK: type: SWITCHDATABASE +PREHOOK: query: SELECT * FROM src LIMIT 10 +PREHOOK: type: QUERY +PREHOOK: Input: default@src +PREHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_14-54-59_732_2873029711065735697/10000 +POSTHOOK: query: SELECT * FROM src LIMIT 10 +POSTHOOK: type: QUERY +POSTHOOK: Input: default@src +POSTHOOK: Output: file:/var/folders/b7/b7UUwNZdF1KKHtM+5la6f++++TI/-Tmp-/carl/hive_2010-09-14_14-54-59_732_2873029711065735697/10000 +238 val_238 +86 val_86 +311 val_311 +27 val_27 +165 val_165 +409 val_409 +255 val_255 +278 val_278 +98 val_98 +484 val_484 +PREHOOK: query: -- DROP DATABASE +USE test_db +PREHOOK: type: SWITCHDATABASE +POSTHOOK: query: -- DROP DATABASE +USE test_db +POSTHOOK: type: SWITCHDATABASE +PREHOOK: query: DROP TABLE src +PREHOOK: type: DROPTABLE +POSTHOOK: query: DROP TABLE src +POSTHOOK: type: DROPTABLE +POSTHOOK: Output: test_db@src +PREHOOK: query: DROP TABLE test_table +PREHOOK: type: DROPTABLE +POSTHOOK: query: DROP TABLE test_table +POSTHOOK: type: DROPTABLE +POSTHOOK: Output: test_db@test_table +PREHOOK: query: DROP TABLE test_table_like +PREHOOK: type: DROPTABLE +POSTHOOK: query: DROP TABLE test_table_like +POSTHOOK: type: DROPTABLE +POSTHOOK: Output: test_db@test_table_like +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +PREHOOK: query: USE default +PREHOOK: type: SWITCHDATABASE +POSTHOOK: query: USE default +POSTHOOK: type: SWITCHDATABASE +PREHOOK: query: DROP DATABASE test_db +PREHOOK: type: DROPDATABASE +POSTHOOK: query: DROP DATABASE test_db +POSTHOOK: type: DROPDATABASE +PREHOOK: query: SHOW DATABASES +PREHOOK: type: SHOWDATABASES +POSTHOOK: query: SHOW DATABASES +POSTHOOK: type: SHOWDATABASES +default diff --git ql/src/test/results/clientpositive/rename_column.q.out ql/src/test/results/clientpositive/rename_column.q.out index eba639d..bfe4eea 100644 --- ql/src/test/results/clientpositive/rename_column.q.out +++ ql/src/test/results/clientpositive/rename_column.q.out @@ -106,3 +106,141 @@ PREHOOK: type: DROPTABLE POSTHOOK: query: DROP TABLE kv_rename_test POSTHOOK: type: DROPTABLE POSTHOOK: Output: default@kv_rename_test +PREHOOK: query: DROP TABLE kv_rename_test +PREHOOK: type: DROPTABLE +POSTHOOK: query: DROP TABLE kv_rename_test +POSTHOOK: type: DROPTABLE +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +src +src1 +src_json +src_sequencefile +src_thrift +srcbucket +srcbucket2 +srcpart +PREHOOK: query: -- Using non-default Database +CREATE DATABASE kv_rename_test_db +PREHOOK: type: CREATEDATABASE +POSTHOOK: query: -- Using non-default Database +CREATE DATABASE kv_rename_test_db +POSTHOOK: type: CREATEDATABASE +PREHOOK: query: USE kv_rename_test_db +PREHOOK: type: SWITCHDATABASE +POSTHOOK: query: USE kv_rename_test_db +POSTHOOK: type: SWITCHDATABASE +PREHOOK: query: CREATE TABLE kv_rename_test(a int, b int, c int) +PREHOOK: type: CREATETABLE +POSTHOOK: query: CREATE TABLE kv_rename_test(a int, b int, c int) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: kv_rename_test_db@kv_rename_test +PREHOOK: query: DESCRIBE kv_rename_test +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE kv_rename_test +POSTHOOK: type: DESCTABLE +a int +b int +c int +PREHOOK: query: ALTER TABLE kv_rename_test CHANGE a a STRING +PREHOOK: type: ALTERTABLE_RENAMECOL +POSTHOOK: query: ALTER TABLE kv_rename_test CHANGE a a STRING +POSTHOOK: type: ALTERTABLE_RENAMECOL +POSTHOOK: Input: kv_rename_test_db@kv_rename_test +POSTHOOK: Output: kv_rename_test_db@kv_rename_test +PREHOOK: query: DESCRIBE kv_rename_test +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE kv_rename_test +POSTHOOK: type: DESCTABLE +a string +b int +c int +PREHOOK: query: ALTER TABLE kv_rename_test CHANGE a a1 INT +PREHOOK: type: ALTERTABLE_RENAMECOL +POSTHOOK: query: ALTER TABLE kv_rename_test CHANGE a a1 INT +POSTHOOK: type: ALTERTABLE_RENAMECOL +POSTHOOK: Input: kv_rename_test_db@kv_rename_test +POSTHOOK: Output: kv_rename_test_db@kv_rename_test +PREHOOK: query: DESCRIBE kv_rename_test +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE kv_rename_test +POSTHOOK: type: DESCTABLE +a1 int +b int +c int +PREHOOK: query: ALTER TABLE kv_rename_test CHANGE a1 a2 INT FIRST +PREHOOK: type: ALTERTABLE_RENAMECOL +POSTHOOK: query: ALTER TABLE kv_rename_test CHANGE a1 a2 INT FIRST +POSTHOOK: type: ALTERTABLE_RENAMECOL +POSTHOOK: Input: kv_rename_test_db@kv_rename_test +POSTHOOK: Output: kv_rename_test_db@kv_rename_test +PREHOOK: query: DESCRIBE kv_rename_test +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE kv_rename_test +POSTHOOK: type: DESCTABLE +a2 int +b int +c int +PREHOOK: query: ALTER TABLE kv_rename_test CHANGE a2 a INT AFTER b +PREHOOK: type: ALTERTABLE_RENAMECOL +POSTHOOK: query: ALTER TABLE kv_rename_test CHANGE a2 a INT AFTER b +POSTHOOK: type: ALTERTABLE_RENAMECOL +POSTHOOK: Input: kv_rename_test_db@kv_rename_test +POSTHOOK: Output: kv_rename_test_db@kv_rename_test +PREHOOK: query: DESCRIBE kv_rename_test +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE kv_rename_test +POSTHOOK: type: DESCTABLE +b int +a int +c int +PREHOOK: query: ALTER TABLE kv_rename_test CHANGE a a1 INT COMMENT 'test comment1' +PREHOOK: type: ALTERTABLE_RENAMECOL +POSTHOOK: query: ALTER TABLE kv_rename_test CHANGE a a1 INT COMMENT 'test comment1' +POSTHOOK: type: ALTERTABLE_RENAMECOL +POSTHOOK: Input: kv_rename_test_db@kv_rename_test +POSTHOOK: Output: kv_rename_test_db@kv_rename_test +PREHOOK: query: DESCRIBE kv_rename_test +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE kv_rename_test +POSTHOOK: type: DESCTABLE +b int +a1 int test comment1 +c int +PREHOOK: query: ALTER TABLE kv_rename_test CHANGE a1 a2 INT COMMENT 'test comment2' FIRST +PREHOOK: type: ALTERTABLE_RENAMECOL +POSTHOOK: query: ALTER TABLE kv_rename_test CHANGE a1 a2 INT COMMENT 'test comment2' FIRST +POSTHOOK: type: ALTERTABLE_RENAMECOL +POSTHOOK: Input: kv_rename_test_db@kv_rename_test +POSTHOOK: Output: kv_rename_test_db@kv_rename_test +PREHOOK: query: DESCRIBE kv_rename_test +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE kv_rename_test +POSTHOOK: type: DESCTABLE +a2 int test comment2 +b int +c int +PREHOOK: query: ALTER TABLE kv_rename_test CHANGE COLUMN a2 a INT AFTER b +PREHOOK: type: ALTERTABLE_RENAMECOL +POSTHOOK: query: ALTER TABLE kv_rename_test CHANGE COLUMN a2 a INT AFTER b +POSTHOOK: type: ALTERTABLE_RENAMECOL +POSTHOOK: Input: kv_rename_test_db@kv_rename_test +POSTHOOK: Output: kv_rename_test_db@kv_rename_test +PREHOOK: query: DESCRIBE kv_rename_test +PREHOOK: type: DESCTABLE +POSTHOOK: query: DESCRIBE kv_rename_test +POSTHOOK: type: DESCTABLE +b int +a int test comment2 +c int +PREHOOK: query: DROP TABLE kv_rename_test +PREHOOK: type: DROPTABLE +POSTHOOK: query: DROP TABLE kv_rename_test +POSTHOOK: type: DROPTABLE +POSTHOOK: Output: kv_rename_test_db@kv_rename_test +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES