diff --git metastore/scripts/upgrade/derby/057-HIVE-19417.derby.sql metastore/scripts/upgrade/derby/057-HIVE-19417.derby.sql new file mode 100644 index 0000000000..f1b59fd35b --- /dev/null +++ metastore/scripts/upgrade/derby/057-HIVE-19417.derby.sql @@ -0,0 +1,46 @@ +CREATE TABLE "APP"."UPD_TXNS" ( + "UPDATE_ID" BIGINT NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" BIGINT NOT NULL, + "DB_NAME" VARCHAR(128) NOT NULL, + "TBL_NAME" VARCHAR(256) NOT NULL, + "TBL_ID" BIGINT NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" BIGINT NOT NULL, + "WRITEID_LIST" CLOB +); + +ALTER TABLE "APP"."UPD_TXNS" ADD CONSTRAINT "UPD_TXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE "APP"."UPD_TXNS" ADD CONSTRAINT "UPD_TXNS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION; + +CREATE TABLE "APP"."UPD_PARTTXNS" ( + "UPDATE_ID" BIGINT NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" BIGINT NOT NULL, + "PART_NAME" VARCHAR(767) NOT NULL, + "PART_ID" BIGINT NOT NULL, + "TBL_ID" BIGINT NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" BIGINT NOT NULL, + "WRITEID_LIST" CLOB +); + +ALTER TABLE "APP"."UPD_PARTTXNS" ADD CONSTRAINT "UPD_PARTTXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE "APP"."UPD_PARTTXNS" ADD CONSTRAINT "UPD_PARTTXNS_FK1" FOREIGN KEY ("PART_ID") REFERENCES "APP"."PARTITIONS" ("PART_ID") ON DELETE NO ACTION ON UPDATE NO ACTION; + +CREATE TABLE NEXT_UPDATE_COMMIT_SEQID ( + NUCS_NEXT bigint NOT NULL +); + +INSERT INTO NEXT_UPDATE_COMMIT_SEQID VALUES(1); + +-- Modify table stats related tables +ALTER TABLE TBLS ADD UPDATE_ID bigint; +ALTER TABLE PARTITIONS ADD UPDATE_ID bigint; + +-- Modify column stats related tables +ALTER TABLE TAB_COL_STATS ADD UPDATE_ID bigint; +ALTER TABLE PART_COL_STATS ADD UPDATE_ID bigint; + diff --git standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp index af975fce1b..a29e99dbfa 100644 --- standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp +++ standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp @@ -6309,6 +6309,16 @@ void Table::__set_ownerType(const PrincipalType::type val) { __isset.ownerType = true; } +void Table::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} + +void Table::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + uint32_t Table::read(::apache::thrift::protocol::TProtocol* iprot) { apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); @@ -6503,6 +6513,22 @@ uint32_t Table::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->skip(ftype); } break; + case 19: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 20: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -6615,6 +6641,16 @@ uint32_t Table::write(::apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeI32((int32_t)this->ownerType); xfer += oprot->writeFieldEnd(); } + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 19); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 20); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -6640,6 +6676,8 @@ void swap(Table &a, Table &b) { swap(a.creationMetadata, b.creationMetadata); swap(a.catName, b.catName); swap(a.ownerType, b.ownerType); + swap(a.writeId, b.writeId); + swap(a.validWriteIdList, b.validWriteIdList); swap(a.__isset, b.__isset); } @@ -6662,6 +6700,8 @@ Table::Table(const Table& other249) { creationMetadata = other249.creationMetadata; catName = other249.catName; ownerType = other249.ownerType; + writeId = other249.writeId; + validWriteIdList = other249.validWriteIdList; __isset = other249.__isset; } Table& Table::operator=(const Table& other250) { @@ -6683,6 +6723,8 @@ Table& Table::operator=(const Table& other250) { creationMetadata = other250.creationMetadata; catName = other250.catName; ownerType = other250.ownerType; + writeId = other250.writeId; + validWriteIdList = other250.validWriteIdList; __isset = other250.__isset; return *this; } @@ -6707,6 +6749,8 @@ void Table::printTo(std::ostream& out) const { out << ", " << "creationMetadata="; (__isset.creationMetadata ? (out << to_string(creationMetadata)) : (out << "")); out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); out << ", " << "ownerType="; (__isset.ownerType ? (out << to_string(ownerType)) : (out << "")); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); out << ")"; } @@ -6753,6 +6797,16 @@ void Partition::__set_catName(const std::string& val) { __isset.catName = true; } +void Partition::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} + +void Partition::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + uint32_t Partition::read(::apache::thrift::protocol::TProtocol* iprot) { apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); @@ -6873,6 +6927,22 @@ uint32_t Partition::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->skip(ftype); } break; + case 10: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -6945,6 +7015,16 @@ uint32_t Partition::write(::apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeString(this->catName); xfer += oprot->writeFieldEnd(); } + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 10); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 11); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -6961,6 +7041,8 @@ void swap(Partition &a, Partition &b) { swap(a.parameters, b.parameters); swap(a.privileges, b.privileges); swap(a.catName, b.catName); + swap(a.writeId, b.writeId); + swap(a.validWriteIdList, b.validWriteIdList); swap(a.__isset, b.__isset); } @@ -6974,6 +7056,8 @@ Partition::Partition(const Partition& other265) { parameters = other265.parameters; privileges = other265.privileges; catName = other265.catName; + writeId = other265.writeId; + validWriteIdList = other265.validWriteIdList; __isset = other265.__isset; } Partition& Partition::operator=(const Partition& other266) { @@ -6986,6 +7070,8 @@ Partition& Partition::operator=(const Partition& other266) { parameters = other266.parameters; privileges = other266.privileges; catName = other266.catName; + writeId = other266.writeId; + validWriteIdList = other266.validWriteIdList; __isset = other266.__isset; return *this; } @@ -7001,6 +7087,8 @@ void Partition::printTo(std::ostream& out) const { out << ", " << "parameters=" << to_string(parameters); out << ", " << "privileges="; (__isset.privileges ? (out << to_string(privileges)) : (out << "")); out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); out << ")"; } @@ -7249,6 +7337,16 @@ void PartitionSpecWithSharedSD::__set_sd(const StorageDescriptor& val) { this->sd = val; } +void PartitionSpecWithSharedSD::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} + +void PartitionSpecWithSharedSD::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + uint32_t PartitionSpecWithSharedSD::read(::apache::thrift::protocol::TProtocol* iprot) { apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); @@ -7298,6 +7396,22 @@ uint32_t PartitionSpecWithSharedSD::read(::apache::thrift::protocol::TProtocol* xfer += iprot->skip(ftype); } break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -7331,6 +7445,16 @@ uint32_t PartitionSpecWithSharedSD::write(::apache::thrift::protocol::TProtocol* xfer += this->sd.write(oprot); xfer += oprot->writeFieldEnd(); + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -7340,17 +7464,23 @@ void swap(PartitionSpecWithSharedSD &a, PartitionSpecWithSharedSD &b) { using ::std::swap; swap(a.partitions, b.partitions); swap(a.sd, b.sd); + swap(a.writeId, b.writeId); + swap(a.validWriteIdList, b.validWriteIdList); swap(a.__isset, b.__isset); } PartitionSpecWithSharedSD::PartitionSpecWithSharedSD(const PartitionSpecWithSharedSD& other289) { partitions = other289.partitions; sd = other289.sd; + writeId = other289.writeId; + validWriteIdList = other289.validWriteIdList; __isset = other289.__isset; } PartitionSpecWithSharedSD& PartitionSpecWithSharedSD::operator=(const PartitionSpecWithSharedSD& other290) { partitions = other290.partitions; sd = other290.sd; + writeId = other290.writeId; + validWriteIdList = other290.validWriteIdList; __isset = other290.__isset; return *this; } @@ -7359,6 +7489,8 @@ void PartitionSpecWithSharedSD::printTo(std::ostream& out) const { out << "PartitionSpecWithSharedSD("; out << "partitions=" << to_string(partitions); out << ", " << "sd=" << to_string(sd); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); out << ")"; } @@ -9431,6 +9563,16 @@ void ColumnStatisticsDesc::__set_catName(const std::string& val) { __isset.catName = true; } +void ColumnStatisticsDesc::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} + +void ColumnStatisticsDesc::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + uint32_t ColumnStatisticsDesc::read(::apache::thrift::protocol::TProtocol* iprot) { apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); @@ -9503,6 +9645,22 @@ uint32_t ColumnStatisticsDesc::read(::apache::thrift::protocol::TProtocol* iprot xfer += iprot->skip(ftype); } break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -9553,6 +9711,16 @@ uint32_t ColumnStatisticsDesc::write(::apache::thrift::protocol::TProtocol* opro xfer += oprot->writeString(this->catName); xfer += oprot->writeFieldEnd(); } + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 7); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -9566,6 +9734,8 @@ void swap(ColumnStatisticsDesc &a, ColumnStatisticsDesc &b) { swap(a.partName, b.partName); swap(a.lastAnalyzed, b.lastAnalyzed); swap(a.catName, b.catName); + swap(a.writeId, b.writeId); + swap(a.validWriteIdList, b.validWriteIdList); swap(a.__isset, b.__isset); } @@ -9576,6 +9746,8 @@ ColumnStatisticsDesc::ColumnStatisticsDesc(const ColumnStatisticsDesc& other323) partName = other323.partName; lastAnalyzed = other323.lastAnalyzed; catName = other323.catName; + writeId = other323.writeId; + validWriteIdList = other323.validWriteIdList; __isset = other323.__isset; } ColumnStatisticsDesc& ColumnStatisticsDesc::operator=(const ColumnStatisticsDesc& other324) { @@ -9585,6 +9757,8 @@ ColumnStatisticsDesc& ColumnStatisticsDesc::operator=(const ColumnStatisticsDesc partName = other324.partName; lastAnalyzed = other324.lastAnalyzed; catName = other324.catName; + writeId = other324.writeId; + validWriteIdList = other324.validWriteIdList; __isset = other324.__isset; return *this; } @@ -9597,6 +9771,8 @@ void ColumnStatisticsDesc::printTo(std::ostream& out) const { out << ", " << "partName="; (__isset.partName ? (out << to_string(partName)) : (out << "")); out << ", " << "lastAnalyzed="; (__isset.lastAnalyzed ? (out << to_string(lastAnalyzed)) : (out << "")); out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); out << ")"; } @@ -9872,6 +10048,16 @@ void SetPartitionsStatsRequest::__set_needMerge(const bool val) { __isset.needMerge = true; } +void SetPartitionsStatsRequest::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} + +void SetPartitionsStatsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + uint32_t SetPartitionsStatsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); @@ -9922,6 +10108,22 @@ uint32_t SetPartitionsStatsRequest::read(::apache::thrift::protocol::TProtocol* xfer += iprot->skip(ftype); } break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -9958,6 +10160,16 @@ uint32_t SetPartitionsStatsRequest::write(::apache::thrift::protocol::TProtocol* xfer += oprot->writeBool(this->needMerge); xfer += oprot->writeFieldEnd(); } + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -9967,17 +10179,23 @@ void swap(SetPartitionsStatsRequest &a, SetPartitionsStatsRequest &b) { using ::std::swap; swap(a.colStats, b.colStats); swap(a.needMerge, b.needMerge); + swap(a.writeId, b.writeId); + swap(a.validWriteIdList, b.validWriteIdList); swap(a.__isset, b.__isset); } SetPartitionsStatsRequest::SetPartitionsStatsRequest(const SetPartitionsStatsRequest& other347) { colStats = other347.colStats; needMerge = other347.needMerge; + writeId = other347.writeId; + validWriteIdList = other347.validWriteIdList; __isset = other347.__isset; } SetPartitionsStatsRequest& SetPartitionsStatsRequest::operator=(const SetPartitionsStatsRequest& other348) { colStats = other348.colStats; needMerge = other348.needMerge; + writeId = other348.writeId; + validWriteIdList = other348.validWriteIdList; __isset = other348.__isset; return *this; } @@ -9986,6 +10204,8 @@ void SetPartitionsStatsRequest::printTo(std::ostream& out) const { out << "SetPartitionsStatsRequest("; out << "colStats=" << to_string(colStats); out << ", " << "needMerge="; (__isset.needMerge ? (out << to_string(needMerge)) : (out << "")); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); out << ")"; } @@ -13096,6 +13316,16 @@ void TableStatsRequest::__set_catName(const std::string& val) { __isset.catName = true; } +void TableStatsRequest::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} + +void TableStatsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + uint32_t TableStatsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); @@ -13164,6 +13394,22 @@ uint32_t TableStatsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->skip(ftype); } break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -13212,6 +13458,16 @@ uint32_t TableStatsRequest::write(::apache::thrift::protocol::TProtocol* oprot) xfer += oprot->writeString(this->catName); xfer += oprot->writeFieldEnd(); } + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 5); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -13223,6 +13479,8 @@ void swap(TableStatsRequest &a, TableStatsRequest &b) { swap(a.tblName, b.tblName); swap(a.colNames, b.colNames); swap(a.catName, b.catName); + swap(a.writeId, b.writeId); + swap(a.validWriteIdList, b.validWriteIdList); swap(a.__isset, b.__isset); } @@ -13231,6 +13489,8 @@ TableStatsRequest::TableStatsRequest(const TableStatsRequest& other525) { tblName = other525.tblName; colNames = other525.colNames; catName = other525.catName; + writeId = other525.writeId; + validWriteIdList = other525.validWriteIdList; __isset = other525.__isset; } TableStatsRequest& TableStatsRequest::operator=(const TableStatsRequest& other526) { @@ -13238,6 +13498,8 @@ TableStatsRequest& TableStatsRequest::operator=(const TableStatsRequest& other52 tblName = other526.tblName; colNames = other526.colNames; catName = other526.catName; + writeId = other526.writeId; + validWriteIdList = other526.validWriteIdList; __isset = other526.__isset; return *this; } @@ -13248,6 +13510,8 @@ void TableStatsRequest::printTo(std::ostream& out) const { out << ", " << "tblName=" << to_string(tblName); out << ", " << "colNames=" << to_string(colNames); out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); out << ")"; } @@ -13277,6 +13541,16 @@ void PartitionsStatsRequest::__set_catName(const std::string& val) { __isset.catName = true; } +void PartitionsStatsRequest::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} + +void PartitionsStatsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + uint32_t PartitionsStatsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); @@ -13366,6 +13640,22 @@ uint32_t PartitionsStatsRequest::read(::apache::thrift::protocol::TProtocol* ipr xfer += iprot->skip(ftype); } break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -13428,6 +13718,16 @@ uint32_t PartitionsStatsRequest::write(::apache::thrift::protocol::TProtocol* op xfer += oprot->writeString(this->catName); xfer += oprot->writeFieldEnd(); } + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 6); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -13440,6 +13740,8 @@ void swap(PartitionsStatsRequest &a, PartitionsStatsRequest &b) { swap(a.colNames, b.colNames); swap(a.partNames, b.partNames); swap(a.catName, b.catName); + swap(a.writeId, b.writeId); + swap(a.validWriteIdList, b.validWriteIdList); swap(a.__isset, b.__isset); } @@ -13449,6 +13751,8 @@ PartitionsStatsRequest::PartitionsStatsRequest(const PartitionsStatsRequest& oth colNames = other539.colNames; partNames = other539.partNames; catName = other539.catName; + writeId = other539.writeId; + validWriteIdList = other539.validWriteIdList; __isset = other539.__isset; } PartitionsStatsRequest& PartitionsStatsRequest::operator=(const PartitionsStatsRequest& other540) { @@ -13457,6 +13761,8 @@ PartitionsStatsRequest& PartitionsStatsRequest::operator=(const PartitionsStatsR colNames = other540.colNames; partNames = other540.partNames; catName = other540.catName; + writeId = other540.writeId; + validWriteIdList = other540.validWriteIdList; __isset = other540.__isset; return *this; } @@ -13468,6 +13774,8 @@ void PartitionsStatsRequest::printTo(std::ostream& out) const { out << ", " << "colNames=" << to_string(colNames); out << ", " << "partNames=" << to_string(partNames); out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); out << ")"; } @@ -23860,6 +24168,16 @@ void GetTableRequest::__set_catName(const std::string& val) { __isset.catName = true; } +void GetTableRequest::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} + +void GetTableRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + uint32_t GetTableRequest::read(::apache::thrift::protocol::TProtocol* iprot) { apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); @@ -23915,6 +24233,22 @@ uint32_t GetTableRequest::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->skip(ftype); } break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -23954,6 +24288,16 @@ uint32_t GetTableRequest::write(::apache::thrift::protocol::TProtocol* oprot) co xfer += oprot->writeString(this->catName); xfer += oprot->writeFieldEnd(); } + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 5); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -23965,6 +24309,8 @@ void swap(GetTableRequest &a, GetTableRequest &b) { swap(a.tblName, b.tblName); swap(a.capabilities, b.capabilities); swap(a.catName, b.catName); + swap(a.writeId, b.writeId); + swap(a.validWriteIdList, b.validWriteIdList); swap(a.__isset, b.__isset); } @@ -23973,6 +24319,8 @@ GetTableRequest::GetTableRequest(const GetTableRequest& other960) { tblName = other960.tblName; capabilities = other960.capabilities; catName = other960.catName; + writeId = other960.writeId; + validWriteIdList = other960.validWriteIdList; __isset = other960.__isset; } GetTableRequest& GetTableRequest::operator=(const GetTableRequest& other961) { @@ -23980,6 +24328,8 @@ GetTableRequest& GetTableRequest::operator=(const GetTableRequest& other961) { tblName = other961.tblName; capabilities = other961.capabilities; catName = other961.catName; + writeId = other961.writeId; + validWriteIdList = other961.validWriteIdList; __isset = other961.__isset; return *this; } @@ -23990,6 +24340,8 @@ void GetTableRequest::printTo(std::ostream& out) const { out << ", " << "tblName=" << to_string(tblName); out << ", " << "capabilities="; (__isset.capabilities ? (out << to_string(capabilities)) : (out << "")); out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); out << ")"; } diff --git standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h index 7b42182d60..e6c5c68df6 100644 --- standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h +++ standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h @@ -3041,7 +3041,7 @@ inline std::ostream& operator<<(std::ostream& out, const StorageDescriptor& obj) } typedef struct _Table__isset { - _Table__isset() : tableName(false), dbName(false), owner(false), createTime(false), lastAccessTime(false), retention(false), sd(false), partitionKeys(false), parameters(false), viewOriginalText(false), viewExpandedText(false), tableType(false), privileges(false), temporary(true), rewriteEnabled(false), creationMetadata(false), catName(false), ownerType(true) {} + _Table__isset() : tableName(false), dbName(false), owner(false), createTime(false), lastAccessTime(false), retention(false), sd(false), partitionKeys(false), parameters(false), viewOriginalText(false), viewExpandedText(false), tableType(false), privileges(false), temporary(true), rewriteEnabled(false), creationMetadata(false), catName(false), ownerType(true), writeId(true), validWriteIdList(false) {} bool tableName :1; bool dbName :1; bool owner :1; @@ -3060,6 +3060,8 @@ typedef struct _Table__isset { bool creationMetadata :1; bool catName :1; bool ownerType :1; + bool writeId :1; + bool validWriteIdList :1; } _Table__isset; class Table { @@ -3067,7 +3069,7 @@ class Table { Table(const Table&); Table& operator=(const Table&); - Table() : tableName(), dbName(), owner(), createTime(0), lastAccessTime(0), retention(0), viewOriginalText(), viewExpandedText(), tableType(), temporary(false), rewriteEnabled(0), catName(), ownerType((PrincipalType::type)1) { + Table() : tableName(), dbName(), owner(), createTime(0), lastAccessTime(0), retention(0), viewOriginalText(), viewExpandedText(), tableType(), temporary(false), rewriteEnabled(0), catName(), ownerType((PrincipalType::type)1), writeId(-1LL), validWriteIdList() { ownerType = (PrincipalType::type)1; } @@ -3091,6 +3093,8 @@ class Table { CreationMetadata creationMetadata; std::string catName; PrincipalType::type ownerType; + int64_t writeId; + std::string validWriteIdList; _Table__isset __isset; @@ -3130,6 +3134,10 @@ class Table { void __set_ownerType(const PrincipalType::type val); + void __set_writeId(const int64_t val); + + void __set_validWriteIdList(const std::string& val); + bool operator == (const Table & rhs) const { if (!(tableName == rhs.tableName)) @@ -3180,6 +3188,14 @@ class Table { return false; else if (__isset.ownerType && !(ownerType == rhs.ownerType)) return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; return true; } bool operator != (const Table &rhs) const { @@ -3203,7 +3219,7 @@ inline std::ostream& operator<<(std::ostream& out, const Table& obj) } typedef struct _Partition__isset { - _Partition__isset() : values(false), dbName(false), tableName(false), createTime(false), lastAccessTime(false), sd(false), parameters(false), privileges(false), catName(false) {} + _Partition__isset() : values(false), dbName(false), tableName(false), createTime(false), lastAccessTime(false), sd(false), parameters(false), privileges(false), catName(false), writeId(true), validWriteIdList(false) {} bool values :1; bool dbName :1; bool tableName :1; @@ -3213,6 +3229,8 @@ typedef struct _Partition__isset { bool parameters :1; bool privileges :1; bool catName :1; + bool writeId :1; + bool validWriteIdList :1; } _Partition__isset; class Partition { @@ -3220,7 +3238,7 @@ class Partition { Partition(const Partition&); Partition& operator=(const Partition&); - Partition() : dbName(), tableName(), createTime(0), lastAccessTime(0), catName() { + Partition() : dbName(), tableName(), createTime(0), lastAccessTime(0), catName(), writeId(-1LL), validWriteIdList() { } virtual ~Partition() throw(); @@ -3233,6 +3251,8 @@ class Partition { std::map parameters; PrincipalPrivilegeSet privileges; std::string catName; + int64_t writeId; + std::string validWriteIdList; _Partition__isset __isset; @@ -3254,6 +3274,10 @@ class Partition { void __set_catName(const std::string& val); + void __set_writeId(const int64_t val); + + void __set_validWriteIdList(const std::string& val); + bool operator == (const Partition & rhs) const { if (!(values == rhs.values)) @@ -3278,6 +3302,14 @@ class Partition { return false; else if (__isset.catName && !(catName == rhs.catName)) return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; return true; } bool operator != (const Partition &rhs) const { @@ -3379,9 +3411,11 @@ inline std::ostream& operator<<(std::ostream& out, const PartitionWithoutSD& obj } typedef struct _PartitionSpecWithSharedSD__isset { - _PartitionSpecWithSharedSD__isset() : partitions(false), sd(false) {} + _PartitionSpecWithSharedSD__isset() : partitions(false), sd(false), writeId(true), validWriteIdList(false) {} bool partitions :1; bool sd :1; + bool writeId :1; + bool validWriteIdList :1; } _PartitionSpecWithSharedSD__isset; class PartitionSpecWithSharedSD { @@ -3389,12 +3423,14 @@ class PartitionSpecWithSharedSD { PartitionSpecWithSharedSD(const PartitionSpecWithSharedSD&); PartitionSpecWithSharedSD& operator=(const PartitionSpecWithSharedSD&); - PartitionSpecWithSharedSD() { + PartitionSpecWithSharedSD() : writeId(-1LL), validWriteIdList() { } virtual ~PartitionSpecWithSharedSD() throw(); std::vector partitions; StorageDescriptor sd; + int64_t writeId; + std::string validWriteIdList; _PartitionSpecWithSharedSD__isset __isset; @@ -3402,12 +3438,24 @@ class PartitionSpecWithSharedSD { void __set_sd(const StorageDescriptor& val); + void __set_writeId(const int64_t val); + + void __set_validWriteIdList(const std::string& val); + bool operator == (const PartitionSpecWithSharedSD & rhs) const { if (!(partitions == rhs.partitions)) return false; if (!(sd == rhs.sd)) return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; return true; } bool operator != (const PartitionSpecWithSharedSD &rhs) const { @@ -4266,10 +4314,12 @@ inline std::ostream& operator<<(std::ostream& out, const ColumnStatisticsObj& ob } typedef struct _ColumnStatisticsDesc__isset { - _ColumnStatisticsDesc__isset() : partName(false), lastAnalyzed(false), catName(false) {} + _ColumnStatisticsDesc__isset() : partName(false), lastAnalyzed(false), catName(false), writeId(true), validWriteIdList(false) {} bool partName :1; bool lastAnalyzed :1; bool catName :1; + bool writeId :1; + bool validWriteIdList :1; } _ColumnStatisticsDesc__isset; class ColumnStatisticsDesc { @@ -4277,7 +4327,7 @@ class ColumnStatisticsDesc { ColumnStatisticsDesc(const ColumnStatisticsDesc&); ColumnStatisticsDesc& operator=(const ColumnStatisticsDesc&); - ColumnStatisticsDesc() : isTblLevel(0), dbName(), tableName(), partName(), lastAnalyzed(0), catName() { + ColumnStatisticsDesc() : isTblLevel(0), dbName(), tableName(), partName(), lastAnalyzed(0), catName(), writeId(-1LL), validWriteIdList() { } virtual ~ColumnStatisticsDesc() throw(); @@ -4287,6 +4337,8 @@ class ColumnStatisticsDesc { std::string partName; int64_t lastAnalyzed; std::string catName; + int64_t writeId; + std::string validWriteIdList; _ColumnStatisticsDesc__isset __isset; @@ -4302,6 +4354,10 @@ class ColumnStatisticsDesc { void __set_catName(const std::string& val); + void __set_writeId(const int64_t val); + + void __set_validWriteIdList(const std::string& val); + bool operator == (const ColumnStatisticsDesc & rhs) const { if (!(isTblLevel == rhs.isTblLevel)) @@ -4322,6 +4378,14 @@ class ColumnStatisticsDesc { return false; else if (__isset.catName && !(catName == rhs.catName)) return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; return true; } bool operator != (const ColumnStatisticsDesc &rhs) const { @@ -4435,8 +4499,10 @@ inline std::ostream& operator<<(std::ostream& out, const AggrStats& obj) } typedef struct _SetPartitionsStatsRequest__isset { - _SetPartitionsStatsRequest__isset() : needMerge(false) {} + _SetPartitionsStatsRequest__isset() : needMerge(false), writeId(true), validWriteIdList(false) {} bool needMerge :1; + bool writeId :1; + bool validWriteIdList :1; } _SetPartitionsStatsRequest__isset; class SetPartitionsStatsRequest { @@ -4444,12 +4510,14 @@ class SetPartitionsStatsRequest { SetPartitionsStatsRequest(const SetPartitionsStatsRequest&); SetPartitionsStatsRequest& operator=(const SetPartitionsStatsRequest&); - SetPartitionsStatsRequest() : needMerge(0) { + SetPartitionsStatsRequest() : needMerge(0), writeId(-1LL), validWriteIdList() { } virtual ~SetPartitionsStatsRequest() throw(); std::vector colStats; bool needMerge; + int64_t writeId; + std::string validWriteIdList; _SetPartitionsStatsRequest__isset __isset; @@ -4457,6 +4525,10 @@ class SetPartitionsStatsRequest { void __set_needMerge(const bool val); + void __set_writeId(const int64_t val); + + void __set_validWriteIdList(const std::string& val); + bool operator == (const SetPartitionsStatsRequest & rhs) const { if (!(colStats == rhs.colStats)) @@ -4465,6 +4537,14 @@ class SetPartitionsStatsRequest { return false; else if (__isset.needMerge && !(needMerge == rhs.needMerge)) return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; return true; } bool operator != (const SetPartitionsStatsRequest &rhs) const { @@ -5663,8 +5743,10 @@ inline std::ostream& operator<<(std::ostream& out, const PartitionsStatsResult& } typedef struct _TableStatsRequest__isset { - _TableStatsRequest__isset() : catName(false) {} + _TableStatsRequest__isset() : catName(false), writeId(true), validWriteIdList(false) {} bool catName :1; + bool writeId :1; + bool validWriteIdList :1; } _TableStatsRequest__isset; class TableStatsRequest { @@ -5672,7 +5754,7 @@ class TableStatsRequest { TableStatsRequest(const TableStatsRequest&); TableStatsRequest& operator=(const TableStatsRequest&); - TableStatsRequest() : dbName(), tblName(), catName() { + TableStatsRequest() : dbName(), tblName(), catName(), writeId(-1LL), validWriteIdList() { } virtual ~TableStatsRequest() throw(); @@ -5680,6 +5762,8 @@ class TableStatsRequest { std::string tblName; std::vector colNames; std::string catName; + int64_t writeId; + std::string validWriteIdList; _TableStatsRequest__isset __isset; @@ -5691,6 +5775,10 @@ class TableStatsRequest { void __set_catName(const std::string& val); + void __set_writeId(const int64_t val); + + void __set_validWriteIdList(const std::string& val); + bool operator == (const TableStatsRequest & rhs) const { if (!(dbName == rhs.dbName)) @@ -5703,6 +5791,14 @@ class TableStatsRequest { return false; else if (__isset.catName && !(catName == rhs.catName)) return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; return true; } bool operator != (const TableStatsRequest &rhs) const { @@ -5726,8 +5822,10 @@ inline std::ostream& operator<<(std::ostream& out, const TableStatsRequest& obj) } typedef struct _PartitionsStatsRequest__isset { - _PartitionsStatsRequest__isset() : catName(false) {} + _PartitionsStatsRequest__isset() : catName(false), writeId(true), validWriteIdList(false) {} bool catName :1; + bool writeId :1; + bool validWriteIdList :1; } _PartitionsStatsRequest__isset; class PartitionsStatsRequest { @@ -5735,7 +5833,7 @@ class PartitionsStatsRequest { PartitionsStatsRequest(const PartitionsStatsRequest&); PartitionsStatsRequest& operator=(const PartitionsStatsRequest&); - PartitionsStatsRequest() : dbName(), tblName(), catName() { + PartitionsStatsRequest() : dbName(), tblName(), catName(), writeId(-1LL), validWriteIdList() { } virtual ~PartitionsStatsRequest() throw(); @@ -5744,6 +5842,8 @@ class PartitionsStatsRequest { std::vector colNames; std::vector partNames; std::string catName; + int64_t writeId; + std::string validWriteIdList; _PartitionsStatsRequest__isset __isset; @@ -5757,6 +5857,10 @@ class PartitionsStatsRequest { void __set_catName(const std::string& val); + void __set_writeId(const int64_t val); + + void __set_validWriteIdList(const std::string& val); + bool operator == (const PartitionsStatsRequest & rhs) const { if (!(dbName == rhs.dbName)) @@ -5771,6 +5875,14 @@ class PartitionsStatsRequest { return false; else if (__isset.catName && !(catName == rhs.catName)) return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; return true; } bool operator != (const PartitionsStatsRequest &rhs) const { @@ -9813,9 +9925,11 @@ inline std::ostream& operator<<(std::ostream& out, const ClientCapabilities& obj } typedef struct _GetTableRequest__isset { - _GetTableRequest__isset() : capabilities(false), catName(false) {} + _GetTableRequest__isset() : capabilities(false), catName(false), writeId(true), validWriteIdList(false) {} bool capabilities :1; bool catName :1; + bool writeId :1; + bool validWriteIdList :1; } _GetTableRequest__isset; class GetTableRequest { @@ -9823,7 +9937,7 @@ class GetTableRequest { GetTableRequest(const GetTableRequest&); GetTableRequest& operator=(const GetTableRequest&); - GetTableRequest() : dbName(), tblName(), catName() { + GetTableRequest() : dbName(), tblName(), catName(), writeId(-1LL), validWriteIdList() { } virtual ~GetTableRequest() throw(); @@ -9831,6 +9945,8 @@ class GetTableRequest { std::string tblName; ClientCapabilities capabilities; std::string catName; + int64_t writeId; + std::string validWriteIdList; _GetTableRequest__isset __isset; @@ -9842,6 +9958,10 @@ class GetTableRequest { void __set_catName(const std::string& val); + void __set_writeId(const int64_t val); + + void __set_validWriteIdList(const std::string& val); + bool operator == (const GetTableRequest & rhs) const { if (!(dbName == rhs.dbName)) @@ -9856,6 +9976,14 @@ class GetTableRequest { return false; else if (__isset.catName && !(catName == rhs.catName)) return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; return true; } bool operator != (const GetTableRequest &rhs) const { diff --git standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ColumnStatisticsDesc.java standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ColumnStatisticsDesc.java index 0e70758786..5d681d0a99 100644 --- standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ColumnStatisticsDesc.java +++ standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ColumnStatisticsDesc.java @@ -44,6 +44,8 @@ private static final org.apache.thrift.protocol.TField PART_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("partName", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField LAST_ANALYZED_FIELD_DESC = new org.apache.thrift.protocol.TField("lastAnalyzed", org.apache.thrift.protocol.TType.I64, (short)5); private static final org.apache.thrift.protocol.TField CAT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catName", org.apache.thrift.protocol.TType.STRING, (short)6); + private static final org.apache.thrift.protocol.TField WRITE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("writeId", org.apache.thrift.protocol.TType.I64, (short)7); + private static final org.apache.thrift.protocol.TField VALID_WRITE_ID_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("validWriteIdList", org.apache.thrift.protocol.TType.STRING, (short)8); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -57,6 +59,8 @@ private String partName; // optional private long lastAnalyzed; // optional private String catName; // optional + private long writeId; // optional + private String validWriteIdList; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -65,7 +69,9 @@ TABLE_NAME((short)3, "tableName"), PART_NAME((short)4, "partName"), LAST_ANALYZED((short)5, "lastAnalyzed"), - CAT_NAME((short)6, "catName"); + CAT_NAME((short)6, "catName"), + WRITE_ID((short)7, "writeId"), + VALID_WRITE_ID_LIST((short)8, "validWriteIdList"); private static final Map byName = new HashMap(); @@ -92,6 +98,10 @@ public static _Fields findByThriftId(int fieldId) { return LAST_ANALYZED; case 6: // CAT_NAME return CAT_NAME; + case 7: // WRITE_ID + return WRITE_ID; + case 8: // VALID_WRITE_ID_LIST + return VALID_WRITE_ID_LIST; default: return null; } @@ -134,8 +144,9 @@ public String getFieldName() { // isset id assignments private static final int __ISTBLLEVEL_ISSET_ID = 0; private static final int __LASTANALYZED_ISSET_ID = 1; + private static final int __WRITEID_ISSET_ID = 2; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.PART_NAME,_Fields.LAST_ANALYZED,_Fields.CAT_NAME}; + private static final _Fields optionals[] = {_Fields.PART_NAME,_Fields.LAST_ANALYZED,_Fields.CAT_NAME,_Fields.WRITE_ID,_Fields.VALID_WRITE_ID_LIST}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -151,11 +162,17 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.CAT_NAME, new org.apache.thrift.meta_data.FieldMetaData("catName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.WRITE_ID, new org.apache.thrift.meta_data.FieldMetaData("writeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.VALID_WRITE_ID_LIST, new org.apache.thrift.meta_data.FieldMetaData("validWriteIdList", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ColumnStatisticsDesc.class, metaDataMap); } public ColumnStatisticsDesc() { + this.writeId = -1L; + } public ColumnStatisticsDesc( @@ -189,6 +206,10 @@ public ColumnStatisticsDesc(ColumnStatisticsDesc other) { if (other.isSetCatName()) { this.catName = other.catName; } + this.writeId = other.writeId; + if (other.isSetValidWriteIdList()) { + this.validWriteIdList = other.validWriteIdList; + } } public ColumnStatisticsDesc deepCopy() { @@ -205,6 +226,9 @@ public void clear() { setLastAnalyzedIsSet(false); this.lastAnalyzed = 0; this.catName = null; + this.writeId = -1L; + + this.validWriteIdList = null; } public boolean isIsTblLevel() { @@ -343,6 +367,51 @@ public void setCatNameIsSet(boolean value) { } } + public long getWriteId() { + return this.writeId; + } + + public void setWriteId(long writeId) { + this.writeId = writeId; + setWriteIdIsSet(true); + } + + public void unsetWriteId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + /** Returns true if field writeId is set (has been assigned a value) and false otherwise */ + public boolean isSetWriteId() { + return EncodingUtils.testBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + public void setWriteIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WRITEID_ISSET_ID, value); + } + + public String getValidWriteIdList() { + return this.validWriteIdList; + } + + public void setValidWriteIdList(String validWriteIdList) { + this.validWriteIdList = validWriteIdList; + } + + public void unsetValidWriteIdList() { + this.validWriteIdList = null; + } + + /** Returns true if field validWriteIdList is set (has been assigned a value) and false otherwise */ + public boolean isSetValidWriteIdList() { + return this.validWriteIdList != null; + } + + public void setValidWriteIdListIsSet(boolean value) { + if (!value) { + this.validWriteIdList = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case IS_TBL_LEVEL: @@ -393,6 +462,22 @@ public void setFieldValue(_Fields field, Object value) { } break; + case WRITE_ID: + if (value == null) { + unsetWriteId(); + } else { + setWriteId((Long)value); + } + break; + + case VALID_WRITE_ID_LIST: + if (value == null) { + unsetValidWriteIdList(); + } else { + setValidWriteIdList((String)value); + } + break; + } } @@ -416,6 +501,12 @@ public Object getFieldValue(_Fields field) { case CAT_NAME: return getCatName(); + case WRITE_ID: + return getWriteId(); + + case VALID_WRITE_ID_LIST: + return getValidWriteIdList(); + } throw new IllegalStateException(); } @@ -439,6 +530,10 @@ public boolean isSet(_Fields field) { return isSetLastAnalyzed(); case CAT_NAME: return isSetCatName(); + case WRITE_ID: + return isSetWriteId(); + case VALID_WRITE_ID_LIST: + return isSetValidWriteIdList(); } throw new IllegalStateException(); } @@ -510,6 +605,24 @@ public boolean equals(ColumnStatisticsDesc that) { return false; } + boolean this_present_writeId = true && this.isSetWriteId(); + boolean that_present_writeId = true && that.isSetWriteId(); + if (this_present_writeId || that_present_writeId) { + if (!(this_present_writeId && that_present_writeId)) + return false; + if (this.writeId != that.writeId) + return false; + } + + boolean this_present_validWriteIdList = true && this.isSetValidWriteIdList(); + boolean that_present_validWriteIdList = true && that.isSetValidWriteIdList(); + if (this_present_validWriteIdList || that_present_validWriteIdList) { + if (!(this_present_validWriteIdList && that_present_validWriteIdList)) + return false; + if (!this.validWriteIdList.equals(that.validWriteIdList)) + return false; + } + return true; } @@ -547,6 +660,16 @@ public int hashCode() { if (present_catName) list.add(catName); + boolean present_writeId = true && (isSetWriteId()); + list.add(present_writeId); + if (present_writeId) + list.add(writeId); + + boolean present_validWriteIdList = true && (isSetValidWriteIdList()); + list.add(present_validWriteIdList); + if (present_validWriteIdList) + list.add(validWriteIdList); + return list.hashCode(); } @@ -618,6 +741,26 @@ public int compareTo(ColumnStatisticsDesc other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetWriteId()).compareTo(other.isSetWriteId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetWriteId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeId, other.writeId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetValidWriteIdList()).compareTo(other.isSetValidWriteIdList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValidWriteIdList()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.validWriteIdList, other.validWriteIdList); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -683,6 +826,22 @@ public String toString() { } first = false; } + if (isSetWriteId()) { + if (!first) sb.append(", "); + sb.append("writeId:"); + sb.append(this.writeId); + first = false; + } + if (isSetValidWriteIdList()) { + if (!first) sb.append(", "); + sb.append("validWriteIdList:"); + if (this.validWriteIdList == null) { + sb.append("null"); + } else { + sb.append(this.validWriteIdList); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -788,6 +947,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, ColumnStatisticsDes org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 7: // WRITE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // VALID_WRITE_ID_LIST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -833,6 +1008,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, ColumnStatisticsDe oprot.writeFieldEnd(); } } + if (struct.isSetWriteId()) { + oprot.writeFieldBegin(WRITE_ID_FIELD_DESC); + oprot.writeI64(struct.writeId); + oprot.writeFieldEnd(); + } + if (struct.validWriteIdList != null) { + if (struct.isSetValidWriteIdList()) { + oprot.writeFieldBegin(VALID_WRITE_ID_LIST_FIELD_DESC); + oprot.writeString(struct.validWriteIdList); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -863,7 +1050,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, ColumnStatisticsDes if (struct.isSetCatName()) { optionals.set(2); } - oprot.writeBitSet(optionals, 3); + if (struct.isSetWriteId()) { + optionals.set(3); + } + if (struct.isSetValidWriteIdList()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); if (struct.isSetPartName()) { oprot.writeString(struct.partName); } @@ -873,6 +1066,12 @@ public void write(org.apache.thrift.protocol.TProtocol prot, ColumnStatisticsDes if (struct.isSetCatName()) { oprot.writeString(struct.catName); } + if (struct.isSetWriteId()) { + oprot.writeI64(struct.writeId); + } + if (struct.isSetValidWriteIdList()) { + oprot.writeString(struct.validWriteIdList); + } } @Override @@ -884,7 +1083,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, ColumnStatisticsDesc struct.setDbNameIsSet(true); struct.tableName = iprot.readString(); struct.setTableNameIsSet(true); - BitSet incoming = iprot.readBitSet(3); + BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.partName = iprot.readString(); struct.setPartNameIsSet(true); @@ -897,6 +1096,14 @@ public void read(org.apache.thrift.protocol.TProtocol prot, ColumnStatisticsDesc struct.catName = iprot.readString(); struct.setCatNameIsSet(true); } + if (incoming.get(3)) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } + if (incoming.get(4)) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } } } diff --git standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetTableRequest.java standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetTableRequest.java index 3c88d8fc6d..58a36eddb1 100644 --- standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetTableRequest.java +++ standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetTableRequest.java @@ -42,6 +42,8 @@ private static final org.apache.thrift.protocol.TField TBL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tblName", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField CAPABILITIES_FIELD_DESC = new org.apache.thrift.protocol.TField("capabilities", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField CAT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catName", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField WRITE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("writeId", org.apache.thrift.protocol.TType.I64, (short)5); + private static final org.apache.thrift.protocol.TField VALID_WRITE_ID_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("validWriteIdList", org.apache.thrift.protocol.TType.STRING, (short)6); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -53,13 +55,17 @@ private String tblName; // required private ClientCapabilities capabilities; // optional private String catName; // optional + private long writeId; // optional + private String validWriteIdList; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { DB_NAME((short)1, "dbName"), TBL_NAME((short)2, "tblName"), CAPABILITIES((short)3, "capabilities"), - CAT_NAME((short)4, "catName"); + CAT_NAME((short)4, "catName"), + WRITE_ID((short)5, "writeId"), + VALID_WRITE_ID_LIST((short)6, "validWriteIdList"); private static final Map byName = new HashMap(); @@ -82,6 +88,10 @@ public static _Fields findByThriftId(int fieldId) { return CAPABILITIES; case 4: // CAT_NAME return CAT_NAME; + case 5: // WRITE_ID + return WRITE_ID; + case 6: // VALID_WRITE_ID_LIST + return VALID_WRITE_ID_LIST; default: return null; } @@ -122,7 +132,9 @@ public String getFieldName() { } // isset id assignments - private static final _Fields optionals[] = {_Fields.CAPABILITIES,_Fields.CAT_NAME}; + private static final int __WRITEID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.CAPABILITIES,_Fields.CAT_NAME,_Fields.WRITE_ID,_Fields.VALID_WRITE_ID_LIST}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -134,11 +146,17 @@ public String getFieldName() { new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientCapabilities.class))); tmpMap.put(_Fields.CAT_NAME, new org.apache.thrift.meta_data.FieldMetaData("catName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.WRITE_ID, new org.apache.thrift.meta_data.FieldMetaData("writeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.VALID_WRITE_ID_LIST, new org.apache.thrift.meta_data.FieldMetaData("validWriteIdList", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTableRequest.class, metaDataMap); } public GetTableRequest() { + this.writeId = -1L; + } public GetTableRequest( @@ -154,6 +172,7 @@ public GetTableRequest( * Performs a deep copy on other. */ public GetTableRequest(GetTableRequest other) { + __isset_bitfield = other.__isset_bitfield; if (other.isSetDbName()) { this.dbName = other.dbName; } @@ -166,6 +185,10 @@ public GetTableRequest(GetTableRequest other) { if (other.isSetCatName()) { this.catName = other.catName; } + this.writeId = other.writeId; + if (other.isSetValidWriteIdList()) { + this.validWriteIdList = other.validWriteIdList; + } } public GetTableRequest deepCopy() { @@ -178,6 +201,9 @@ public void clear() { this.tblName = null; this.capabilities = null; this.catName = null; + this.writeId = -1L; + + this.validWriteIdList = null; } public String getDbName() { @@ -272,6 +298,51 @@ public void setCatNameIsSet(boolean value) { } } + public long getWriteId() { + return this.writeId; + } + + public void setWriteId(long writeId) { + this.writeId = writeId; + setWriteIdIsSet(true); + } + + public void unsetWriteId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + /** Returns true if field writeId is set (has been assigned a value) and false otherwise */ + public boolean isSetWriteId() { + return EncodingUtils.testBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + public void setWriteIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WRITEID_ISSET_ID, value); + } + + public String getValidWriteIdList() { + return this.validWriteIdList; + } + + public void setValidWriteIdList(String validWriteIdList) { + this.validWriteIdList = validWriteIdList; + } + + public void unsetValidWriteIdList() { + this.validWriteIdList = null; + } + + /** Returns true if field validWriteIdList is set (has been assigned a value) and false otherwise */ + public boolean isSetValidWriteIdList() { + return this.validWriteIdList != null; + } + + public void setValidWriteIdListIsSet(boolean value) { + if (!value) { + this.validWriteIdList = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case DB_NAME: @@ -306,6 +377,22 @@ public void setFieldValue(_Fields field, Object value) { } break; + case WRITE_ID: + if (value == null) { + unsetWriteId(); + } else { + setWriteId((Long)value); + } + break; + + case VALID_WRITE_ID_LIST: + if (value == null) { + unsetValidWriteIdList(); + } else { + setValidWriteIdList((String)value); + } + break; + } } @@ -323,6 +410,12 @@ public Object getFieldValue(_Fields field) { case CAT_NAME: return getCatName(); + case WRITE_ID: + return getWriteId(); + + case VALID_WRITE_ID_LIST: + return getValidWriteIdList(); + } throw new IllegalStateException(); } @@ -342,6 +435,10 @@ public boolean isSet(_Fields field) { return isSetCapabilities(); case CAT_NAME: return isSetCatName(); + case WRITE_ID: + return isSetWriteId(); + case VALID_WRITE_ID_LIST: + return isSetValidWriteIdList(); } throw new IllegalStateException(); } @@ -395,6 +492,24 @@ public boolean equals(GetTableRequest that) { return false; } + boolean this_present_writeId = true && this.isSetWriteId(); + boolean that_present_writeId = true && that.isSetWriteId(); + if (this_present_writeId || that_present_writeId) { + if (!(this_present_writeId && that_present_writeId)) + return false; + if (this.writeId != that.writeId) + return false; + } + + boolean this_present_validWriteIdList = true && this.isSetValidWriteIdList(); + boolean that_present_validWriteIdList = true && that.isSetValidWriteIdList(); + if (this_present_validWriteIdList || that_present_validWriteIdList) { + if (!(this_present_validWriteIdList && that_present_validWriteIdList)) + return false; + if (!this.validWriteIdList.equals(that.validWriteIdList)) + return false; + } + return true; } @@ -422,6 +537,16 @@ public int hashCode() { if (present_catName) list.add(catName); + boolean present_writeId = true && (isSetWriteId()); + list.add(present_writeId); + if (present_writeId) + list.add(writeId); + + boolean present_validWriteIdList = true && (isSetValidWriteIdList()); + list.add(present_validWriteIdList); + if (present_validWriteIdList) + list.add(validWriteIdList); + return list.hashCode(); } @@ -473,6 +598,26 @@ public int compareTo(GetTableRequest other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetWriteId()).compareTo(other.isSetWriteId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetWriteId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeId, other.writeId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetValidWriteIdList()).compareTo(other.isSetValidWriteIdList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValidWriteIdList()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.validWriteIdList, other.validWriteIdList); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -528,6 +673,22 @@ public String toString() { } first = false; } + if (isSetWriteId()) { + if (!first) sb.append(", "); + sb.append("writeId:"); + sb.append(this.writeId); + first = false; + } + if (isSetValidWriteIdList()) { + if (!first) sb.append(", "); + sb.append("validWriteIdList:"); + if (this.validWriteIdList == null) { + sb.append("null"); + } else { + sb.append(this.validWriteIdList); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -558,6 +719,8 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); @@ -615,6 +778,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, GetTableRequest str org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 5: // WRITE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // VALID_WRITE_ID_LIST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -652,6 +831,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetTableRequest st oprot.writeFieldEnd(); } } + if (struct.isSetWriteId()) { + oprot.writeFieldBegin(WRITE_ID_FIELD_DESC); + oprot.writeI64(struct.writeId); + oprot.writeFieldEnd(); + } + if (struct.validWriteIdList != null) { + if (struct.isSetValidWriteIdList()) { + oprot.writeFieldBegin(VALID_WRITE_ID_LIST_FIELD_DESC); + oprot.writeString(struct.validWriteIdList); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -678,13 +869,25 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetTableRequest str if (struct.isSetCatName()) { optionals.set(1); } - oprot.writeBitSet(optionals, 2); + if (struct.isSetWriteId()) { + optionals.set(2); + } + if (struct.isSetValidWriteIdList()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); if (struct.isSetCapabilities()) { struct.capabilities.write(oprot); } if (struct.isSetCatName()) { oprot.writeString(struct.catName); } + if (struct.isSetWriteId()) { + oprot.writeI64(struct.writeId); + } + if (struct.isSetValidWriteIdList()) { + oprot.writeString(struct.validWriteIdList); + } } @Override @@ -694,7 +897,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetTableRequest stru struct.setDbNameIsSet(true); struct.tblName = iprot.readString(); struct.setTblNameIsSet(true); - BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.capabilities = new ClientCapabilities(); struct.capabilities.read(iprot); @@ -704,6 +907,14 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetTableRequest stru struct.catName = iprot.readString(); struct.setCatNameIsSet(true); } + if (incoming.get(2)) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } + if (incoming.get(3)) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } } } diff --git standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Partition.java standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Partition.java index c58e1cb7d9..811f65bdb6 100644 --- standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Partition.java +++ standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Partition.java @@ -47,6 +47,8 @@ private static final org.apache.thrift.protocol.TField PARAMETERS_FIELD_DESC = new org.apache.thrift.protocol.TField("parameters", org.apache.thrift.protocol.TType.MAP, (short)7); private static final org.apache.thrift.protocol.TField PRIVILEGES_FIELD_DESC = new org.apache.thrift.protocol.TField("privileges", org.apache.thrift.protocol.TType.STRUCT, (short)8); private static final org.apache.thrift.protocol.TField CAT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catName", org.apache.thrift.protocol.TType.STRING, (short)9); + private static final org.apache.thrift.protocol.TField WRITE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("writeId", org.apache.thrift.protocol.TType.I64, (short)10); + private static final org.apache.thrift.protocol.TField VALID_WRITE_ID_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("validWriteIdList", org.apache.thrift.protocol.TType.STRING, (short)11); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -63,6 +65,8 @@ private Map parameters; // required private PrincipalPrivilegeSet privileges; // optional private String catName; // optional + private long writeId; // optional + private String validWriteIdList; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -74,7 +78,9 @@ SD((short)6, "sd"), PARAMETERS((short)7, "parameters"), PRIVILEGES((short)8, "privileges"), - CAT_NAME((short)9, "catName"); + CAT_NAME((short)9, "catName"), + WRITE_ID((short)10, "writeId"), + VALID_WRITE_ID_LIST((short)11, "validWriteIdList"); private static final Map byName = new HashMap(); @@ -107,6 +113,10 @@ public static _Fields findByThriftId(int fieldId) { return PRIVILEGES; case 9: // CAT_NAME return CAT_NAME; + case 10: // WRITE_ID + return WRITE_ID; + case 11: // VALID_WRITE_ID_LIST + return VALID_WRITE_ID_LIST; default: return null; } @@ -149,8 +159,9 @@ public String getFieldName() { // isset id assignments private static final int __CREATETIME_ISSET_ID = 0; private static final int __LASTACCESSTIME_ISSET_ID = 1; + private static final int __WRITEID_ISSET_ID = 2; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.PRIVILEGES,_Fields.CAT_NAME}; + private static final _Fields optionals[] = {_Fields.PRIVILEGES,_Fields.CAT_NAME,_Fields.WRITE_ID,_Fields.VALID_WRITE_ID_LIST}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -175,11 +186,17 @@ public String getFieldName() { new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PrincipalPrivilegeSet.class))); tmpMap.put(_Fields.CAT_NAME, new org.apache.thrift.meta_data.FieldMetaData("catName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.WRITE_ID, new org.apache.thrift.meta_data.FieldMetaData("writeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.VALID_WRITE_ID_LIST, new org.apache.thrift.meta_data.FieldMetaData("validWriteIdList", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Partition.class, metaDataMap); } public Partition() { + this.writeId = -1L; + } public Partition( @@ -233,6 +250,10 @@ public Partition(Partition other) { if (other.isSetCatName()) { this.catName = other.catName; } + this.writeId = other.writeId; + if (other.isSetValidWriteIdList()) { + this.validWriteIdList = other.validWriteIdList; + } } public Partition deepCopy() { @@ -252,6 +273,9 @@ public void clear() { this.parameters = null; this.privileges = null; this.catName = null; + this.writeId = -1L; + + this.validWriteIdList = null; } public int getValuesSize() { @@ -485,6 +509,51 @@ public void setCatNameIsSet(boolean value) { } } + public long getWriteId() { + return this.writeId; + } + + public void setWriteId(long writeId) { + this.writeId = writeId; + setWriteIdIsSet(true); + } + + public void unsetWriteId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + /** Returns true if field writeId is set (has been assigned a value) and false otherwise */ + public boolean isSetWriteId() { + return EncodingUtils.testBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + public void setWriteIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WRITEID_ISSET_ID, value); + } + + public String getValidWriteIdList() { + return this.validWriteIdList; + } + + public void setValidWriteIdList(String validWriteIdList) { + this.validWriteIdList = validWriteIdList; + } + + public void unsetValidWriteIdList() { + this.validWriteIdList = null; + } + + /** Returns true if field validWriteIdList is set (has been assigned a value) and false otherwise */ + public boolean isSetValidWriteIdList() { + return this.validWriteIdList != null; + } + + public void setValidWriteIdListIsSet(boolean value) { + if (!value) { + this.validWriteIdList = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUES: @@ -559,6 +628,22 @@ public void setFieldValue(_Fields field, Object value) { } break; + case WRITE_ID: + if (value == null) { + unsetWriteId(); + } else { + setWriteId((Long)value); + } + break; + + case VALID_WRITE_ID_LIST: + if (value == null) { + unsetValidWriteIdList(); + } else { + setValidWriteIdList((String)value); + } + break; + } } @@ -591,6 +676,12 @@ public Object getFieldValue(_Fields field) { case CAT_NAME: return getCatName(); + case WRITE_ID: + return getWriteId(); + + case VALID_WRITE_ID_LIST: + return getValidWriteIdList(); + } throw new IllegalStateException(); } @@ -620,6 +711,10 @@ public boolean isSet(_Fields field) { return isSetPrivileges(); case CAT_NAME: return isSetCatName(); + case WRITE_ID: + return isSetWriteId(); + case VALID_WRITE_ID_LIST: + return isSetValidWriteIdList(); } throw new IllegalStateException(); } @@ -718,6 +813,24 @@ public boolean equals(Partition that) { return false; } + boolean this_present_writeId = true && this.isSetWriteId(); + boolean that_present_writeId = true && that.isSetWriteId(); + if (this_present_writeId || that_present_writeId) { + if (!(this_present_writeId && that_present_writeId)) + return false; + if (this.writeId != that.writeId) + return false; + } + + boolean this_present_validWriteIdList = true && this.isSetValidWriteIdList(); + boolean that_present_validWriteIdList = true && that.isSetValidWriteIdList(); + if (this_present_validWriteIdList || that_present_validWriteIdList) { + if (!(this_present_validWriteIdList && that_present_validWriteIdList)) + return false; + if (!this.validWriteIdList.equals(that.validWriteIdList)) + return false; + } + return true; } @@ -770,6 +883,16 @@ public int hashCode() { if (present_catName) list.add(catName); + boolean present_writeId = true && (isSetWriteId()); + list.add(present_writeId); + if (present_writeId) + list.add(writeId); + + boolean present_validWriteIdList = true && (isSetValidWriteIdList()); + list.add(present_validWriteIdList); + if (present_validWriteIdList) + list.add(validWriteIdList); + return list.hashCode(); } @@ -871,6 +994,26 @@ public int compareTo(Partition other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetWriteId()).compareTo(other.isSetWriteId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetWriteId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeId, other.writeId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetValidWriteIdList()).compareTo(other.isSetValidWriteIdList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValidWriteIdList()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.validWriteIdList, other.validWriteIdList); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -958,6 +1101,22 @@ public String toString() { } first = false; } + if (isSetWriteId()) { + if (!first) sb.append(", "); + sb.append("writeId:"); + sb.append(this.writeId); + first = false; + } + if (isSetValidWriteIdList()) { + if (!first) sb.append(", "); + sb.append("validWriteIdList:"); + if (this.validWriteIdList == null) { + sb.append("null"); + } else { + sb.append(this.validWriteIdList); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -1105,6 +1264,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, Partition struct) t org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 10: // WRITE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 11: // VALID_WRITE_ID_LIST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -1178,6 +1353,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, Partition struct) oprot.writeFieldEnd(); } } + if (struct.isSetWriteId()) { + oprot.writeFieldBegin(WRITE_ID_FIELD_DESC); + oprot.writeI64(struct.writeId); + oprot.writeFieldEnd(); + } + if (struct.validWriteIdList != null) { + if (struct.isSetValidWriteIdList()) { + oprot.writeFieldBegin(VALID_WRITE_ID_LIST_FIELD_DESC); + oprot.writeString(struct.validWriteIdList); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -1223,7 +1410,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, Partition struct) t if (struct.isSetCatName()) { optionals.set(8); } - oprot.writeBitSet(optionals, 9); + if (struct.isSetWriteId()) { + optionals.set(9); + } + if (struct.isSetValidWriteIdList()) { + optionals.set(10); + } + oprot.writeBitSet(optionals, 11); if (struct.isSetValues()) { { oprot.writeI32(struct.values.size()); @@ -1264,12 +1457,18 @@ public void write(org.apache.thrift.protocol.TProtocol prot, Partition struct) t if (struct.isSetCatName()) { oprot.writeString(struct.catName); } + if (struct.isSetWriteId()) { + oprot.writeI64(struct.writeId); + } + if (struct.isSetValidWriteIdList()) { + oprot.writeString(struct.validWriteIdList); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, Partition struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(9); + BitSet incoming = iprot.readBitSet(11); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list227 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); @@ -1328,6 +1527,14 @@ public void read(org.apache.thrift.protocol.TProtocol prot, Partition struct) th struct.catName = iprot.readString(); struct.setCatNameIsSet(true); } + if (incoming.get(9)) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } + if (incoming.get(10)) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } } } diff --git standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PartitionSpecWithSharedSD.java standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PartitionSpecWithSharedSD.java index a450cd4fc2..0e4039d731 100644 --- standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PartitionSpecWithSharedSD.java +++ standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PartitionSpecWithSharedSD.java @@ -40,6 +40,8 @@ private static final org.apache.thrift.protocol.TField PARTITIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("partitions", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField SD_FIELD_DESC = new org.apache.thrift.protocol.TField("sd", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField WRITE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("writeId", org.apache.thrift.protocol.TType.I64, (short)3); + private static final org.apache.thrift.protocol.TField VALID_WRITE_ID_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("validWriteIdList", org.apache.thrift.protocol.TType.STRING, (short)4); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -49,11 +51,15 @@ private List partitions; // required private StorageDescriptor sd; // required + private long writeId; // optional + private String validWriteIdList; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PARTITIONS((short)1, "partitions"), - SD((short)2, "sd"); + SD((short)2, "sd"), + WRITE_ID((short)3, "writeId"), + VALID_WRITE_ID_LIST((short)4, "validWriteIdList"); private static final Map byName = new HashMap(); @@ -72,6 +78,10 @@ public static _Fields findByThriftId(int fieldId) { return PARTITIONS; case 2: // SD return SD; + case 3: // WRITE_ID + return WRITE_ID; + case 4: // VALID_WRITE_ID_LIST + return VALID_WRITE_ID_LIST; default: return null; } @@ -112,6 +122,9 @@ public String getFieldName() { } // isset id assignments + private static final int __WRITEID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.WRITE_ID,_Fields.VALID_WRITE_ID_LIST}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -120,11 +133,17 @@ public String getFieldName() { new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PartitionWithoutSD.class)))); tmpMap.put(_Fields.SD, new org.apache.thrift.meta_data.FieldMetaData("sd", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StorageDescriptor.class))); + tmpMap.put(_Fields.WRITE_ID, new org.apache.thrift.meta_data.FieldMetaData("writeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.VALID_WRITE_ID_LIST, new org.apache.thrift.meta_data.FieldMetaData("validWriteIdList", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PartitionSpecWithSharedSD.class, metaDataMap); } public PartitionSpecWithSharedSD() { + this.writeId = -1L; + } public PartitionSpecWithSharedSD( @@ -140,6 +159,7 @@ public PartitionSpecWithSharedSD( * Performs a deep copy on other. */ public PartitionSpecWithSharedSD(PartitionSpecWithSharedSD other) { + __isset_bitfield = other.__isset_bitfield; if (other.isSetPartitions()) { List __this__partitions = new ArrayList(other.partitions.size()); for (PartitionWithoutSD other_element : other.partitions) { @@ -150,6 +170,10 @@ public PartitionSpecWithSharedSD(PartitionSpecWithSharedSD other) { if (other.isSetSd()) { this.sd = new StorageDescriptor(other.sd); } + this.writeId = other.writeId; + if (other.isSetValidWriteIdList()) { + this.validWriteIdList = other.validWriteIdList; + } } public PartitionSpecWithSharedSD deepCopy() { @@ -160,6 +184,9 @@ public PartitionSpecWithSharedSD deepCopy() { public void clear() { this.partitions = null; this.sd = null; + this.writeId = -1L; + + this.validWriteIdList = null; } public int getPartitionsSize() { @@ -223,6 +250,51 @@ public void setSdIsSet(boolean value) { } } + public long getWriteId() { + return this.writeId; + } + + public void setWriteId(long writeId) { + this.writeId = writeId; + setWriteIdIsSet(true); + } + + public void unsetWriteId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + /** Returns true if field writeId is set (has been assigned a value) and false otherwise */ + public boolean isSetWriteId() { + return EncodingUtils.testBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + public void setWriteIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WRITEID_ISSET_ID, value); + } + + public String getValidWriteIdList() { + return this.validWriteIdList; + } + + public void setValidWriteIdList(String validWriteIdList) { + this.validWriteIdList = validWriteIdList; + } + + public void unsetValidWriteIdList() { + this.validWriteIdList = null; + } + + /** Returns true if field validWriteIdList is set (has been assigned a value) and false otherwise */ + public boolean isSetValidWriteIdList() { + return this.validWriteIdList != null; + } + + public void setValidWriteIdListIsSet(boolean value) { + if (!value) { + this.validWriteIdList = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case PARTITIONS: @@ -241,6 +313,22 @@ public void setFieldValue(_Fields field, Object value) { } break; + case WRITE_ID: + if (value == null) { + unsetWriteId(); + } else { + setWriteId((Long)value); + } + break; + + case VALID_WRITE_ID_LIST: + if (value == null) { + unsetValidWriteIdList(); + } else { + setValidWriteIdList((String)value); + } + break; + } } @@ -252,6 +340,12 @@ public Object getFieldValue(_Fields field) { case SD: return getSd(); + case WRITE_ID: + return getWriteId(); + + case VALID_WRITE_ID_LIST: + return getValidWriteIdList(); + } throw new IllegalStateException(); } @@ -267,6 +361,10 @@ public boolean isSet(_Fields field) { return isSetPartitions(); case SD: return isSetSd(); + case WRITE_ID: + return isSetWriteId(); + case VALID_WRITE_ID_LIST: + return isSetValidWriteIdList(); } throw new IllegalStateException(); } @@ -302,6 +400,24 @@ public boolean equals(PartitionSpecWithSharedSD that) { return false; } + boolean this_present_writeId = true && this.isSetWriteId(); + boolean that_present_writeId = true && that.isSetWriteId(); + if (this_present_writeId || that_present_writeId) { + if (!(this_present_writeId && that_present_writeId)) + return false; + if (this.writeId != that.writeId) + return false; + } + + boolean this_present_validWriteIdList = true && this.isSetValidWriteIdList(); + boolean that_present_validWriteIdList = true && that.isSetValidWriteIdList(); + if (this_present_validWriteIdList || that_present_validWriteIdList) { + if (!(this_present_validWriteIdList && that_present_validWriteIdList)) + return false; + if (!this.validWriteIdList.equals(that.validWriteIdList)) + return false; + } + return true; } @@ -319,6 +435,16 @@ public int hashCode() { if (present_sd) list.add(sd); + boolean present_writeId = true && (isSetWriteId()); + list.add(present_writeId); + if (present_writeId) + list.add(writeId); + + boolean present_validWriteIdList = true && (isSetValidWriteIdList()); + list.add(present_validWriteIdList); + if (present_validWriteIdList) + list.add(validWriteIdList); + return list.hashCode(); } @@ -350,6 +476,26 @@ public int compareTo(PartitionSpecWithSharedSD other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetWriteId()).compareTo(other.isSetWriteId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetWriteId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeId, other.writeId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetValidWriteIdList()).compareTo(other.isSetValidWriteIdList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValidWriteIdList()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.validWriteIdList, other.validWriteIdList); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -385,6 +531,22 @@ public String toString() { sb.append(this.sd); } first = false; + if (isSetWriteId()) { + if (!first) sb.append(", "); + sb.append("writeId:"); + sb.append(this.writeId); + first = false; + } + if (isSetValidWriteIdList()) { + if (!first) sb.append(", "); + sb.append("validWriteIdList:"); + if (this.validWriteIdList == null) { + sb.append("null"); + } else { + sb.append(this.validWriteIdList); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -407,6 +569,8 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); @@ -459,6 +623,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, PartitionSpecWithSh org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 3: // WRITE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // VALID_WRITE_ID_LIST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -489,6 +669,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, PartitionSpecWithS struct.sd.write(oprot); oprot.writeFieldEnd(); } + if (struct.isSetWriteId()) { + oprot.writeFieldBegin(WRITE_ID_FIELD_DESC); + oprot.writeI64(struct.writeId); + oprot.writeFieldEnd(); + } + if (struct.validWriteIdList != null) { + if (struct.isSetValidWriteIdList()) { + oprot.writeFieldBegin(VALID_WRITE_ID_LIST_FIELD_DESC); + oprot.writeString(struct.validWriteIdList); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -513,7 +705,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, PartitionSpecWithSh if (struct.isSetSd()) { optionals.set(1); } - oprot.writeBitSet(optionals, 2); + if (struct.isSetWriteId()) { + optionals.set(2); + } + if (struct.isSetValidWriteIdList()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); if (struct.isSetPartitions()) { { oprot.writeI32(struct.partitions.size()); @@ -526,12 +724,18 @@ public void write(org.apache.thrift.protocol.TProtocol prot, PartitionSpecWithSh if (struct.isSetSd()) { struct.sd.write(oprot); } + if (struct.isSetWriteId()) { + oprot.writeI64(struct.writeId); + } + if (struct.isSetValidWriteIdList()) { + oprot.writeString(struct.validWriteIdList); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, PartitionSpecWithSharedSD struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list257 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); @@ -551,6 +755,14 @@ public void read(org.apache.thrift.protocol.TProtocol prot, PartitionSpecWithSha struct.sd.read(iprot); struct.setSdIsSet(true); } + if (incoming.get(2)) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } + if (incoming.get(3)) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } } } diff --git standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PartitionsStatsRequest.java standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PartitionsStatsRequest.java index 91cf567e74..477c8f6f52 100644 --- standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PartitionsStatsRequest.java +++ standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PartitionsStatsRequest.java @@ -43,6 +43,8 @@ private static final org.apache.thrift.protocol.TField COL_NAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("colNames", org.apache.thrift.protocol.TType.LIST, (short)3); private static final org.apache.thrift.protocol.TField PART_NAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("partNames", org.apache.thrift.protocol.TType.LIST, (short)4); private static final org.apache.thrift.protocol.TField CAT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catName", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField WRITE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("writeId", org.apache.thrift.protocol.TType.I64, (short)6); + private static final org.apache.thrift.protocol.TField VALID_WRITE_ID_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("validWriteIdList", org.apache.thrift.protocol.TType.STRING, (short)7); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -55,6 +57,8 @@ private List colNames; // required private List partNames; // required private String catName; // optional + private long writeId; // optional + private String validWriteIdList; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -62,7 +66,9 @@ TBL_NAME((short)2, "tblName"), COL_NAMES((short)3, "colNames"), PART_NAMES((short)4, "partNames"), - CAT_NAME((short)5, "catName"); + CAT_NAME((short)5, "catName"), + WRITE_ID((short)6, "writeId"), + VALID_WRITE_ID_LIST((short)7, "validWriteIdList"); private static final Map byName = new HashMap(); @@ -87,6 +93,10 @@ public static _Fields findByThriftId(int fieldId) { return PART_NAMES; case 5: // CAT_NAME return CAT_NAME; + case 6: // WRITE_ID + return WRITE_ID; + case 7: // VALID_WRITE_ID_LIST + return VALID_WRITE_ID_LIST; default: return null; } @@ -127,7 +137,9 @@ public String getFieldName() { } // isset id assignments - private static final _Fields optionals[] = {_Fields.CAT_NAME}; + private static final int __WRITEID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.CAT_NAME,_Fields.WRITE_ID,_Fields.VALID_WRITE_ID_LIST}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -143,11 +155,17 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); tmpMap.put(_Fields.CAT_NAME, new org.apache.thrift.meta_data.FieldMetaData("catName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.WRITE_ID, new org.apache.thrift.meta_data.FieldMetaData("writeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.VALID_WRITE_ID_LIST, new org.apache.thrift.meta_data.FieldMetaData("validWriteIdList", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PartitionsStatsRequest.class, metaDataMap); } public PartitionsStatsRequest() { + this.writeId = -1L; + } public PartitionsStatsRequest( @@ -167,6 +185,7 @@ public PartitionsStatsRequest( * Performs a deep copy on other. */ public PartitionsStatsRequest(PartitionsStatsRequest other) { + __isset_bitfield = other.__isset_bitfield; if (other.isSetDbName()) { this.dbName = other.dbName; } @@ -184,6 +203,10 @@ public PartitionsStatsRequest(PartitionsStatsRequest other) { if (other.isSetCatName()) { this.catName = other.catName; } + this.writeId = other.writeId; + if (other.isSetValidWriteIdList()) { + this.validWriteIdList = other.validWriteIdList; + } } public PartitionsStatsRequest deepCopy() { @@ -197,6 +220,9 @@ public void clear() { this.colNames = null; this.partNames = null; this.catName = null; + this.writeId = -1L; + + this.validWriteIdList = null; } public String getDbName() { @@ -344,6 +370,51 @@ public void setCatNameIsSet(boolean value) { } } + public long getWriteId() { + return this.writeId; + } + + public void setWriteId(long writeId) { + this.writeId = writeId; + setWriteIdIsSet(true); + } + + public void unsetWriteId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + /** Returns true if field writeId is set (has been assigned a value) and false otherwise */ + public boolean isSetWriteId() { + return EncodingUtils.testBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + public void setWriteIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WRITEID_ISSET_ID, value); + } + + public String getValidWriteIdList() { + return this.validWriteIdList; + } + + public void setValidWriteIdList(String validWriteIdList) { + this.validWriteIdList = validWriteIdList; + } + + public void unsetValidWriteIdList() { + this.validWriteIdList = null; + } + + /** Returns true if field validWriteIdList is set (has been assigned a value) and false otherwise */ + public boolean isSetValidWriteIdList() { + return this.validWriteIdList != null; + } + + public void setValidWriteIdListIsSet(boolean value) { + if (!value) { + this.validWriteIdList = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case DB_NAME: @@ -386,6 +457,22 @@ public void setFieldValue(_Fields field, Object value) { } break; + case WRITE_ID: + if (value == null) { + unsetWriteId(); + } else { + setWriteId((Long)value); + } + break; + + case VALID_WRITE_ID_LIST: + if (value == null) { + unsetValidWriteIdList(); + } else { + setValidWriteIdList((String)value); + } + break; + } } @@ -406,6 +493,12 @@ public Object getFieldValue(_Fields field) { case CAT_NAME: return getCatName(); + case WRITE_ID: + return getWriteId(); + + case VALID_WRITE_ID_LIST: + return getValidWriteIdList(); + } throw new IllegalStateException(); } @@ -427,6 +520,10 @@ public boolean isSet(_Fields field) { return isSetPartNames(); case CAT_NAME: return isSetCatName(); + case WRITE_ID: + return isSetWriteId(); + case VALID_WRITE_ID_LIST: + return isSetValidWriteIdList(); } throw new IllegalStateException(); } @@ -489,6 +586,24 @@ public boolean equals(PartitionsStatsRequest that) { return false; } + boolean this_present_writeId = true && this.isSetWriteId(); + boolean that_present_writeId = true && that.isSetWriteId(); + if (this_present_writeId || that_present_writeId) { + if (!(this_present_writeId && that_present_writeId)) + return false; + if (this.writeId != that.writeId) + return false; + } + + boolean this_present_validWriteIdList = true && this.isSetValidWriteIdList(); + boolean that_present_validWriteIdList = true && that.isSetValidWriteIdList(); + if (this_present_validWriteIdList || that_present_validWriteIdList) { + if (!(this_present_validWriteIdList && that_present_validWriteIdList)) + return false; + if (!this.validWriteIdList.equals(that.validWriteIdList)) + return false; + } + return true; } @@ -521,6 +636,16 @@ public int hashCode() { if (present_catName) list.add(catName); + boolean present_writeId = true && (isSetWriteId()); + list.add(present_writeId); + if (present_writeId) + list.add(writeId); + + boolean present_validWriteIdList = true && (isSetValidWriteIdList()); + list.add(present_validWriteIdList); + if (present_validWriteIdList) + list.add(validWriteIdList); + return list.hashCode(); } @@ -582,6 +707,26 @@ public int compareTo(PartitionsStatsRequest other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetWriteId()).compareTo(other.isSetWriteId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetWriteId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeId, other.writeId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetValidWriteIdList()).compareTo(other.isSetValidWriteIdList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValidWriteIdList()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.validWriteIdList, other.validWriteIdList); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -643,6 +788,22 @@ public String toString() { } first = false; } + if (isSetWriteId()) { + if (!first) sb.append(", "); + sb.append("writeId:"); + sb.append(this.writeId); + first = false; + } + if (isSetValidWriteIdList()) { + if (!first) sb.append(", "); + sb.append("validWriteIdList:"); + if (this.validWriteIdList == null) { + sb.append("null"); + } else { + sb.append(this.validWriteIdList); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -678,6 +839,8 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); @@ -762,6 +925,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, PartitionsStatsRequ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 6: // WRITE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // VALID_WRITE_ID_LIST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -816,6 +995,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, PartitionsStatsReq oprot.writeFieldEnd(); } } + if (struct.isSetWriteId()) { + oprot.writeFieldBegin(WRITE_ID_FIELD_DESC); + oprot.writeI64(struct.writeId); + oprot.writeFieldEnd(); + } + if (struct.validWriteIdList != null) { + if (struct.isSetValidWriteIdList()) { + oprot.writeFieldBegin(VALID_WRITE_ID_LIST_FIELD_DESC); + oprot.writeString(struct.validWriteIdList); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -853,10 +1044,22 @@ public void write(org.apache.thrift.protocol.TProtocol prot, PartitionsStatsRequ if (struct.isSetCatName()) { optionals.set(0); } - oprot.writeBitSet(optionals, 1); + if (struct.isSetWriteId()) { + optionals.set(1); + } + if (struct.isSetValidWriteIdList()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetCatName()) { oprot.writeString(struct.catName); } + if (struct.isSetWriteId()) { + oprot.writeI64(struct.writeId); + } + if (struct.isSetValidWriteIdList()) { + oprot.writeString(struct.validWriteIdList); + } } @Override @@ -888,11 +1091,19 @@ public void read(org.apache.thrift.protocol.TProtocol prot, PartitionsStatsReque } } struct.setPartNamesIsSet(true); - BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.catName = iprot.readString(); struct.setCatNameIsSet(true); } + if (incoming.get(1)) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } + if (incoming.get(2)) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } } } diff --git standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/SetPartitionsStatsRequest.java standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/SetPartitionsStatsRequest.java index a0ae84e760..778f3862b3 100644 --- standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/SetPartitionsStatsRequest.java +++ standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/SetPartitionsStatsRequest.java @@ -40,6 +40,8 @@ private static final org.apache.thrift.protocol.TField COL_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("colStats", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NEED_MERGE_FIELD_DESC = new org.apache.thrift.protocol.TField("needMerge", org.apache.thrift.protocol.TType.BOOL, (short)2); + private static final org.apache.thrift.protocol.TField WRITE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("writeId", org.apache.thrift.protocol.TType.I64, (short)3); + private static final org.apache.thrift.protocol.TField VALID_WRITE_ID_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("validWriteIdList", org.apache.thrift.protocol.TType.STRING, (short)4); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -49,11 +51,15 @@ private List colStats; // required private boolean needMerge; // optional + private long writeId; // optional + private String validWriteIdList; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { COL_STATS((short)1, "colStats"), - NEED_MERGE((short)2, "needMerge"); + NEED_MERGE((short)2, "needMerge"), + WRITE_ID((short)3, "writeId"), + VALID_WRITE_ID_LIST((short)4, "validWriteIdList"); private static final Map byName = new HashMap(); @@ -72,6 +78,10 @@ public static _Fields findByThriftId(int fieldId) { return COL_STATS; case 2: // NEED_MERGE return NEED_MERGE; + case 3: // WRITE_ID + return WRITE_ID; + case 4: // VALID_WRITE_ID_LIST + return VALID_WRITE_ID_LIST; default: return null; } @@ -113,8 +123,9 @@ public String getFieldName() { // isset id assignments private static final int __NEEDMERGE_ISSET_ID = 0; + private static final int __WRITEID_ISSET_ID = 1; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.NEED_MERGE}; + private static final _Fields optionals[] = {_Fields.NEED_MERGE,_Fields.WRITE_ID,_Fields.VALID_WRITE_ID_LIST}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -123,11 +134,17 @@ public String getFieldName() { new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ColumnStatistics.class)))); tmpMap.put(_Fields.NEED_MERGE, new org.apache.thrift.meta_data.FieldMetaData("needMerge", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.WRITE_ID, new org.apache.thrift.meta_data.FieldMetaData("writeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.VALID_WRITE_ID_LIST, new org.apache.thrift.meta_data.FieldMetaData("validWriteIdList", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SetPartitionsStatsRequest.class, metaDataMap); } public SetPartitionsStatsRequest() { + this.writeId = -1L; + } public SetPartitionsStatsRequest( @@ -150,6 +167,10 @@ public SetPartitionsStatsRequest(SetPartitionsStatsRequest other) { this.colStats = __this__colStats; } this.needMerge = other.needMerge; + this.writeId = other.writeId; + if (other.isSetValidWriteIdList()) { + this.validWriteIdList = other.validWriteIdList; + } } public SetPartitionsStatsRequest deepCopy() { @@ -161,6 +182,9 @@ public void clear() { this.colStats = null; setNeedMergeIsSet(false); this.needMerge = false; + this.writeId = -1L; + + this.validWriteIdList = null; } public int getColStatsSize() { @@ -223,6 +247,51 @@ public void setNeedMergeIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NEEDMERGE_ISSET_ID, value); } + public long getWriteId() { + return this.writeId; + } + + public void setWriteId(long writeId) { + this.writeId = writeId; + setWriteIdIsSet(true); + } + + public void unsetWriteId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + /** Returns true if field writeId is set (has been assigned a value) and false otherwise */ + public boolean isSetWriteId() { + return EncodingUtils.testBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + public void setWriteIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WRITEID_ISSET_ID, value); + } + + public String getValidWriteIdList() { + return this.validWriteIdList; + } + + public void setValidWriteIdList(String validWriteIdList) { + this.validWriteIdList = validWriteIdList; + } + + public void unsetValidWriteIdList() { + this.validWriteIdList = null; + } + + /** Returns true if field validWriteIdList is set (has been assigned a value) and false otherwise */ + public boolean isSetValidWriteIdList() { + return this.validWriteIdList != null; + } + + public void setValidWriteIdListIsSet(boolean value) { + if (!value) { + this.validWriteIdList = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case COL_STATS: @@ -241,6 +310,22 @@ public void setFieldValue(_Fields field, Object value) { } break; + case WRITE_ID: + if (value == null) { + unsetWriteId(); + } else { + setWriteId((Long)value); + } + break; + + case VALID_WRITE_ID_LIST: + if (value == null) { + unsetValidWriteIdList(); + } else { + setValidWriteIdList((String)value); + } + break; + } } @@ -252,6 +337,12 @@ public Object getFieldValue(_Fields field) { case NEED_MERGE: return isNeedMerge(); + case WRITE_ID: + return getWriteId(); + + case VALID_WRITE_ID_LIST: + return getValidWriteIdList(); + } throw new IllegalStateException(); } @@ -267,6 +358,10 @@ public boolean isSet(_Fields field) { return isSetColStats(); case NEED_MERGE: return isSetNeedMerge(); + case WRITE_ID: + return isSetWriteId(); + case VALID_WRITE_ID_LIST: + return isSetValidWriteIdList(); } throw new IllegalStateException(); } @@ -302,6 +397,24 @@ public boolean equals(SetPartitionsStatsRequest that) { return false; } + boolean this_present_writeId = true && this.isSetWriteId(); + boolean that_present_writeId = true && that.isSetWriteId(); + if (this_present_writeId || that_present_writeId) { + if (!(this_present_writeId && that_present_writeId)) + return false; + if (this.writeId != that.writeId) + return false; + } + + boolean this_present_validWriteIdList = true && this.isSetValidWriteIdList(); + boolean that_present_validWriteIdList = true && that.isSetValidWriteIdList(); + if (this_present_validWriteIdList || that_present_validWriteIdList) { + if (!(this_present_validWriteIdList && that_present_validWriteIdList)) + return false; + if (!this.validWriteIdList.equals(that.validWriteIdList)) + return false; + } + return true; } @@ -319,6 +432,16 @@ public int hashCode() { if (present_needMerge) list.add(needMerge); + boolean present_writeId = true && (isSetWriteId()); + list.add(present_writeId); + if (present_writeId) + list.add(writeId); + + boolean present_validWriteIdList = true && (isSetValidWriteIdList()); + list.add(present_validWriteIdList); + if (present_validWriteIdList) + list.add(validWriteIdList); + return list.hashCode(); } @@ -350,6 +473,26 @@ public int compareTo(SetPartitionsStatsRequest other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetWriteId()).compareTo(other.isSetWriteId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetWriteId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeId, other.writeId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetValidWriteIdList()).compareTo(other.isSetValidWriteIdList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValidWriteIdList()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.validWriteIdList, other.validWriteIdList); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -383,6 +526,22 @@ public String toString() { sb.append(this.needMerge); first = false; } + if (isSetWriteId()) { + if (!first) sb.append(", "); + sb.append("writeId:"); + sb.append(this.writeId); + first = false; + } + if (isSetValidWriteIdList()) { + if (!first) sb.append(", "); + sb.append("validWriteIdList:"); + if (this.validWriteIdList == null) { + sb.append("null"); + } else { + sb.append(this.validWriteIdList); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -459,6 +618,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, SetPartitionsStatsR org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 3: // WRITE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // VALID_WRITE_ID_LIST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -489,6 +664,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, SetPartitionsStats oprot.writeBool(struct.needMerge); oprot.writeFieldEnd(); } + if (struct.isSetWriteId()) { + oprot.writeFieldBegin(WRITE_ID_FIELD_DESC); + oprot.writeI64(struct.writeId); + oprot.writeFieldEnd(); + } + if (struct.validWriteIdList != null) { + if (struct.isSetValidWriteIdList()) { + oprot.writeFieldBegin(VALID_WRITE_ID_LIST_FIELD_DESC); + oprot.writeString(struct.validWriteIdList); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -517,10 +704,22 @@ public void write(org.apache.thrift.protocol.TProtocol prot, SetPartitionsStatsR if (struct.isSetNeedMerge()) { optionals.set(0); } - oprot.writeBitSet(optionals, 1); + if (struct.isSetWriteId()) { + optionals.set(1); + } + if (struct.isSetValidWriteIdList()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetNeedMerge()) { oprot.writeBool(struct.needMerge); } + if (struct.isSetWriteId()) { + oprot.writeI64(struct.writeId); + } + if (struct.isSetValidWriteIdList()) { + oprot.writeString(struct.validWriteIdList); + } } @Override @@ -538,11 +737,19 @@ public void read(org.apache.thrift.protocol.TProtocol prot, SetPartitionsStatsRe } } struct.setColStatsIsSet(true); - BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.needMerge = iprot.readBool(); struct.setNeedMergeIsSet(true); } + if (incoming.get(1)) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } + if (incoming.get(2)) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } } } diff --git standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java index 38d4f64f64..d87aba3536 100644 --- standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java +++ standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java @@ -56,6 +56,8 @@ private static final org.apache.thrift.protocol.TField CREATION_METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("creationMetadata", org.apache.thrift.protocol.TType.STRUCT, (short)16); private static final org.apache.thrift.protocol.TField CAT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catName", org.apache.thrift.protocol.TType.STRING, (short)17); private static final org.apache.thrift.protocol.TField OWNER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerType", org.apache.thrift.protocol.TType.I32, (short)18); + private static final org.apache.thrift.protocol.TField WRITE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("writeId", org.apache.thrift.protocol.TType.I64, (short)19); + private static final org.apache.thrift.protocol.TField VALID_WRITE_ID_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("validWriteIdList", org.apache.thrift.protocol.TType.STRING, (short)20); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -81,6 +83,8 @@ private CreationMetadata creationMetadata; // optional private String catName; // optional private PrincipalType ownerType; // optional + private long writeId; // optional + private String validWriteIdList; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -105,7 +109,9 @@ * * @see PrincipalType */ - OWNER_TYPE((short)18, "ownerType"); + OWNER_TYPE((short)18, "ownerType"), + WRITE_ID((short)19, "writeId"), + VALID_WRITE_ID_LIST((short)20, "validWriteIdList"); private static final Map byName = new HashMap(); @@ -156,6 +162,10 @@ public static _Fields findByThriftId(int fieldId) { return CAT_NAME; case 18: // OWNER_TYPE return OWNER_TYPE; + case 19: // WRITE_ID + return WRITE_ID; + case 20: // VALID_WRITE_ID_LIST + return VALID_WRITE_ID_LIST; default: return null; } @@ -201,8 +211,9 @@ public String getFieldName() { private static final int __RETENTION_ISSET_ID = 2; private static final int __TEMPORARY_ISSET_ID = 3; private static final int __REWRITEENABLED_ISSET_ID = 4; + private static final int __WRITEID_ISSET_ID = 5; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.PRIVILEGES,_Fields.TEMPORARY,_Fields.REWRITE_ENABLED,_Fields.CREATION_METADATA,_Fields.CAT_NAME,_Fields.OWNER_TYPE}; + private static final _Fields optionals[] = {_Fields.PRIVILEGES,_Fields.TEMPORARY,_Fields.REWRITE_ENABLED,_Fields.CREATION_METADATA,_Fields.CAT_NAME,_Fields.OWNER_TYPE,_Fields.WRITE_ID,_Fields.VALID_WRITE_ID_LIST}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -245,6 +256,10 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.OWNER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("ownerType", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PrincipalType.class))); + tmpMap.put(_Fields.WRITE_ID, new org.apache.thrift.meta_data.FieldMetaData("writeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.VALID_WRITE_ID_LIST, new org.apache.thrift.meta_data.FieldMetaData("validWriteIdList", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Table.class, metaDataMap); } @@ -254,6 +269,8 @@ public Table() { this.ownerType = org.apache.hadoop.hive.metastore.api.PrincipalType.USER; + this.writeId = -1L; + } public Table( @@ -342,6 +359,10 @@ public Table(Table other) { if (other.isSetOwnerType()) { this.ownerType = other.ownerType; } + this.writeId = other.writeId; + if (other.isSetValidWriteIdList()) { + this.validWriteIdList = other.validWriteIdList; + } } public Table deepCopy() { @@ -374,6 +395,9 @@ public void clear() { this.catName = null; this.ownerType = org.apache.hadoop.hive.metastore.api.PrincipalType.USER; + this.writeId = -1L; + + this.validWriteIdList = null; } public String getTableName() { @@ -819,6 +843,51 @@ public void setOwnerTypeIsSet(boolean value) { } } + public long getWriteId() { + return this.writeId; + } + + public void setWriteId(long writeId) { + this.writeId = writeId; + setWriteIdIsSet(true); + } + + public void unsetWriteId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + /** Returns true if field writeId is set (has been assigned a value) and false otherwise */ + public boolean isSetWriteId() { + return EncodingUtils.testBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + public void setWriteIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WRITEID_ISSET_ID, value); + } + + public String getValidWriteIdList() { + return this.validWriteIdList; + } + + public void setValidWriteIdList(String validWriteIdList) { + this.validWriteIdList = validWriteIdList; + } + + public void unsetValidWriteIdList() { + this.validWriteIdList = null; + } + + /** Returns true if field validWriteIdList is set (has been assigned a value) and false otherwise */ + public boolean isSetValidWriteIdList() { + return this.validWriteIdList != null; + } + + public void setValidWriteIdListIsSet(boolean value) { + if (!value) { + this.validWriteIdList = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case TABLE_NAME: @@ -965,6 +1034,22 @@ public void setFieldValue(_Fields field, Object value) { } break; + case WRITE_ID: + if (value == null) { + unsetWriteId(); + } else { + setWriteId((Long)value); + } + break; + + case VALID_WRITE_ID_LIST: + if (value == null) { + unsetValidWriteIdList(); + } else { + setValidWriteIdList((String)value); + } + break; + } } @@ -1024,6 +1109,12 @@ public Object getFieldValue(_Fields field) { case OWNER_TYPE: return getOwnerType(); + case WRITE_ID: + return getWriteId(); + + case VALID_WRITE_ID_LIST: + return getValidWriteIdList(); + } throw new IllegalStateException(); } @@ -1071,6 +1162,10 @@ public boolean isSet(_Fields field) { return isSetCatName(); case OWNER_TYPE: return isSetOwnerType(); + case WRITE_ID: + return isSetWriteId(); + case VALID_WRITE_ID_LIST: + return isSetValidWriteIdList(); } throw new IllegalStateException(); } @@ -1250,6 +1345,24 @@ public boolean equals(Table that) { return false; } + boolean this_present_writeId = true && this.isSetWriteId(); + boolean that_present_writeId = true && that.isSetWriteId(); + if (this_present_writeId || that_present_writeId) { + if (!(this_present_writeId && that_present_writeId)) + return false; + if (this.writeId != that.writeId) + return false; + } + + boolean this_present_validWriteIdList = true && this.isSetValidWriteIdList(); + boolean that_present_validWriteIdList = true && that.isSetValidWriteIdList(); + if (this_present_validWriteIdList || that_present_validWriteIdList) { + if (!(this_present_validWriteIdList && that_present_validWriteIdList)) + return false; + if (!this.validWriteIdList.equals(that.validWriteIdList)) + return false; + } + return true; } @@ -1347,6 +1460,16 @@ public int hashCode() { if (present_ownerType) list.add(ownerType.getValue()); + boolean present_writeId = true && (isSetWriteId()); + list.add(present_writeId); + if (present_writeId) + list.add(writeId); + + boolean present_validWriteIdList = true && (isSetValidWriteIdList()); + list.add(present_validWriteIdList); + if (present_validWriteIdList) + list.add(validWriteIdList); + return list.hashCode(); } @@ -1538,6 +1661,26 @@ public int compareTo(Table other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetWriteId()).compareTo(other.isSetWriteId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetWriteId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeId, other.writeId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetValidWriteIdList()).compareTo(other.isSetValidWriteIdList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValidWriteIdList()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.validWriteIdList, other.validWriteIdList); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -1693,6 +1836,22 @@ public String toString() { } first = false; } + if (isSetWriteId()) { + if (!first) sb.append(", "); + sb.append("writeId:"); + sb.append(this.writeId); + first = false; + } + if (isSetValidWriteIdList()) { + if (!first) sb.append(", "); + sb.append("validWriteIdList:"); + if (this.validWriteIdList == null) { + sb.append("null"); + } else { + sb.append(this.validWriteIdList); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -1914,6 +2073,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, Table struct) throw org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 19: // WRITE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 20: // VALID_WRITE_ID_LIST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -2034,6 +2209,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, Table struct) thro oprot.writeFieldEnd(); } } + if (struct.isSetWriteId()) { + oprot.writeFieldBegin(WRITE_ID_FIELD_DESC); + oprot.writeI64(struct.writeId); + oprot.writeFieldEnd(); + } + if (struct.validWriteIdList != null) { + if (struct.isSetValidWriteIdList()) { + oprot.writeFieldBegin(VALID_WRITE_ID_LIST_FIELD_DESC); + oprot.writeString(struct.validWriteIdList); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -2106,7 +2293,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, Table struct) throw if (struct.isSetOwnerType()) { optionals.set(17); } - oprot.writeBitSet(optionals, 18); + if (struct.isSetWriteId()) { + optionals.set(18); + } + if (struct.isSetValidWriteIdList()) { + optionals.set(19); + } + oprot.writeBitSet(optionals, 20); if (struct.isSetTableName()) { oprot.writeString(struct.tableName); } @@ -2174,12 +2367,18 @@ public void write(org.apache.thrift.protocol.TProtocol prot, Table struct) throw if (struct.isSetOwnerType()) { oprot.writeI32(struct.ownerType.getValue()); } + if (struct.isSetWriteId()) { + oprot.writeI64(struct.writeId); + } + if (struct.isSetValidWriteIdList()) { + oprot.writeString(struct.validWriteIdList); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, Table struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(18); + BitSet incoming = iprot.readBitSet(20); if (incoming.get(0)) { struct.tableName = iprot.readString(); struct.setTableNameIsSet(true); @@ -2276,6 +2475,14 @@ public void read(org.apache.thrift.protocol.TProtocol prot, Table struct) throws struct.ownerType = org.apache.hadoop.hive.metastore.api.PrincipalType.findByValue(iprot.readI32()); struct.setOwnerTypeIsSet(true); } + if (incoming.get(18)) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } + if (incoming.get(19)) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } } } diff --git standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/TableStatsRequest.java standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/TableStatsRequest.java index a663a64c67..3246816f57 100644 --- standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/TableStatsRequest.java +++ standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/TableStatsRequest.java @@ -42,6 +42,8 @@ private static final org.apache.thrift.protocol.TField TBL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tblName", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField COL_NAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("colNames", org.apache.thrift.protocol.TType.LIST, (short)3); private static final org.apache.thrift.protocol.TField CAT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catName", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField WRITE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("writeId", org.apache.thrift.protocol.TType.I64, (short)5); + private static final org.apache.thrift.protocol.TField VALID_WRITE_ID_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("validWriteIdList", org.apache.thrift.protocol.TType.STRING, (short)6); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -53,13 +55,17 @@ private String tblName; // required private List colNames; // required private String catName; // optional + private long writeId; // optional + private String validWriteIdList; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { DB_NAME((short)1, "dbName"), TBL_NAME((short)2, "tblName"), COL_NAMES((short)3, "colNames"), - CAT_NAME((short)4, "catName"); + CAT_NAME((short)4, "catName"), + WRITE_ID((short)5, "writeId"), + VALID_WRITE_ID_LIST((short)6, "validWriteIdList"); private static final Map byName = new HashMap(); @@ -82,6 +88,10 @@ public static _Fields findByThriftId(int fieldId) { return COL_NAMES; case 4: // CAT_NAME return CAT_NAME; + case 5: // WRITE_ID + return WRITE_ID; + case 6: // VALID_WRITE_ID_LIST + return VALID_WRITE_ID_LIST; default: return null; } @@ -122,7 +132,9 @@ public String getFieldName() { } // isset id assignments - private static final _Fields optionals[] = {_Fields.CAT_NAME}; + private static final int __WRITEID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.CAT_NAME,_Fields.WRITE_ID,_Fields.VALID_WRITE_ID_LIST}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -135,11 +147,17 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); tmpMap.put(_Fields.CAT_NAME, new org.apache.thrift.meta_data.FieldMetaData("catName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.WRITE_ID, new org.apache.thrift.meta_data.FieldMetaData("writeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.VALID_WRITE_ID_LIST, new org.apache.thrift.meta_data.FieldMetaData("validWriteIdList", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TableStatsRequest.class, metaDataMap); } public TableStatsRequest() { + this.writeId = -1L; + } public TableStatsRequest( @@ -157,6 +175,7 @@ public TableStatsRequest( * Performs a deep copy on other. */ public TableStatsRequest(TableStatsRequest other) { + __isset_bitfield = other.__isset_bitfield; if (other.isSetDbName()) { this.dbName = other.dbName; } @@ -170,6 +189,10 @@ public TableStatsRequest(TableStatsRequest other) { if (other.isSetCatName()) { this.catName = other.catName; } + this.writeId = other.writeId; + if (other.isSetValidWriteIdList()) { + this.validWriteIdList = other.validWriteIdList; + } } public TableStatsRequest deepCopy() { @@ -182,6 +205,9 @@ public void clear() { this.tblName = null; this.colNames = null; this.catName = null; + this.writeId = -1L; + + this.validWriteIdList = null; } public String getDbName() { @@ -291,6 +317,51 @@ public void setCatNameIsSet(boolean value) { } } + public long getWriteId() { + return this.writeId; + } + + public void setWriteId(long writeId) { + this.writeId = writeId; + setWriteIdIsSet(true); + } + + public void unsetWriteId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + /** Returns true if field writeId is set (has been assigned a value) and false otherwise */ + public boolean isSetWriteId() { + return EncodingUtils.testBit(__isset_bitfield, __WRITEID_ISSET_ID); + } + + public void setWriteIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WRITEID_ISSET_ID, value); + } + + public String getValidWriteIdList() { + return this.validWriteIdList; + } + + public void setValidWriteIdList(String validWriteIdList) { + this.validWriteIdList = validWriteIdList; + } + + public void unsetValidWriteIdList() { + this.validWriteIdList = null; + } + + /** Returns true if field validWriteIdList is set (has been assigned a value) and false otherwise */ + public boolean isSetValidWriteIdList() { + return this.validWriteIdList != null; + } + + public void setValidWriteIdListIsSet(boolean value) { + if (!value) { + this.validWriteIdList = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case DB_NAME: @@ -325,6 +396,22 @@ public void setFieldValue(_Fields field, Object value) { } break; + case WRITE_ID: + if (value == null) { + unsetWriteId(); + } else { + setWriteId((Long)value); + } + break; + + case VALID_WRITE_ID_LIST: + if (value == null) { + unsetValidWriteIdList(); + } else { + setValidWriteIdList((String)value); + } + break; + } } @@ -342,6 +429,12 @@ public Object getFieldValue(_Fields field) { case CAT_NAME: return getCatName(); + case WRITE_ID: + return getWriteId(); + + case VALID_WRITE_ID_LIST: + return getValidWriteIdList(); + } throw new IllegalStateException(); } @@ -361,6 +454,10 @@ public boolean isSet(_Fields field) { return isSetColNames(); case CAT_NAME: return isSetCatName(); + case WRITE_ID: + return isSetWriteId(); + case VALID_WRITE_ID_LIST: + return isSetValidWriteIdList(); } throw new IllegalStateException(); } @@ -414,6 +511,24 @@ public boolean equals(TableStatsRequest that) { return false; } + boolean this_present_writeId = true && this.isSetWriteId(); + boolean that_present_writeId = true && that.isSetWriteId(); + if (this_present_writeId || that_present_writeId) { + if (!(this_present_writeId && that_present_writeId)) + return false; + if (this.writeId != that.writeId) + return false; + } + + boolean this_present_validWriteIdList = true && this.isSetValidWriteIdList(); + boolean that_present_validWriteIdList = true && that.isSetValidWriteIdList(); + if (this_present_validWriteIdList || that_present_validWriteIdList) { + if (!(this_present_validWriteIdList && that_present_validWriteIdList)) + return false; + if (!this.validWriteIdList.equals(that.validWriteIdList)) + return false; + } + return true; } @@ -441,6 +556,16 @@ public int hashCode() { if (present_catName) list.add(catName); + boolean present_writeId = true && (isSetWriteId()); + list.add(present_writeId); + if (present_writeId) + list.add(writeId); + + boolean present_validWriteIdList = true && (isSetValidWriteIdList()); + list.add(present_validWriteIdList); + if (present_validWriteIdList) + list.add(validWriteIdList); + return list.hashCode(); } @@ -492,6 +617,26 @@ public int compareTo(TableStatsRequest other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetWriteId()).compareTo(other.isSetWriteId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetWriteId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeId, other.writeId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetValidWriteIdList()).compareTo(other.isSetValidWriteIdList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValidWriteIdList()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.validWriteIdList, other.validWriteIdList); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -545,6 +690,22 @@ public String toString() { } first = false; } + if (isSetWriteId()) { + if (!first) sb.append(", "); + sb.append("writeId:"); + sb.append(this.writeId); + first = false; + } + if (isSetValidWriteIdList()) { + if (!first) sb.append(", "); + sb.append("validWriteIdList:"); + if (this.validWriteIdList == null) { + sb.append("null"); + } else { + sb.append(this.validWriteIdList); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -576,6 +737,8 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); @@ -642,6 +805,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TableStatsRequest s org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 5: // WRITE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // VALID_WRITE_ID_LIST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -684,6 +863,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TableStatsRequest oprot.writeFieldEnd(); } } + if (struct.isSetWriteId()) { + oprot.writeFieldBegin(WRITE_ID_FIELD_DESC); + oprot.writeI64(struct.writeId); + oprot.writeFieldEnd(); + } + if (struct.validWriteIdList != null) { + if (struct.isSetValidWriteIdList()) { + oprot.writeFieldBegin(VALID_WRITE_ID_LIST_FIELD_DESC); + oprot.writeString(struct.validWriteIdList); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -714,10 +905,22 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TableStatsRequest s if (struct.isSetCatName()) { optionals.set(0); } - oprot.writeBitSet(optionals, 1); + if (struct.isSetWriteId()) { + optionals.set(1); + } + if (struct.isSetValidWriteIdList()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetCatName()) { oprot.writeString(struct.catName); } + if (struct.isSetWriteId()) { + oprot.writeI64(struct.writeId); + } + if (struct.isSetValidWriteIdList()) { + oprot.writeString(struct.validWriteIdList); + } } @Override @@ -738,11 +941,19 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TableStatsRequest st } } struct.setColNamesIsSet(true); - BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.catName = iprot.readString(); struct.setCatNameIsSet(true); } + if (incoming.get(1)) { + struct.writeId = iprot.readI64(); + struct.setWriteIdIsSet(true); + } + if (incoming.get(2)) { + struct.validWriteIdList = iprot.readString(); + struct.setValidWriteIdListIsSet(true); + } } } diff --git standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php index 353c0deb91..baa09402a2 100644 --- standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php +++ standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php @@ -6391,6 +6391,14 @@ class Table { * @var int */ public $ownerType = 1; + /** + * @var int + */ + public $writeId = -1; + /** + * @var string + */ + public $validWriteIdList = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -6483,6 +6491,14 @@ class Table { 'var' => 'ownerType', 'type' => TType::I32, ), + 19 => array( + 'var' => 'writeId', + 'type' => TType::I64, + ), + 20 => array( + 'var' => 'validWriteIdList', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -6540,6 +6556,12 @@ class Table { if (isset($vals['ownerType'])) { $this->ownerType = $vals['ownerType']; } + if (isset($vals['writeId'])) { + $this->writeId = $vals['writeId']; + } + if (isset($vals['validWriteIdList'])) { + $this->validWriteIdList = $vals['validWriteIdList']; + } } } @@ -6715,6 +6737,20 @@ class Table { $xfer += $input->skip($ftype); } break; + case 19: + if ($ftype == TType::I64) { + $xfer += $input->readI64($this->writeId); + } else { + $xfer += $input->skip($ftype); + } + break; + case 20: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->validWriteIdList); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -6852,6 +6888,16 @@ class Table { $xfer += $output->writeI32($this->ownerType); $xfer += $output->writeFieldEnd(); } + if ($this->writeId !== null) { + $xfer += $output->writeFieldBegin('writeId', TType::I64, 19); + $xfer += $output->writeI64($this->writeId); + $xfer += $output->writeFieldEnd(); + } + if ($this->validWriteIdList !== null) { + $xfer += $output->writeFieldBegin('validWriteIdList', TType::STRING, 20); + $xfer += $output->writeString($this->validWriteIdList); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -6898,6 +6944,14 @@ class Partition { * @var string */ public $catName = null; + /** + * @var int + */ + public $writeId = -1; + /** + * @var string + */ + public $validWriteIdList = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -6952,6 +7006,14 @@ class Partition { 'var' => 'catName', 'type' => TType::STRING, ), + 10 => array( + 'var' => 'writeId', + 'type' => TType::I64, + ), + 11 => array( + 'var' => 'validWriteIdList', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -6982,6 +7044,12 @@ class Partition { if (isset($vals['catName'])) { $this->catName = $vals['catName']; } + if (isset($vals['writeId'])) { + $this->writeId = $vals['writeId']; + } + if (isset($vals['validWriteIdList'])) { + $this->validWriteIdList = $vals['validWriteIdList']; + } } } @@ -7092,6 +7160,20 @@ class Partition { $xfer += $input->skip($ftype); } break; + case 10: + if ($ftype == TType::I64) { + $xfer += $input->readI64($this->writeId); + } else { + $xfer += $input->skip($ftype); + } + break; + case 11: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->validWriteIdList); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -7181,6 +7263,16 @@ class Partition { $xfer += $output->writeString($this->catName); $xfer += $output->writeFieldEnd(); } + if ($this->writeId !== null) { + $xfer += $output->writeFieldBegin('writeId', TType::I64, 10); + $xfer += $output->writeI64($this->writeId); + $xfer += $output->writeFieldEnd(); + } + if ($this->validWriteIdList !== null) { + $xfer += $output->writeFieldBegin('validWriteIdList', TType::STRING, 11); + $xfer += $output->writeString($this->validWriteIdList); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -7454,6 +7546,14 @@ class PartitionSpecWithSharedSD { * @var \metastore\StorageDescriptor */ public $sd = null; + /** + * @var int + */ + public $writeId = -1; + /** + * @var string + */ + public $validWriteIdList = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -7472,6 +7572,14 @@ class PartitionSpecWithSharedSD { 'type' => TType::STRUCT, 'class' => '\metastore\StorageDescriptor', ), + 3 => array( + 'var' => 'writeId', + 'type' => TType::I64, + ), + 4 => array( + 'var' => 'validWriteIdList', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -7481,6 +7589,12 @@ class PartitionSpecWithSharedSD { if (isset($vals['sd'])) { $this->sd = $vals['sd']; } + if (isset($vals['writeId'])) { + $this->writeId = $vals['writeId']; + } + if (isset($vals['validWriteIdList'])) { + $this->validWriteIdList = $vals['validWriteIdList']; + } } } @@ -7529,6 +7643,20 @@ class PartitionSpecWithSharedSD { $xfer += $input->skip($ftype); } break; + case 3: + if ($ftype == TType::I64) { + $xfer += $input->readI64($this->writeId); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->validWriteIdList); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -7567,6 +7695,16 @@ class PartitionSpecWithSharedSD { $xfer += $this->sd->write($output); $xfer += $output->writeFieldEnd(); } + if ($this->writeId !== null) { + $xfer += $output->writeFieldBegin('writeId', TType::I64, 3); + $xfer += $output->writeI64($this->writeId); + $xfer += $output->writeFieldEnd(); + } + if ($this->validWriteIdList !== null) { + $xfer += $output->writeFieldBegin('validWriteIdList', TType::STRING, 4); + $xfer += $output->writeString($this->validWriteIdList); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -9594,6 +9732,14 @@ class ColumnStatisticsDesc { * @var string */ public $catName = null; + /** + * @var int + */ + public $writeId = -1; + /** + * @var string + */ + public $validWriteIdList = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -9622,6 +9768,14 @@ class ColumnStatisticsDesc { 'var' => 'catName', 'type' => TType::STRING, ), + 7 => array( + 'var' => 'writeId', + 'type' => TType::I64, + ), + 8 => array( + 'var' => 'validWriteIdList', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -9643,6 +9797,12 @@ class ColumnStatisticsDesc { if (isset($vals['catName'])) { $this->catName = $vals['catName']; } + if (isset($vals['writeId'])) { + $this->writeId = $vals['writeId']; + } + if (isset($vals['validWriteIdList'])) { + $this->validWriteIdList = $vals['validWriteIdList']; + } } } @@ -9707,6 +9867,20 @@ class ColumnStatisticsDesc { $xfer += $input->skip($ftype); } break; + case 7: + if ($ftype == TType::I64) { + $xfer += $input->readI64($this->writeId); + } else { + $xfer += $input->skip($ftype); + } + break; + case 8: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->validWriteIdList); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -9750,6 +9924,16 @@ class ColumnStatisticsDesc { $xfer += $output->writeString($this->catName); $xfer += $output->writeFieldEnd(); } + if ($this->writeId !== null) { + $xfer += $output->writeFieldBegin('writeId', TType::I64, 7); + $xfer += $output->writeI64($this->writeId); + $xfer += $output->writeFieldEnd(); + } + if ($this->validWriteIdList !== null) { + $xfer += $output->writeFieldBegin('validWriteIdList', TType::STRING, 8); + $xfer += $output->writeString($this->validWriteIdList); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -10025,6 +10209,14 @@ class SetPartitionsStatsRequest { * @var bool */ public $needMerge = null; + /** + * @var int + */ + public $writeId = -1; + /** + * @var string + */ + public $validWriteIdList = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -10042,6 +10234,14 @@ class SetPartitionsStatsRequest { 'var' => 'needMerge', 'type' => TType::BOOL, ), + 3 => array( + 'var' => 'writeId', + 'type' => TType::I64, + ), + 4 => array( + 'var' => 'validWriteIdList', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -10051,6 +10251,12 @@ class SetPartitionsStatsRequest { if (isset($vals['needMerge'])) { $this->needMerge = $vals['needMerge']; } + if (isset($vals['writeId'])) { + $this->writeId = $vals['writeId']; + } + if (isset($vals['validWriteIdList'])) { + $this->validWriteIdList = $vals['validWriteIdList']; + } } } @@ -10098,6 +10304,20 @@ class SetPartitionsStatsRequest { $xfer += $input->skip($ftype); } break; + case 3: + if ($ftype == TType::I64) { + $xfer += $input->readI64($this->writeId); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->validWriteIdList); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -10133,6 +10353,16 @@ class SetPartitionsStatsRequest { $xfer += $output->writeBool($this->needMerge); $xfer += $output->writeFieldEnd(); } + if ($this->writeId !== null) { + $xfer += $output->writeFieldBegin('writeId', TType::I64, 3); + $xfer += $output->writeI64($this->writeId); + $xfer += $output->writeFieldEnd(); + } + if ($this->validWriteIdList !== null) { + $xfer += $output->writeFieldBegin('validWriteIdList', TType::STRING, 4); + $xfer += $output->writeString($this->validWriteIdList); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -13133,6 +13363,14 @@ class TableStatsRequest { * @var string */ public $catName = null; + /** + * @var int + */ + public $writeId = -1; + /** + * @var string + */ + public $validWriteIdList = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -13157,6 +13395,14 @@ class TableStatsRequest { 'var' => 'catName', 'type' => TType::STRING, ), + 5 => array( + 'var' => 'writeId', + 'type' => TType::I64, + ), + 6 => array( + 'var' => 'validWriteIdList', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -13172,6 +13418,12 @@ class TableStatsRequest { if (isset($vals['catName'])) { $this->catName = $vals['catName']; } + if (isset($vals['writeId'])) { + $this->writeId = $vals['writeId']; + } + if (isset($vals['validWriteIdList'])) { + $this->validWriteIdList = $vals['validWriteIdList']; + } } } @@ -13232,6 +13484,20 @@ class TableStatsRequest { $xfer += $input->skip($ftype); } break; + case 5: + if ($ftype == TType::I64) { + $xfer += $input->readI64($this->writeId); + } else { + $xfer += $input->skip($ftype); + } + break; + case 6: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->validWriteIdList); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -13277,6 +13543,16 @@ class TableStatsRequest { $xfer += $output->writeString($this->catName); $xfer += $output->writeFieldEnd(); } + if ($this->writeId !== null) { + $xfer += $output->writeFieldBegin('writeId', TType::I64, 5); + $xfer += $output->writeI64($this->writeId); + $xfer += $output->writeFieldEnd(); + } + if ($this->validWriteIdList !== null) { + $xfer += $output->writeFieldBegin('validWriteIdList', TType::STRING, 6); + $xfer += $output->writeString($this->validWriteIdList); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -13307,6 +13583,14 @@ class PartitionsStatsRequest { * @var string */ public $catName = null; + /** + * @var int + */ + public $writeId = -1; + /** + * @var string + */ + public $validWriteIdList = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -13339,6 +13623,14 @@ class PartitionsStatsRequest { 'var' => 'catName', 'type' => TType::STRING, ), + 6 => array( + 'var' => 'writeId', + 'type' => TType::I64, + ), + 7 => array( + 'var' => 'validWriteIdList', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -13357,6 +13649,12 @@ class PartitionsStatsRequest { if (isset($vals['catName'])) { $this->catName = $vals['catName']; } + if (isset($vals['writeId'])) { + $this->writeId = $vals['writeId']; + } + if (isset($vals['validWriteIdList'])) { + $this->validWriteIdList = $vals['validWriteIdList']; + } } } @@ -13434,6 +13732,20 @@ class PartitionsStatsRequest { $xfer += $input->skip($ftype); } break; + case 6: + if ($ftype == TType::I64) { + $xfer += $input->readI64($this->writeId); + } else { + $xfer += $input->skip($ftype); + } + break; + case 7: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->validWriteIdList); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -13496,6 +13808,16 @@ class PartitionsStatsRequest { $xfer += $output->writeString($this->catName); $xfer += $output->writeFieldEnd(); } + if ($this->writeId !== null) { + $xfer += $output->writeFieldBegin('writeId', TType::I64, 6); + $xfer += $output->writeI64($this->writeId); + $xfer += $output->writeFieldEnd(); + } + if ($this->validWriteIdList !== null) { + $xfer += $output->writeFieldBegin('validWriteIdList', TType::STRING, 7); + $xfer += $output->writeString($this->validWriteIdList); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -23470,6 +23792,14 @@ class GetTableRequest { * @var string */ public $catName = null; + /** + * @var int + */ + public $writeId = -1; + /** + * @var string + */ + public $validWriteIdList = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -23491,6 +23821,14 @@ class GetTableRequest { 'var' => 'catName', 'type' => TType::STRING, ), + 5 => array( + 'var' => 'writeId', + 'type' => TType::I64, + ), + 6 => array( + 'var' => 'validWriteIdList', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -23506,6 +23844,12 @@ class GetTableRequest { if (isset($vals['catName'])) { $this->catName = $vals['catName']; } + if (isset($vals['writeId'])) { + $this->writeId = $vals['writeId']; + } + if (isset($vals['validWriteIdList'])) { + $this->validWriteIdList = $vals['validWriteIdList']; + } } } @@ -23557,6 +23901,20 @@ class GetTableRequest { $xfer += $input->skip($ftype); } break; + case 5: + if ($ftype == TType::I64) { + $xfer += $input->readI64($this->writeId); + } else { + $xfer += $input->skip($ftype); + } + break; + case 6: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->validWriteIdList); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -23593,6 +23951,16 @@ class GetTableRequest { $xfer += $output->writeString($this->catName); $xfer += $output->writeFieldEnd(); } + if ($this->writeId !== null) { + $xfer += $output->writeFieldBegin('writeId', TType::I64, 5); + $xfer += $output->writeI64($this->writeId); + $xfer += $output->writeFieldEnd(); + } + if ($this->validWriteIdList !== null) { + $xfer += $output->writeFieldBegin('validWriteIdList', TType::STRING, 6); + $xfer += $output->writeString($this->validWriteIdList); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; diff --git standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py index fdec32e10c..76e67b1206 100644 --- standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py +++ standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py @@ -4458,6 +4458,8 @@ class Table: - creationMetadata - catName - ownerType + - writeId + - validWriteIdList """ thrift_spec = ( @@ -4480,9 +4482,11 @@ class Table: (16, TType.STRUCT, 'creationMetadata', (CreationMetadata, CreationMetadata.thrift_spec), None, ), # 16 (17, TType.STRING, 'catName', None, None, ), # 17 (18, TType.I32, 'ownerType', None, 1, ), # 18 + (19, TType.I64, 'writeId', None, -1, ), # 19 + (20, TType.STRING, 'validWriteIdList', None, None, ), # 20 ) - def __init__(self, tableName=None, dbName=None, owner=None, createTime=None, lastAccessTime=None, retention=None, sd=None, partitionKeys=None, parameters=None, viewOriginalText=None, viewExpandedText=None, tableType=None, privileges=None, temporary=thrift_spec[14][4], rewriteEnabled=None, creationMetadata=None, catName=None, ownerType=thrift_spec[18][4],): + def __init__(self, tableName=None, dbName=None, owner=None, createTime=None, lastAccessTime=None, retention=None, sd=None, partitionKeys=None, parameters=None, viewOriginalText=None, viewExpandedText=None, tableType=None, privileges=None, temporary=thrift_spec[14][4], rewriteEnabled=None, creationMetadata=None, catName=None, ownerType=thrift_spec[18][4], writeId=thrift_spec[19][4], validWriteIdList=None,): self.tableName = tableName self.dbName = dbName self.owner = owner @@ -4501,6 +4505,8 @@ def __init__(self, tableName=None, dbName=None, owner=None, createTime=None, las self.creationMetadata = creationMetadata self.catName = catName self.ownerType = ownerType + self.writeId = writeId + self.validWriteIdList = validWriteIdList 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: @@ -4616,6 +4622,16 @@ def read(self, iprot): self.ownerType = iprot.readI32() else: iprot.skip(ftype) + elif fid == 19: + if ftype == TType.I64: + self.writeId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 20: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -4705,6 +4721,14 @@ def write(self, oprot): oprot.writeFieldBegin('ownerType', TType.I32, 18) oprot.writeI32(self.ownerType) oprot.writeFieldEnd() + if self.writeId is not None: + oprot.writeFieldBegin('writeId', TType.I64, 19) + oprot.writeI64(self.writeId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 20) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -4732,6 +4756,8 @@ def __hash__(self): value = (value * 31) ^ hash(self.creationMetadata) value = (value * 31) ^ hash(self.catName) value = (value * 31) ^ hash(self.ownerType) + value = (value * 31) ^ hash(self.writeId) + value = (value * 31) ^ hash(self.validWriteIdList) return value def __repr__(self): @@ -4757,6 +4783,8 @@ class Partition: - parameters - privileges - catName + - writeId + - validWriteIdList """ thrift_spec = ( @@ -4770,9 +4798,11 @@ class Partition: (7, TType.MAP, 'parameters', (TType.STRING,None,TType.STRING,None), None, ), # 7 (8, TType.STRUCT, 'privileges', (PrincipalPrivilegeSet, PrincipalPrivilegeSet.thrift_spec), None, ), # 8 (9, TType.STRING, 'catName', None, None, ), # 9 + (10, TType.I64, 'writeId', None, -1, ), # 10 + (11, TType.STRING, 'validWriteIdList', None, None, ), # 11 ) - def __init__(self, values=None, dbName=None, tableName=None, createTime=None, lastAccessTime=None, sd=None, parameters=None, privileges=None, catName=None,): + def __init__(self, values=None, dbName=None, tableName=None, createTime=None, lastAccessTime=None, sd=None, parameters=None, privileges=None, catName=None, writeId=thrift_spec[10][4], validWriteIdList=None,): self.values = values self.dbName = dbName self.tableName = tableName @@ -4782,6 +4812,8 @@ def __init__(self, values=None, dbName=None, tableName=None, createTime=None, la self.parameters = parameters self.privileges = privileges self.catName = catName + self.writeId = writeId + self.validWriteIdList = validWriteIdList 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: @@ -4850,6 +4882,16 @@ def read(self, iprot): self.catName = iprot.readString() else: iprot.skip(ftype) + elif fid == 10: + if ftype == TType.I64: + self.writeId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 11: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -4903,6 +4945,14 @@ def write(self, oprot): oprot.writeFieldBegin('catName', TType.STRING, 9) oprot.writeString(self.catName) oprot.writeFieldEnd() + if self.writeId is not None: + oprot.writeFieldBegin('writeId', TType.I64, 10) + oprot.writeI64(self.writeId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 11) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -4921,6 +4971,8 @@ def __hash__(self): value = (value * 31) ^ hash(self.parameters) value = (value * 31) ^ hash(self.privileges) value = (value * 31) ^ hash(self.catName) + value = (value * 31) ^ hash(self.writeId) + value = (value * 31) ^ hash(self.validWriteIdList) return value def __repr__(self): @@ -5088,17 +5140,23 @@ class PartitionSpecWithSharedSD: Attributes: - partitions - sd + - writeId + - validWriteIdList """ thrift_spec = ( None, # 0 (1, TType.LIST, 'partitions', (TType.STRUCT,(PartitionWithoutSD, PartitionWithoutSD.thrift_spec)), None, ), # 1 (2, TType.STRUCT, 'sd', (StorageDescriptor, StorageDescriptor.thrift_spec), None, ), # 2 + (3, TType.I64, 'writeId', None, -1, ), # 3 + (4, TType.STRING, 'validWriteIdList', None, None, ), # 4 ) - def __init__(self, partitions=None, sd=None,): + def __init__(self, partitions=None, sd=None, writeId=thrift_spec[3][4], validWriteIdList=None,): self.partitions = partitions self.sd = sd + self.writeId = writeId + self.validWriteIdList = validWriteIdList 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: @@ -5126,6 +5184,16 @@ def read(self, iprot): self.sd.read(iprot) else: iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I64: + self.writeId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -5147,6 +5215,14 @@ def write(self, oprot): oprot.writeFieldBegin('sd', TType.STRUCT, 2) self.sd.write(oprot) oprot.writeFieldEnd() + if self.writeId is not None: + oprot.writeFieldBegin('writeId', TType.I64, 3) + oprot.writeI64(self.writeId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 4) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -5158,6 +5234,8 @@ def __hash__(self): value = 17 value = (value * 31) ^ hash(self.partitions) value = (value * 31) ^ hash(self.sd) + value = (value * 31) ^ hash(self.writeId) + value = (value * 31) ^ hash(self.validWriteIdList) return value def __repr__(self): @@ -6617,6 +6695,8 @@ class ColumnStatisticsDesc: - partName - lastAnalyzed - catName + - writeId + - validWriteIdList """ thrift_spec = ( @@ -6627,15 +6707,19 @@ class ColumnStatisticsDesc: (4, TType.STRING, 'partName', None, None, ), # 4 (5, TType.I64, 'lastAnalyzed', None, None, ), # 5 (6, TType.STRING, 'catName', None, None, ), # 6 + (7, TType.I64, 'writeId', None, -1, ), # 7 + (8, TType.STRING, 'validWriteIdList', None, None, ), # 8 ) - def __init__(self, isTblLevel=None, dbName=None, tableName=None, partName=None, lastAnalyzed=None, catName=None,): + def __init__(self, isTblLevel=None, dbName=None, tableName=None, partName=None, lastAnalyzed=None, catName=None, writeId=thrift_spec[7][4], validWriteIdList=None,): self.isTblLevel = isTblLevel self.dbName = dbName self.tableName = tableName self.partName = partName self.lastAnalyzed = lastAnalyzed self.catName = catName + self.writeId = writeId + self.validWriteIdList = validWriteIdList 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: @@ -6676,6 +6760,16 @@ def read(self, iprot): self.catName = iprot.readString() else: iprot.skip(ftype) + elif fid == 7: + if ftype == TType.I64: + self.writeId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -6710,6 +6804,14 @@ def write(self, oprot): oprot.writeFieldBegin('catName', TType.STRING, 6) oprot.writeString(self.catName) oprot.writeFieldEnd() + if self.writeId is not None: + oprot.writeFieldBegin('writeId', TType.I64, 7) + oprot.writeI64(self.writeId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 8) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -6731,6 +6833,8 @@ def __hash__(self): value = (value * 31) ^ hash(self.partName) value = (value * 31) ^ hash(self.lastAnalyzed) value = (value * 31) ^ hash(self.catName) + value = (value * 31) ^ hash(self.writeId) + value = (value * 31) ^ hash(self.validWriteIdList) return value def __repr__(self): @@ -6932,17 +7036,23 @@ class SetPartitionsStatsRequest: Attributes: - colStats - needMerge + - writeId + - validWriteIdList """ thrift_spec = ( None, # 0 (1, TType.LIST, 'colStats', (TType.STRUCT,(ColumnStatistics, ColumnStatistics.thrift_spec)), None, ), # 1 (2, TType.BOOL, 'needMerge', None, None, ), # 2 + (3, TType.I64, 'writeId', None, -1, ), # 3 + (4, TType.STRING, 'validWriteIdList', None, None, ), # 4 ) - def __init__(self, colStats=None, needMerge=None,): + def __init__(self, colStats=None, needMerge=None, writeId=thrift_spec[3][4], validWriteIdList=None,): self.colStats = colStats self.needMerge = needMerge + self.writeId = writeId + self.validWriteIdList = validWriteIdList 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: @@ -6969,6 +7079,16 @@ def read(self, iprot): self.needMerge = iprot.readBool() else: iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I64: + self.writeId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -6990,6 +7110,14 @@ def write(self, oprot): oprot.writeFieldBegin('needMerge', TType.BOOL, 2) oprot.writeBool(self.needMerge) oprot.writeFieldEnd() + if self.writeId is not None: + oprot.writeFieldBegin('writeId', TType.I64, 3) + oprot.writeI64(self.writeId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 4) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -7003,6 +7131,8 @@ def __hash__(self): value = 17 value = (value * 31) ^ hash(self.colStats) value = (value * 31) ^ hash(self.needMerge) + value = (value * 31) ^ hash(self.writeId) + value = (value * 31) ^ hash(self.validWriteIdList) return value def __repr__(self): @@ -9206,6 +9336,8 @@ class TableStatsRequest: - tblName - colNames - catName + - writeId + - validWriteIdList """ thrift_spec = ( @@ -9214,13 +9346,17 @@ class TableStatsRequest: (2, TType.STRING, 'tblName', None, None, ), # 2 (3, TType.LIST, 'colNames', (TType.STRING,None), None, ), # 3 (4, TType.STRING, 'catName', None, None, ), # 4 + (5, TType.I64, 'writeId', None, -1, ), # 5 + (6, TType.STRING, 'validWriteIdList', None, None, ), # 6 ) - def __init__(self, dbName=None, tblName=None, colNames=None, catName=None,): + def __init__(self, dbName=None, tblName=None, colNames=None, catName=None, writeId=thrift_spec[5][4], validWriteIdList=None,): self.dbName = dbName self.tblName = tblName self.colNames = colNames self.catName = catName + self.writeId = writeId + self.validWriteIdList = validWriteIdList 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: @@ -9256,6 +9392,16 @@ def read(self, iprot): self.catName = iprot.readString() else: iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I64: + self.writeId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -9285,6 +9431,14 @@ def write(self, oprot): oprot.writeFieldBegin('catName', TType.STRING, 4) oprot.writeString(self.catName) oprot.writeFieldEnd() + if self.writeId is not None: + oprot.writeFieldBegin('writeId', TType.I64, 5) + oprot.writeI64(self.writeId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 6) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -9304,6 +9458,8 @@ def __hash__(self): value = (value * 31) ^ hash(self.tblName) value = (value * 31) ^ hash(self.colNames) value = (value * 31) ^ hash(self.catName) + value = (value * 31) ^ hash(self.writeId) + value = (value * 31) ^ hash(self.validWriteIdList) return value def __repr__(self): @@ -9325,6 +9481,8 @@ class PartitionsStatsRequest: - colNames - partNames - catName + - writeId + - validWriteIdList """ thrift_spec = ( @@ -9334,14 +9492,18 @@ class PartitionsStatsRequest: (3, TType.LIST, 'colNames', (TType.STRING,None), None, ), # 3 (4, TType.LIST, 'partNames', (TType.STRING,None), None, ), # 4 (5, TType.STRING, 'catName', None, None, ), # 5 + (6, TType.I64, 'writeId', None, -1, ), # 6 + (7, TType.STRING, 'validWriteIdList', None, None, ), # 7 ) - def __init__(self, dbName=None, tblName=None, colNames=None, partNames=None, catName=None,): + def __init__(self, dbName=None, tblName=None, colNames=None, partNames=None, catName=None, writeId=thrift_spec[6][4], validWriteIdList=None,): self.dbName = dbName self.tblName = tblName self.colNames = colNames self.partNames = partNames self.catName = catName + self.writeId = writeId + self.validWriteIdList = validWriteIdList 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: @@ -9387,6 +9549,16 @@ def read(self, iprot): self.catName = iprot.readString() else: iprot.skip(ftype) + elif fid == 6: + if ftype == TType.I64: + self.writeId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -9423,6 +9595,14 @@ def write(self, oprot): oprot.writeFieldBegin('catName', TType.STRING, 5) oprot.writeString(self.catName) oprot.writeFieldEnd() + if self.writeId is not None: + oprot.writeFieldBegin('writeId', TType.I64, 6) + oprot.writeI64(self.writeId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 7) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -9445,6 +9625,8 @@ def __hash__(self): value = (value * 31) ^ hash(self.colNames) value = (value * 31) ^ hash(self.partNames) value = (value * 31) ^ hash(self.catName) + value = (value * 31) ^ hash(self.writeId) + value = (value * 31) ^ hash(self.validWriteIdList) return value def __repr__(self): @@ -16517,6 +16699,8 @@ class GetTableRequest: - tblName - capabilities - catName + - writeId + - validWriteIdList """ thrift_spec = ( @@ -16525,13 +16709,17 @@ class GetTableRequest: (2, TType.STRING, 'tblName', None, None, ), # 2 (3, TType.STRUCT, 'capabilities', (ClientCapabilities, ClientCapabilities.thrift_spec), None, ), # 3 (4, TType.STRING, 'catName', None, None, ), # 4 + (5, TType.I64, 'writeId', None, -1, ), # 5 + (6, TType.STRING, 'validWriteIdList', None, None, ), # 6 ) - def __init__(self, dbName=None, tblName=None, capabilities=None, catName=None,): + def __init__(self, dbName=None, tblName=None, capabilities=None, catName=None, writeId=thrift_spec[5][4], validWriteIdList=None,): self.dbName = dbName self.tblName = tblName self.capabilities = capabilities self.catName = catName + self.writeId = writeId + self.validWriteIdList = validWriteIdList 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: @@ -16563,6 +16751,16 @@ def read(self, iprot): self.catName = iprot.readString() else: iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I64: + self.writeId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -16589,6 +16787,14 @@ def write(self, oprot): oprot.writeFieldBegin('catName', TType.STRING, 4) oprot.writeString(self.catName) oprot.writeFieldEnd() + if self.writeId is not None: + oprot.writeFieldBegin('writeId', TType.I64, 5) + oprot.writeI64(self.writeId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 6) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -16606,6 +16812,8 @@ def __hash__(self): value = (value * 31) ^ hash(self.tblName) value = (value * 31) ^ hash(self.capabilities) value = (value * 31) ^ hash(self.catName) + value = (value * 31) ^ hash(self.writeId) + value = (value * 31) ^ hash(self.validWriteIdList) return value def __repr__(self): diff --git standalone-metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb standalone-metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb index fb73b28f62..b393c43158 100644 --- standalone-metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb +++ standalone-metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb @@ -1042,6 +1042,8 @@ class Table CREATIONMETADATA = 16 CATNAME = 17 OWNERTYPE = 18 + WRITEID = 19 + VALIDWRITEIDLIST = 20 FIELDS = { TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName'}, @@ -1061,7 +1063,9 @@ class Table REWRITEENABLED => {:type => ::Thrift::Types::BOOL, :name => 'rewriteEnabled', :optional => true}, CREATIONMETADATA => {:type => ::Thrift::Types::STRUCT, :name => 'creationMetadata', :class => ::CreationMetadata, :optional => true}, CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true}, - OWNERTYPE => {:type => ::Thrift::Types::I32, :name => 'ownerType', :default => 1, :optional => true, :enum_class => ::PrincipalType} + OWNERTYPE => {:type => ::Thrift::Types::I32, :name => 'ownerType', :default => 1, :optional => true, :enum_class => ::PrincipalType}, + WRITEID => {:type => ::Thrift::Types::I64, :name => 'writeId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true} } def struct_fields; FIELDS; end @@ -1086,6 +1090,8 @@ class Partition PARAMETERS = 7 PRIVILEGES = 8 CATNAME = 9 + WRITEID = 10 + VALIDWRITEIDLIST = 11 FIELDS = { VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::STRING}}, @@ -1096,7 +1102,9 @@ class Partition SD => {:type => ::Thrift::Types::STRUCT, :name => 'sd', :class => ::StorageDescriptor}, PARAMETERS => {:type => ::Thrift::Types::MAP, :name => 'parameters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}, PRIVILEGES => {:type => ::Thrift::Types::STRUCT, :name => 'privileges', :class => ::PrincipalPrivilegeSet, :optional => true}, - CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true} + CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true}, + WRITEID => {:type => ::Thrift::Types::I64, :name => 'writeId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true} } def struct_fields; FIELDS; end @@ -1137,10 +1145,14 @@ class PartitionSpecWithSharedSD include ::Thrift::Struct, ::Thrift::Struct_Union PARTITIONS = 1 SD = 2 + WRITEID = 3 + VALIDWRITEIDLIST = 4 FIELDS = { PARTITIONS => {:type => ::Thrift::Types::LIST, :name => 'partitions', :element => {:type => ::Thrift::Types::STRUCT, :class => ::PartitionWithoutSD}}, - SD => {:type => ::Thrift::Types::STRUCT, :name => 'sd', :class => ::StorageDescriptor} + SD => {:type => ::Thrift::Types::STRUCT, :name => 'sd', :class => ::StorageDescriptor}, + WRITEID => {:type => ::Thrift::Types::I64, :name => 'writeId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true} } def struct_fields; FIELDS; end @@ -1502,6 +1514,8 @@ class ColumnStatisticsDesc PARTNAME = 4 LASTANALYZED = 5 CATNAME = 6 + WRITEID = 7 + VALIDWRITEIDLIST = 8 FIELDS = { ISTBLLEVEL => {:type => ::Thrift::Types::BOOL, :name => 'isTblLevel'}, @@ -1509,7 +1523,9 @@ class ColumnStatisticsDesc TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName'}, PARTNAME => {:type => ::Thrift::Types::STRING, :name => 'partName', :optional => true}, LASTANALYZED => {:type => ::Thrift::Types::I64, :name => 'lastAnalyzed', :optional => true}, - CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true} + CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true}, + WRITEID => {:type => ::Thrift::Types::I64, :name => 'writeId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true} } def struct_fields; FIELDS; end @@ -1567,10 +1583,14 @@ class SetPartitionsStatsRequest include ::Thrift::Struct, ::Thrift::Struct_Union COLSTATS = 1 NEEDMERGE = 2 + WRITEID = 3 + VALIDWRITEIDLIST = 4 FIELDS = { COLSTATS => {:type => ::Thrift::Types::LIST, :name => 'colStats', :element => {:type => ::Thrift::Types::STRUCT, :class => ::ColumnStatistics}}, - NEEDMERGE => {:type => ::Thrift::Types::BOOL, :name => 'needMerge', :optional => true} + NEEDMERGE => {:type => ::Thrift::Types::BOOL, :name => 'needMerge', :optional => true}, + WRITEID => {:type => ::Thrift::Types::I64, :name => 'writeId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true} } def struct_fields; FIELDS; end @@ -2072,12 +2092,16 @@ class TableStatsRequest TBLNAME = 2 COLNAMES = 3 CATNAME = 4 + WRITEID = 5 + VALIDWRITEIDLIST = 6 FIELDS = { DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, TBLNAME => {:type => ::Thrift::Types::STRING, :name => 'tblName'}, COLNAMES => {:type => ::Thrift::Types::LIST, :name => 'colNames', :element => {:type => ::Thrift::Types::STRING}}, - CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true} + CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true}, + WRITEID => {:type => ::Thrift::Types::I64, :name => 'writeId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true} } def struct_fields; FIELDS; end @@ -2098,13 +2122,17 @@ class PartitionsStatsRequest COLNAMES = 3 PARTNAMES = 4 CATNAME = 5 + WRITEID = 6 + VALIDWRITEIDLIST = 7 FIELDS = { DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, TBLNAME => {:type => ::Thrift::Types::STRING, :name => 'tblName'}, COLNAMES => {:type => ::Thrift::Types::LIST, :name => 'colNames', :element => {:type => ::Thrift::Types::STRING}}, PARTNAMES => {:type => ::Thrift::Types::LIST, :name => 'partNames', :element => {:type => ::Thrift::Types::STRING}}, - CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true} + CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true}, + WRITEID => {:type => ::Thrift::Types::I64, :name => 'writeId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true} } def struct_fields; FIELDS; end @@ -3711,12 +3739,16 @@ class GetTableRequest TBLNAME = 2 CAPABILITIES = 3 CATNAME = 4 + WRITEID = 5 + VALIDWRITEIDLIST = 6 FIELDS = { DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, TBLNAME => {:type => ::Thrift::Types::STRING, :name => 'tblName'}, CAPABILITIES => {:type => ::Thrift::Types::STRUCT, :name => 'capabilities', :class => ::ClientCapabilities, :optional => true}, - CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true} + CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true}, + WRITEID => {:type => ::Thrift::Types::I64, :name => 'writeId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true} } def struct_fields; FIELDS; end diff --git standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MPartition.java standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MPartition.java index 4a97f891fe..075131a97a 100644 --- standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MPartition.java +++ standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MPartition.java @@ -30,7 +30,7 @@ private int lastAccessTime; private MStorageDescriptor sd; private Map parameters; - + private MPartitionUpdaterTransaction updaterTransaction; public MPartition() {} @@ -152,4 +152,11 @@ public void setCreateTime(int createTime) { this.createTime = createTime; } + public MPartitionUpdaterTransaction getUpdaterTransaction() { + return updaterTransaction; + } + + public void setUpdaterTransaction(MPartitionUpdaterTransaction updaterTransaction) { + this.updaterTransaction = updaterTransaction; + } } diff --git standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MPartitionColumnStatistics.java standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MPartitionColumnStatistics.java index 50d9c5b0cf..9cadd4e09a 100644 --- standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MPartitionColumnStatistics.java +++ standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MPartitionColumnStatistics.java @@ -55,6 +55,7 @@ private Long numTrues; private Long numFalses; private long lastAnalyzed; + private MPartitionUpdaterTransaction updaterTransaction; public MPartitionColumnStatistics() {} @@ -278,4 +279,12 @@ public void setDecimalHighValue(String decimalHighValue) { public void setBitVector(byte[] bitVector) { this.bitVector = bitVector; } + + public MPartitionUpdaterTransaction getUpdaterTransaction() { + return updaterTransaction; + } + + public void setUpdaterTransaction(MPartitionUpdaterTransaction updaterTransaction) { + this.updaterTransaction = updaterTransaction; + } } diff --git standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MPartitionUpdaterTransaction.java standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MPartitionUpdaterTransaction.java new file mode 100644 index 0000000000..40090fc485 --- /dev/null +++ standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MPartitionUpdaterTransaction.java @@ -0,0 +1,136 @@ +/* + * 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.model; + +import java.sql.Timestamp; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MPartitionUpdaterTransaction { + private String partName; + private MTable table; + private MPartition partition; + private Timestamp creationTime; + private long commitSeqId; + private char state; + private long writeId; // The corresponding column name is WRITE_ID. + private String writeIdList; + // Column UPDATE_ID is used as database identity. + + public MPartitionUpdaterTransaction() {} + + public MPartitionUpdaterTransaction( + String partName, + MTable table, + MPartition partition, + Timestamp creationTime, + long commitSeqId, + char state, + long writeId, + String writeIdList) { + this.partName = partName; + this.table = table; + this.partition = partition; + this.creationTime = creationTime; + this.commitSeqId = commitSeqId; + this.state = state; + this.writeId = writeId; + this.writeIdList = writeIdList; + } + + public MPartitionUpdaterTransaction( + String partName, + MTable table, + MPartition partition, + long commitSeqId, + long writeId, + char state) { + this.partName = partName; + this.table = table; + this.partition = partition; + this.commitSeqId = commitSeqId; + this.writeId = writeId; + this.state = state; + } + + public Timestamp getCreationTime() { + return creationTime; + } + + public void setCreationTime(Timestamp creationTime) { + this.creationTime = creationTime; + } + + public long getCommitSeqId() { + return commitSeqId; + } + + public void setCommitSeqId(long commitSeqId) { + this.commitSeqId = commitSeqId; + } + + public char getState() { + return state; + } + + public void setState(char state) { + this.state = state; + } + + public String getPartName() { + return partName; + } + + public void setPartName(String partName) { + this.partName = partName; + } + + public MTable getTable() { + return table; + } + + public void setTable(MTable table) { + this.table = table; + } + + public MPartition getMPartition() { + return partition; + } + + public void setMPartition(MPartition partition) { + this.partition = partition; + } + + public long getWriteId() { + return writeId; + } + + public void setWriteId(long writeId) { + this.writeId = writeId; + } + + public String getWriteIdList() { + return writeIdList; + } + + public void setWriteIdList(String writeIdList) { + this.writeIdList = writeIdList; + } +} diff --git standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTable.java standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTable.java index 38ad47915b..59afd818ba 100644 --- standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTable.java +++ standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTable.java @@ -37,6 +37,7 @@ private String viewExpandedText; private boolean rewriteEnabled; private String tableType; + private MUpdaterTransaction updaterTransaction; public MTable() {} @@ -270,4 +271,12 @@ public void setTableType(String tableType) { public String getTableType() { return tableType; } + + public MUpdaterTransaction getUpdaterTransaction() { + return updaterTransaction; + } + + public void setUpdaterTransaction(MUpdaterTransaction updaterTransaction) { + this.updaterTransaction = updaterTransaction; + } } diff --git standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTableColumnStatistics.java standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTableColumnStatistics.java index 731cd6f7fa..7e97af0503 100644 --- standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTableColumnStatistics.java +++ standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTableColumnStatistics.java @@ -53,6 +53,7 @@ private Long numTrues; private Long numFalses; private long lastAnalyzed; + private MUpdaterTransaction updaterTransaction; public MTableColumnStatistics() {} @@ -269,4 +270,12 @@ public void setDecimalHighValue(String decimalHighValue) { public void setBitVector(byte[] bitVector) { this.bitVector = bitVector; } + + public MUpdaterTransaction getUpdaterTransaction() { + return updaterTransaction; + } + + public void setUpdaterTransaction(MUpdaterTransaction updaterTransaction) { + this.updaterTransaction = updaterTransaction; + } } diff --git standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MUpdaterTransaction.java standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MUpdaterTransaction.java new file mode 100644 index 0000000000..51291e4fe4 --- /dev/null +++ standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MUpdaterTransaction.java @@ -0,0 +1,133 @@ +/* + * 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.model; + +import java.sql.Timestamp; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MUpdaterTransaction { + private String dbName; + private String tblName; + private MTable table; + private Timestamp creationTime; + private long commitSeqId; + private char state; + private long writeId; // The corresponding column name is WRITE_ID. + private String writeIdList; + // Column UPDATE_ID is used as database identity. + + public MUpdaterTransaction() {} + + public MUpdaterTransaction( + String dbName, + String tblName, + MTable table, + char state, + long writeId, + String writeIdList) { + this.dbName = dbName; + this.tblName = tblName; + this.table = table; + this.state = state; + this.writeId = writeId; + this.writeIdList = writeIdList; + } + + public MUpdaterTransaction( + String dbName, + String tblName, + MTable table, + long commitSeqId, + long writeId, + char state) { + this.dbName = dbName; + this.tblName = tblName; + this.table = table; + this.commitSeqId = commitSeqId; + this.writeId = writeId; + this.state = state; + } + + public Timestamp getCreationTime() { + return creationTime; + } + + public void setCreationTime(Timestamp creationTime) { + this.creationTime = creationTime; + } + + public long getCommitSeqId() { + return commitSeqId; + } + + public void setCommitSeqId(long commitSeqId) { + this.commitSeqId = commitSeqId; + } + + public char getState() { + return state; + } + + public void setState(char state) { + this.state = state; + } + + public String getDbName() { + return dbName; + } + + public void setDbName(String dbName) { + this.dbName = dbName; + } + + public String getTblName() { + return tblName; + } + + public void setTblName(String tblName) { + this.tblName = tblName; + } + + public MTable getMTable() { + return table; + } + + public void setMTable(MTable table) { + this.table = table; + } + + public long getWriteId() { + return writeId; + } + + public void setWriteId(long writeId) { + this.writeId = writeId; + } + + public String getWriteIdList() { + return writeIdList; + } + + public void setWriteIdList(String writeIdList) { + this.writeIdList = writeIdList; + } +} + diff --git standalone-metastore/src/main/resources/package.jdo standalone-metastore/src/main/resources/package.jdo index 2d2cb19991..c177bd8144 100644 --- standalone-metastore/src/main/resources/package.jdo +++ standalone-metastore/src/main/resources/package.jdo @@ -210,6 +210,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -489,6 +552,9 @@ + + + @@ -965,6 +1031,9 @@ + + + @@ -1035,6 +1104,9 @@ + + + diff --git standalone-metastore/src/main/sql/derby/hive-schema-3.0.0.derby.sql standalone-metastore/src/main/sql/derby/hive-schema-3.0.0.derby.sql index 8e097553c3..1f6cbcef71 100644 --- standalone-metastore/src/main/sql/derby/hive-schema-3.0.0.derby.sql +++ standalone-metastore/src/main/sql/derby/hive-schema-3.0.0.derby.sql @@ -47,7 +47,7 @@ CREATE TABLE "APP"."IDXS" ("INDEX_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT CREATE TABLE "APP"."INDEX_PARAMS" ("INDEX_ID" BIGINT NOT NULL, "PARAM_KEY" VARCHAR(256) NOT NULL, "PARAM_VALUE" VARCHAR(4000)); -CREATE TABLE "APP"."PARTITIONS" ("PART_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "LAST_ACCESS_TIME" INTEGER NOT NULL, "PART_NAME" VARCHAR(767), "SD_ID" BIGINT, "TBL_ID" BIGINT); +CREATE TABLE "APP"."PARTITIONS" ("PART_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "LAST_ACCESS_TIME" INTEGER NOT NULL, "PART_NAME" VARCHAR(767), "SD_ID" BIGINT, "TBL_ID" BIGINT, "UPDATE_ID" BIGINT); CREATE TABLE "APP"."SERDES" ("SERDE_ID" BIGINT NOT NULL, "NAME" VARCHAR(128), "SLIB" VARCHAR(4000), "DESCRIPTION" VARCHAR(4000), "SERIALIZER_CLASS" VARCHAR(4000), "DESERIALIZER_CLASS" VARCHAR(4000), SERDE_TYPE INTEGER); @@ -75,7 +75,7 @@ CREATE TABLE "APP"."COLUMNS" ("SD_ID" BIGINT NOT NULL, "COMMENT" VARCHAR(256), " CREATE TABLE "APP"."ROLES" ("ROLE_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "OWNER_NAME" VARCHAR(128), "ROLE_NAME" VARCHAR(128)); -CREATE TABLE "APP"."TBLS" ("TBL_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "DB_ID" BIGINT, "LAST_ACCESS_TIME" INTEGER NOT NULL, "OWNER" VARCHAR(767), "OWNER_TYPE" VARCHAR(10), "RETENTION" INTEGER NOT NULL, "SD_ID" BIGINT, "TBL_NAME" VARCHAR(256), "TBL_TYPE" VARCHAR(128), "VIEW_EXPANDED_TEXT" LONG VARCHAR, "VIEW_ORIGINAL_TEXT" LONG VARCHAR, "IS_REWRITE_ENABLED" CHAR(1) NOT NULL DEFAULT 'N'); +CREATE TABLE "APP"."TBLS" ("TBL_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "DB_ID" BIGINT, "LAST_ACCESS_TIME" INTEGER NOT NULL, "OWNER" VARCHAR(767), "OWNER_TYPE" VARCHAR(10), "RETENTION" INTEGER NOT NULL, "SD_ID" BIGINT, "TBL_NAME" VARCHAR(256), "TBL_TYPE" VARCHAR(128), "VIEW_EXPANDED_TEXT" LONG VARCHAR, "VIEW_ORIGINAL_TEXT" LONG VARCHAR, "IS_REWRITE_ENABLED" CHAR(1) NOT NULL DEFAULT 'N', "UPDATE_ID" BIGINT); CREATE TABLE "APP"."PARTITION_KEYS" ("TBL_ID" BIGINT NOT NULL, "PKEY_COMMENT" VARCHAR(4000), "PKEY_NAME" VARCHAR(128) NOT NULL, "PKEY_TYPE" VARCHAR(767) NOT NULL, "INTEGER_IDX" INTEGER NOT NULL); @@ -106,7 +106,8 @@ CREATE TABLE "APP"."TAB_COL_STATS"( "LAST_ANALYZED" BIGINT, "CS_ID" BIGINT NOT NULL, "TBL_ID" BIGINT NOT NULL, - "BIT_VECTOR" BLOB + "BIT_VECTOR" BLOB, + "UPDATE_ID" BIGINT ); CREATE TABLE "APP"."TABLE_PARAMS" ("TBL_ID" BIGINT NOT NULL, "PARAM_KEY" VARCHAR(256) NOT NULL, "PARAM_VALUE" CLOB); @@ -155,7 +156,8 @@ CREATE TABLE "APP"."PART_COL_STATS"( "NUM_FALSES" BIGINT, "LAST_ANALYZED" BIGINT, "CS_ID" BIGINT NOT NULL, - "PART_ID" BIGINT NOT NULL + "PART_ID" BIGINT NOT NULL, + "UPDATE_ID" BIGINT ); CREATE TABLE "APP"."VERSION" ("VER_ID" BIGINT NOT NULL, "SCHEMA_VERSION" VARCHAR(127) NOT NULL, "VERSION_COMMENT" VARCHAR(255)); @@ -211,6 +213,34 @@ CREATE TABLE "APP"."CTLGS" ( "DESC" VARCHAR(4000), "LOCATION_URI" VARCHAR(4000) NOT NULL); +CREATE TABLE "APP"."UPD_TXNS" ( + "UPDATE_ID" BIGINT NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" BIGINT NOT NULL, + "DB_NAME" VARCHAR(128) NOT NULL, + "TBL_NAME" VARCHAR(256) NOT NULL, + "TBL_ID" BIGINT NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" BIGINT NOT NULL, + "WRITEID_LIST" CLOB +); + +CREATE TABLE "APP"."UPD_PARTTXNS" ( + "UPDATE_ID" BIGINT NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" BIGINT NOT NULL, + "PART_NAME" VARCHAR(767) NOT NULL, + "PART_ID" BIGINT NOT NULL, + "TBL_ID" BIGINT NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" BIGINT NOT NULL, + "WRITEID_LIST" CLOB +); + +CREATE TABLE "APP"."NEXT_UPDATE_COMMIT_SEQID" ( + NUCS_NEXT bigint NOT NULL +); + -- ---------------------------------------------- -- DML Statements -- ---------------------------------------------- @@ -219,6 +249,8 @@ INSERT INTO "APP"."NOTIFICATION_SEQUENCE" ("NNI_ID", "NEXT_EVENT_ID") SELECT * F INSERT INTO "APP"."SEQUENCE_TABLE" ("SEQUENCE_NAME", "NEXT_VAL") SELECT * FROM (VALUES ('org.apache.hadoop.hive.metastore.model.MNotificationLog', 1)) tmp_table WHERE NOT EXISTS ( SELECT "NEXT_VAL" FROM "APP"."SEQUENCE_TABLE" WHERE "SEQUENCE_NAME" = 'org.apache.hadoop.hive.metastore.model.MNotificationLog'); +INSERT INTO "APP"."NEXT_UPDATE_COMMIT_SEQID" VALUES(1); + -- ---------------------------------------------- -- DDL Statements for indexes -- ---------------------------------------------- @@ -373,6 +405,9 @@ ALTER TABLE "APP"."MV_CREATION_METADATA" ADD CONSTRAINT "MV_CREATION_METADATA_PK ALTER TABLE "APP"."CTLGS" ADD CONSTRAINT "CTLG_PK" PRIMARY KEY ("CTLG_ID"); +ALTER TABLE "APP"."UPD_TXNS" ADD CONSTRAINT "UPD_TXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE "APP"."UPD_PARTTXNS" ADD CONSTRAINT "UPD_PARTTXNS_PK" PRIMARY KEY ("UPDATE_ID"); -- foreign ALTER TABLE "APP"."IDXS" ADD CONSTRAINT "IDXS_FK1" FOREIGN KEY ("ORIG_TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION; @@ -483,6 +518,10 @@ ALTER TABLE "APP"."MV_TABLES_USED" ADD CONSTRAINT "MV_TABLES_USED_FK2" FOREIGN K ALTER TABLE "APP"."DBS" ADD CONSTRAINT "DBS_CTLG_FK" FOREIGN KEY ("CTLG_NAME") REFERENCES "APP"."CTLGS" ("NAME") ON DELETE NO ACTION ON UPDATE NO ACTION; +ALTER TABLE "APP"."UPD_TXNS" ADD CONSTRAINT "UPD_TXNS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION; + +ALTER TABLE "APP"."UPD_PARTTXNS" ADD CONSTRAINT "UPD_PARTTXNS_FK1" FOREIGN KEY ("PART_ID") REFERENCES "APP"."PARTITIONS" ("PART_ID") ON DELETE NO ACTION ON UPDATE NO ACTION; + -- ---------------------------------------------- -- DDL Statements for checks -- ---------------------------------------------- diff --git standalone-metastore/src/main/sql/derby/upgrade-2.3.0-to-3.0.0.derby.sql standalone-metastore/src/main/sql/derby/upgrade-2.3.0-to-3.0.0.derby.sql index 73bef36d68..ece8608ce5 100644 --- standalone-metastore/src/main/sql/derby/upgrade-2.3.0-to-3.0.0.derby.sql +++ standalone-metastore/src/main/sql/derby/upgrade-2.3.0-to-3.0.0.derby.sql @@ -254,6 +254,51 @@ CREATE TABLE "APP"."RUNTIME_STATS" ( CREATE INDEX IDX_RUNTIME_STATS_CREATE_TIME ON RUNTIME_STATS(CREATE_TIME); +-- HIVE-19416 +CREATE TABLE "APP"."UPD_TXNS" ( + "UPDATE_ID" BIGINT NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" BIGINT NOT NULL, + "DB_NAME" VARCHAR(128) NOT NULL, + "TBL_NAME" VARCHAR(256) NOT NULL, + "TBL_ID" BIGINT NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" BIGINT NOT NULL, + "WRITEID_LIST" CLOB +); + +ALTER TABLE "APP"."UPD_TXNS" ADD CONSTRAINT "UPD_TXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE "APP"."UPD_TXNS" ADD CONSTRAINT "UPD_TXNS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION; + +CREATE TABLE "APP"."UPD_PARTTXNS" ( + "UPDATE_ID" BIGINT NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" BIGINT NOT NULL, + "PART_NAME" VARCHAR(767) NOT NULL, + "PART_ID" BIGINT NOT NULL, + "TBL_ID" BIGINT NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" BIGINT NOT NULL, + "WRITEID_LIST" CLOB +); + +ALTER TABLE "APP"."UPD_PARTTXNS" ADD CONSTRAINT "UPD_PARTTXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE "APP"."UPD_PARTTXNS" ADD CONSTRAINT "UPD_PARTTXNS_FK1" FOREIGN KEY ("PART_ID") REFERENCES "APP"."PARTITIONS" ("PART_ID") ON DELETE NO ACTION ON UPDATE NO ACTION; + +CREATE TABLE "APP"."NEXT_UPDATE_COMMIT_SEQID" ( + NUCS_NEXT bigint NOT NULL +); + +INSERT INTO "APP"."NEXT_UPDATE_COMMIT_SEQID" VALUES(1); + +ALTER TABLE "APP"."TBLS" ADD UPDATE_ID bigint; +ALTER TABLE "APP"."PARTITIONS" ADD UPDATE_ID bigint; + +ALTER TABLE "APP"."TAB_COL_STATS" ADD UPDATE_ID bigint; +ALTER TABLE "APP"."PART_COL_STATS" ADD UPDATE_ID bigint; + -- This needs to be the last thing done. Insert any changes above this line. UPDATE "APP".VERSION SET SCHEMA_VERSION='3.0.0', VERSION_COMMENT='Hive release version 3.0.0' where VER_ID=1; diff --git standalone-metastore/src/main/sql/mssql/hive-schema-3.0.0.mssql.sql standalone-metastore/src/main/sql/mssql/hive-schema-3.0.0.mssql.sql index 51df92cff1..f080dcfb04 100644 --- standalone-metastore/src/main/sql/mssql/hive-schema-3.0.0.mssql.sql +++ standalone-metastore/src/main/sql/mssql/hive-schema-3.0.0.mssql.sql @@ -94,7 +94,8 @@ CREATE TABLE PART_COL_STATS PART_ID bigint NULL, PARTITION_NAME nvarchar(767) NOT NULL, "TABLE_NAME" nvarchar(256) NOT NULL, - "CAT_NAME" nvarchar(256) NOT NULL + "CAT_NAME" nvarchar(256) NOT NULL, + UPDATE_ID bigint NULL ); ALTER TABLE PART_COL_STATS ADD CONSTRAINT PART_COL_STATS_PK PRIMARY KEY (CS_ID); @@ -144,7 +145,8 @@ CREATE TABLE PARTITIONS LAST_ACCESS_TIME int NOT NULL, PART_NAME nvarchar(767) NULL, SD_ID bigint NULL, - TBL_ID bigint NULL + TBL_ID bigint NULL, + UPDATE_ID bigint NULL ); ALTER TABLE PARTITIONS ADD CONSTRAINT PARTITIONS_PK PRIMARY KEY (PART_ID); @@ -238,7 +240,8 @@ CREATE TABLE TAB_COL_STATS NUM_TRUES bigint NULL, TBL_ID bigint NULL, "TABLE_NAME" nvarchar(256) NOT NULL, - "CAT_NAME" nvarchar(256) NOT NULL + "CAT_NAME" nvarchar(256) NOT NULL, + UPDATE_ID bigint NULL ); ALTER TABLE TAB_COL_STATS ADD CONSTRAINT TAB_COL_STATS_PK PRIMARY KEY (CS_ID); @@ -369,7 +372,8 @@ CREATE TABLE TBLS TBL_TYPE nvarchar(128) NULL, VIEW_EXPANDED_TEXT text NULL, VIEW_ORIGINAL_TEXT text NULL, - IS_REWRITE_ENABLED bit NOT NULL DEFAULT 0 + IS_REWRITE_ENABLED bit NOT NULL DEFAULT 0, + UPDATE_ID bigint NULL ); ALTER TABLE TBLS ADD CONSTRAINT TBLS_PK PRIMARY KEY (TBL_ID); @@ -1240,6 +1244,44 @@ CREATE TABLE RUNTIME_STATS ( CREATE INDEX IDX_RUNTIME_STATS_CREATE_TIME ON RUNTIME_STATS(CREATE_TIME); +CREATE TABLE "UPD_TXNS" ( + "UPDATE_ID" bigint NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" bigint NOT NULL, + "DB_NAME" VARCHAR(128) NOT NULL, + "TBL_NAME" VARCHAR(256) NOT NULL, + "TBL_ID" bigint NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" bigint NOT NULL, + "WRITEID_LIST" text NULL +); + +ALTER TABLE "UPD_TXNS" ADD CONSTRAINT "UPD_TXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE "UPD_TXNS" WITH CHECK ADD FOREIGN KEY("TBL_ID") REFERENCES "TBLS" ("TBL_ID"); + +CREATE TABLE "UPD_PARTTXNS" ( + "UPDATE_ID" bigint NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" bigint NOT NULL, + "PART_NAME" VARCHAR(767) NOT NULL, + "PART_ID" bigint NOT NULL, + "TBL_ID" bigint NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" bigint NOT NULL, + "WRITEID_LIST" text NULL +); + +ALTER TABLE "UPD_PARTTXNS" ADD CONSTRAINT "UPD_PARTTXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE "UPD_PARTTXNS" WITH CHECK ADD FOREIGN KEY ("PART_ID") REFERENCES "PARTITIONS" ("PART_ID"); + +CREATE TABLE NEXT_UPDATE_COMMIT_SEQID ( + NUCS_NEXT bigint NOT NULL +); + +INSERT INTO NEXT_UPDATE_COMMIT_SEQID VALUES(1); + -- ----------------------------------------------------------------- -- Record schema version. Should be the last step in the init script -- ----------------------------------------------------------------- diff --git standalone-metastore/src/main/sql/mssql/upgrade-2.3.0-to-3.0.0.mssql.sql standalone-metastore/src/main/sql/mssql/upgrade-2.3.0-to-3.0.0.mssql.sql index a7232dd443..186c7771d4 100644 --- standalone-metastore/src/main/sql/mssql/upgrade-2.3.0-to-3.0.0.mssql.sql +++ standalone-metastore/src/main/sql/mssql/upgrade-2.3.0-to-3.0.0.mssql.sql @@ -321,6 +321,51 @@ CREATE TABLE RUNTIME_STATS ( CREATE INDEX IDX_RUNTIME_STATS_CREATE_TIME ON RUNTIME_STATS(CREATE_TIME); +-- HIVE-19416 +CREATE TABLE "UPD_TXNS" ( + "UPDATE_ID" bigint NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" bigint NOT NULL, + "DB_NAME" VARCHAR(128) NOT NULL, + "TBL_NAME" VARCHAR(256) NOT NULL, + "TBL_ID" bigint NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" bigint NOT NULL, + "WRITEID_LIST" text NULL +); + +ALTER TABLE "UPD_TXNS" ADD CONSTRAINT "UPD_TXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE "UPD_TXNS" WITH CHECK ADD FOREIGN KEY("TBL_ID") REFERENCES "TBLS" ("TBL_ID"); + +CREATE TABLE "UPD_PARTTXNS" ( + "UPDATE_ID" bigint NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" bigint NOT NULL, + "PART_NAME" VARCHAR(767) NOT NULL, + "PART_ID" bigint NOT NULL, + "TBL_ID" bigint NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" bigint NOT NULL, + "WRITEID_LIST" text NULL +); + +ALTER TABLE "UPD_PARTTXNS" ADD CONSTRAINT "UPD_PARTTXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE "UPD_PARTTXNS" WITH CHECK ADD FOREIGN KEY ("PART_ID") REFERENCES "PARTITIONS" ("PART_ID"); + +CREATE TABLE NEXT_UPDATE_COMMIT_SEQID ( + NUCS_NEXT bigint NOT NULL +); + +INSERT INTO NEXT_UPDATE_COMMIT_SEQID VALUES(1); + +ALTER TABLE TBLS ADD UPDATE_ID bigint NULL; +ALTER TABLE PARTITIONS ADD UPDATE_ID bigint NULL; + +ALTER TABLE TAB_COL_STATS ADD UPDATE_ID bigint NULL; +ALTER TABLE PART_COL_STATS ADD UPDATE_ID bigint NULL; + -- These lines need to be last. Insert any changes above. UPDATE VERSION SET SCHEMA_VERSION='3.0.0', VERSION_COMMENT='Hive release version 3.0.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 2.3.0 to 3.0.0' AS MESSAGE; diff --git standalone-metastore/src/main/sql/mysql/hive-schema-3.0.0.mysql.sql standalone-metastore/src/main/sql/mysql/hive-schema-3.0.0.mysql.sql index 8e55e94374..64a4cc5721 100644 --- standalone-metastore/src/main/sql/mysql/hive-schema-3.0.0.mysql.sql +++ standalone-metastore/src/main/sql/mysql/hive-schema-3.0.0.mysql.sql @@ -1165,6 +1165,40 @@ CREATE TABLE RUNTIME_STATS ( CREATE INDEX IDX_RUNTIME_STATS_CREATE_TIME ON RUNTIME_STATS(CREATE_TIME); +CREATE TABLE `UPD_TXNS` ( + `UPDATE_ID` bigint(20) NOT NULL, + `CREATION_TIME` timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + `COMMIT_SEQID` bigint(20) NOT NULL, + `DB_NAME` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `TBL_NAME` varchar(256) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `TBL_ID` bigint(20) NOT NULL, + `STATE` char(1) NOT NULL, + `WRITE_ID` bigint(20) NOT NULL, + `WRITEID_LIST` TEXT DEFAULT NULL, + PRIMARY KEY (`UPDATE_ID`), + CONSTRAINT `UPD_TXNS_FK1` FOREIGN KEY (`TBL_ID`) REFERENCES `TBLS` (`TBL_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `UPD_PARTTXNS` ( + `UPDATE_ID` bigint(20) NOT NULL, + `CREATION_TIME` timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + `COMMIT_SEQID` bigint(20) NOT NULL, + "PART_NAME" VARCHAR(767) NOT NULL, + "PART_ID" BIGINT NOT NULL, + "TBL_ID" BIGINT NOT NULL, + `STATE` char(1) NOT NULL, + `WRITE_ID` bigint(20) NOT NULL, + `WRITEID_LIST` TEXT DEFAULT NULL, + PRIMARY KEY (`UPDATE_ID`), + CONSTRAINT `UPD_PARTTXNS_FK1` FOREIGN KEY (`PART_ID`) REFERENCES `PARTITIONS` (`PART_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE NEXT_UPDATE_COMMIT_SEQID ( + NUCS_NEXT bigint NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +INSERT INTO NEXT_UPDATE_COMMIT_SEQID VALUES(1); + -- ----------------------------------------------------------------- -- Record schema version. Should be the last step in the init script -- ----------------------------------------------------------------- diff --git standalone-metastore/src/main/sql/mysql/upgrade-2.3.0-to-3.0.0.mysql.sql standalone-metastore/src/main/sql/mysql/upgrade-2.3.0-to-3.0.0.mysql.sql index 9a48346c5c..307a075966 100644 --- standalone-metastore/src/main/sql/mysql/upgrade-2.3.0-to-3.0.0.mysql.sql +++ standalone-metastore/src/main/sql/mysql/upgrade-2.3.0-to-3.0.0.mysql.sql @@ -292,8 +292,53 @@ CREATE TABLE RUNTIME_STATS ( CREATE INDEX IDX_RUNTIME_STATS_CREATE_TIME ON RUNTIME_STATS(CREATE_TIME); +-- HIVE-19416 +CREATE TABLE "APP"."UPD_TXNS" ( + "UPDATE_ID" BIGINT NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" BIGINT NOT NULL, + "DB_NAME" VARCHAR(128) NOT NULL, + "TBL_NAME" VARCHAR(256) NOT NULL, + "TBL_ID" BIGINT NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" BIGINT NOT NULL, + "WRITEID_LIST" CLOB +); + +ALTER TABLE "APP"."UPD_TXNS" ADD CONSTRAINT "UPD_TXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE "APP"."UPD_TXNS" ADD CONSTRAINT "UPD_TXNS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION; + +CREATE TABLE "APP"."UPD_PARTTXNS" ( + "UPDATE_ID" BIGINT NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" BIGINT NOT NULL, + "PART_NAME" VARCHAR(767) NOT NULL, + "PART_ID" BIGINT NOT NULL, + "TBL_ID" BIGINT NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" BIGINT NOT NULL, + "WRITEID_LIST" CLOB +); + +ALTER TABLE "APP"."UPD_PARTTXNS" ADD CONSTRAINT "UPD_PARTTXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE "APP"."UPD_PARTTXNS" ADD CONSTRAINT "UPD_PARTTXNS_FK1" FOREIGN KEY ("PART_ID") REFERENCES "APP"."PARTITIONS" ("PART_ID") ON DELETE NO ACTION ON UPDATE NO ACTION; + +CREATE TABLE NEXT_UPDATE_COMMIT_SEQID ( + NUCS_NEXT bigint NOT NULL +); + +INSERT INTO NEXT_UPDATE_COMMIT_SEQID VALUES(1); + +ALTER TABLE TBLS ADD UPDATE_ID bigint; +ALTER TABLE PARTITIONS ADD UPDATE_ID bigint; + +ALTER TABLE TAB_COL_STATS ADD UPDATE_ID bigint; +ALTER TABLE PART_COL_STATS ADD UPDATE_ID bigint; + -- These lines need to be last. Insert any changes above. UPDATE VERSION SET SCHEMA_VERSION='3.0.0', VERSION_COMMENT='Hive release version 3.0.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 2.3.0 to 3.0.0' AS ' '; -ALTER TABLE `TBLS` ADD COLUMN `OWNER_TYPE` VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL; \ No newline at end of file +ALTER TABLE `TBLS` ADD COLUMN `OWNER_TYPE` VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL; diff --git standalone-metastore/src/main/sql/oracle/hive-schema-3.0.0.oracle.sql standalone-metastore/src/main/sql/oracle/hive-schema-3.0.0.oracle.sql index 3a12e087a6..f805ca0fb1 100644 --- standalone-metastore/src/main/sql/oracle/hive-schema-3.0.0.oracle.sql +++ standalone-metastore/src/main/sql/oracle/hive-schema-3.0.0.oracle.sql @@ -162,7 +162,8 @@ CREATE TABLE PARTITIONS LAST_ACCESS_TIME NUMBER (10) NOT NULL, PART_NAME VARCHAR2(767) NULL, SD_ID NUMBER NULL, - TBL_ID NUMBER NULL + TBL_ID NUMBER NULL, + UPDATE_ID NUMBER NULL ); ALTER TABLE PARTITIONS ADD CONSTRAINT PARTITIONS_PK PRIMARY KEY (PART_ID); @@ -189,7 +190,8 @@ CREATE TABLE TBL_COL_PRIVS PRINCIPAL_NAME VARCHAR2(128) NULL, PRINCIPAL_TYPE VARCHAR2(128) NULL, TBL_COL_PRIV VARCHAR2(128) NULL, - TBL_ID NUMBER NULL + TBL_ID NUMBER NULL, + UPDATE_ID NUMBER NULL ); ALTER TABLE TBL_COL_PRIVS ADD CONSTRAINT TBL_COL_PRIVS_PK PRIMARY KEY (TBL_COLUMN_GRANT_ID); @@ -392,7 +394,8 @@ CREATE TABLE TBLS TBL_TYPE VARCHAR2(128) NULL, VIEW_EXPANDED_TEXT CLOB NULL, VIEW_ORIGINAL_TEXT CLOB NULL, - IS_REWRITE_ENABLED NUMBER(1) DEFAULT 0 NOT NULL CHECK (IS_REWRITE_ENABLED IN (1,0)) + IS_REWRITE_ENABLED NUMBER(1) DEFAULT 0 NOT NULL CHECK (IS_REWRITE_ENABLED IN (1,0)), + UPDATE_ID NUMBER NULL ); ALTER TABLE TBLS ADD CONSTRAINT TBLS_PK PRIMARY KEY (TBL_ID); @@ -563,7 +566,8 @@ CREATE TABLE PART_COL_STATS ( MAX_COL_LEN NUMBER, NUM_TRUES NUMBER, NUM_FALSES NUMBER, - LAST_ANALYZED NUMBER NOT NULL + LAST_ANALYZED NUMBER NOT NULL, + UPDATE_ID NUMBER NULL ); ALTER TABLE PART_COL_STATS ADD CONSTRAINT PART_COL_STATS_PKEY PRIMARY KEY (CS_ID); @@ -1134,6 +1138,43 @@ CREATE TABLE RUNTIME_STATS ( CREATE INDEX IDX_RUNTIME_STATS_CREATE_TIME ON RUNTIME_STATS(CREATE_TIME); +CREATE TABLE "UPD_TXNS" ( + "UPDATE_ID" number NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" number NOT NULL, + "DB_NAME" VARCHAR(128) NOT NULL, + "TBL_NAME" VARCHAR(256) NOT NULL, + "TBL_ID" number NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" number NOT NULL, + "WRITEID_LIST" CLOB NULL +); + +ALTER TABLE "UPD_TXNS" ADD CONSTRAINT "UPD_TXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE "UPD_TXNS" ADD CONSTRAINT "UPD_TXNS_FK1" FOREIGN KEY("TBL_ID") REFERENCES "TBLS" ("TBL_ID") INITIALLY DEFERRED ; + +CREATE TABLE "UPD_PARTTXNS" ( + "UPDATE_ID" number NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" number NOT NULL, + "PART_NAME" VARCHAR(767) NOT NULL, + "PART_ID" number NOT NULL, + "TBL_ID" number NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" number NOT NULL, + "WRITEID_LIST" CLOB NULL +); + +ALTER TABLE "UPD_PARTTXNS" ADD CONSTRAINT "UPD_PARTTXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE "UPD_PARTTXNS" ADD CONSTRAINT "UPD_PARTTXNS_FK1" FOREIGN KEY ("PART_ID") REFERENCES "PARTITIONS" ("PART_ID") INITIALLY DEFERRED ; + +CREATE TABLE NEXT_UPDATE_COMMIT_SEQID ( + NUCS_NEXT number NOT NULL +); + +INSERT INTO NEXT_UPDATE_COMMIT_SEQID VALUES(1); -- ----------------------------------------------------------------- -- Record schema version. Should be the last step in the init script diff --git standalone-metastore/src/main/sql/oracle/upgrade-2.3.0-to-3.0.0.oracle.sql standalone-metastore/src/main/sql/oracle/upgrade-2.3.0-to-3.0.0.oracle.sql index 3be7e65713..5a45326776 100644 --- standalone-metastore/src/main/sql/oracle/upgrade-2.3.0-to-3.0.0.oracle.sql +++ standalone-metastore/src/main/sql/oracle/upgrade-2.3.0-to-3.0.0.oracle.sql @@ -310,8 +310,52 @@ CREATE TABLE RUNTIME_STATS ( CREATE INDEX IDX_RUNTIME_STATS_CREATE_TIME ON RUNTIME_STATS(CREATE_TIME); +CREATE TABLE "UPD_TXNS" ( + "UPDATE_ID" number NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" number NOT NULL, + "DB_NAME" VARCHAR(128) NOT NULL, + "TBL_NAME" VARCHAR(256) NOT NULL, + "TBL_ID" number NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" number NOT NULL, + "WRITEID_LIST" CLOB NULL +); + +ALTER TABLE "UPD_TXNS" ADD CONSTRAINT "UPD_TXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE "UPD_TXNS" ADD CONSTRAINT "UPD_TXNS_FK1" FOREIGN KEY("TBL_ID") REFERENCES "TBLS" ("TBL_ID") INITIALLY DEFERRED ; + +CREATE TABLE "UPD_PARTTXNS" ( + "UPDATE_ID" number NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" number NOT NULL, + "PART_NAME" VARCHAR(767) NOT NULL, + "PART_ID" number NOT NULL, + "TBL_ID" number NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" number NOT NULL, + "WRITEID_LIST" CLOB NULL +); + +ALTER TABLE "UPD_PARTTXNS" ADD CONSTRAINT "UPD_PARTTXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE "UPD_PARTTXNS" ADD CONSTRAINT "UPD_PARTTXNS_FK1" FOREIGN KEY ("PART_ID") REFERENCES "PARTITIONS" ("PART_ID") INITIALLY DEFERRED ; + +CREATE TABLE NEXT_UPDATE_COMMIT_SEQID ( + NUCS_NEXT number NOT NULL +); + +INSERT INTO NEXT_UPDATE_COMMIT_SEQID VALUES(1); + +ALTER TABLE TBLS ADD UPDATE_ID number NULL; +ALTER TABLE PARTITIONS ADD UPDATE_ID number NULL; + +ALTER TABLE TAB_COL_STATS ADD UPDATE_ID number NULL; +ALTER TABLE PART_COL_STATS ADD UPDATE_ID number NULL; + -- These lines need to be last. Insert any changes above. UPDATE VERSION SET SCHEMA_VERSION='3.0.0', VERSION_COMMENT='Hive release version 3.0.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 2.3.0 to 3.0.0' AS Status from dual; -ALTER TABLE TBLS ADD OWNER_TYPE VARCHAR2(10) NULL; \ No newline at end of file +ALTER TABLE TBLS ADD OWNER_TYPE VARCHAR2(10) NULL; diff --git standalone-metastore/src/main/sql/postgres/hive-schema-3.0.0.postgres.sql standalone-metastore/src/main/sql/postgres/hive-schema-3.0.0.postgres.sql index 0152f48050..99c7074566 100644 --- standalone-metastore/src/main/sql/postgres/hive-schema-3.0.0.postgres.sql +++ standalone-metastore/src/main/sql/postgres/hive-schema-3.0.0.postgres.sql @@ -166,7 +166,8 @@ CREATE TABLE "PARTITIONS" ( "LAST_ACCESS_TIME" bigint NOT NULL, "PART_NAME" character varying(767) DEFAULT NULL::character varying, "SD_ID" bigint, - "TBL_ID" bigint + "TBL_ID" bigint, + "UPDATE_ID" bigint ); @@ -388,7 +389,8 @@ CREATE TABLE "TBLS" ( "TBL_TYPE" character varying(128) DEFAULT NULL::character varying, "VIEW_EXPANDED_TEXT" text, "VIEW_ORIGINAL_TEXT" text, - "IS_REWRITE_ENABLED" boolean NOT NULL DEFAULT false + "IS_REWRITE_ENABLED" boolean NOT NULL DEFAULT false, + "UPDATE_ID" bigint ); -- @@ -539,7 +541,8 @@ CREATE TABLE "TAB_COL_STATS" ( "MAX_COL_LEN" bigint, "NUM_TRUES" bigint, "NUM_FALSES" bigint, - "LAST_ANALYZED" bigint NOT NULL + "LAST_ANALYZED" bigint NOT NULL, + "UPDATE_ID" bigint ); -- @@ -577,7 +580,8 @@ CREATE TABLE "PART_COL_STATS" ( "MAX_COL_LEN" bigint, "NUM_TRUES" bigint, "NUM_FALSES" bigint, - "LAST_ANALYZED" bigint NOT NULL + "LAST_ANALYZED" bigint NOT NULL, + "UPDATE_ID" bigint ); -- @@ -698,6 +702,36 @@ CREATE TABLE "WM_MAPPING" ( "ORDERING" integer ); +CREATE TABLE "APP"."UPD_TXNS" ( + "UPDATE_ID" BIGINT NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" BIGINT NOT NULL, + "DB_NAME" VARCHAR(128) NOT NULL, + "TBL_NAME" VARCHAR(256) NOT NULL, + "TBL_ID" BIGINT NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" BIGINT NOT NULL, + "WRITEID_LIST" text +); + +CREATE TABLE "APP"."UPD_PARTTXNS" ( + "UPDATE_ID" BIGINT NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" BIGINT NOT NULL, + "PART_NAME" VARCHAR(767) NOT NULL, + "PART_ID" BIGINT NOT NULL, + "TBL_ID" BIGINT NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" BIGINT NOT NULL, + "WRITEID_LIST" text +); + +CREATE TABLE NEXT_UPDATE_COMMIT_SEQID ( + NUCS_NEXT bigint NOT NULL +); + +INSERT INTO NEXT_UPDATE_COMMIT_SEQID VALUES(1); + -- -- Name: BUCKETING_COLS_pkey; Type: CONSTRAINT; Schema: public; Owner: hiveuser; Tablespace: -- @@ -1074,6 +1108,14 @@ ALTER TABLE ONLY "WM_MAPPING" ALTER TABLE ONLY "WM_MAPPING" ADD CONSTRAINT "UNIQUE_WM_MAPPING" UNIQUE ("RP_ID", "ENTITY_TYPE", "ENTITY_NAME"); +-- Transactional table stats PK constraints + +ALTER TABLE ONLY "UPD_TXNS" + ADD CONSTRAINT "UPD_TXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE ONLY "UPD_PARTTXNS" + ADD CONSTRAINT "UPD_PARTTXNS_PK" PRIMARY KEY ("UPDATE_ID"); + -- -- Name: BUCKETING_COLS_N49; Type: INDEX; Schema: public; Owner: hiveuser; Tablespace: -- @@ -1618,6 +1660,14 @@ ALTER TABLE ONLY "MV_TABLES_USED" ALTER TABLE ONLY "MV_TABLES_USED" ADD CONSTRAINT "MV_TABLES_USED_FK2" FOREIGN KEY ("TBL_ID") REFERENCES "TBLS" ("TBL_ID") DEFERRABLE; +-- Transactional table stats FK constraints + +ALTER TABLE ONLY "UPD_TXNS" + ADD CONSTRAINT "UPD_TXNS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "TBLS" ("TBL_ID") DEFERRABLE; + +ALTER TABLE ONLY "UPD_PARTTXNS" + ADD CONSTRAINT "UPD_PARTTXNS_FK1" FOREIGN KEY ("PART_ID") REFERENCES "PARTITIONS" ("PART_ID") DEFERRABLE; + -- -- Name: public; Type: ACL; Schema: -; Owner: hiveuser -- @@ -1822,7 +1872,6 @@ CREATE TABLE RUNTIME_STATS ( CREATE INDEX IDX_RUNTIME_STATS_CREATE_TIME ON RUNTIME_STATS(CREATE_TIME); - -- ----------------------------------------------------------------- -- Record schema version. Should be the last step in the init script -- ----------------------------------------------------------------- diff --git standalone-metastore/src/main/sql/postgres/upgrade-2.3.0-to-3.0.0.postgres.sql standalone-metastore/src/main/sql/postgres/upgrade-2.3.0-to-3.0.0.postgres.sql index fed8a93ed6..5f72de3177 100644 --- standalone-metastore/src/main/sql/postgres/upgrade-2.3.0-to-3.0.0.postgres.sql +++ standalone-metastore/src/main/sql/postgres/upgrade-2.3.0-to-3.0.0.postgres.sql @@ -329,6 +329,56 @@ CREATE TABLE RUNTIME_STATS ( CREATE INDEX IDX_RUNTIME_STATS_CREATE_TIME ON RUNTIME_STATS(CREATE_TIME); +-- HIVE-19416 + +CREATE TABLE "UPD_TXNS" ( + "UPDATE_ID" BIGINT NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" BIGINT NOT NULL, + "DB_NAME" VARCHAR(128) NOT NULL, + "TBL_NAME" VARCHAR(256) NOT NULL, + "TBL_ID" BIGINT NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" BIGINT NOT NULL, + "WRITEID_LIST" text +); + +CREATE TABLE "UPD_PARTTXNS" ( + "UPDATE_ID" BIGINT NOT NULL, + "CREATION_TIME" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + "COMMIT_SEQID" BIGINT NOT NULL, + "PART_NAME" VARCHAR(767) NOT NULL, + "PART_ID" BIGINT NOT NULL, + "TBL_ID" BIGINT NOT NULL, + "STATE" CHAR(1) NOT NULL, + "WRITE_ID" BIGINT NOT NULL, + "WRITEID_LIST" text +); + +CREATE TABLE NEXT_UPDATE_COMMIT_SEQID ( + NUCS_NEXT bigint NOT NULL +); + +INSERT INTO NEXT_UPDATE_COMMIT_SEQID VALUES(1); + +ALTER TABLE ONLY "UPD_TXNS" + ADD CONSTRAINT "UPD_TXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE ONLY "UPD_PARTTXNS" + ADD CONSTRAINT "UPD_PARTTXNS_PK" PRIMARY KEY ("UPDATE_ID"); + +ALTER TABLE ONLY "UPD_TXNS" + ADD CONSTRAINT "UPD_TXNS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "TBLS" ("TBL_ID") DEFERRABLE; + +ALTER TABLE ONLY "UPD_PARTTXNS" + ADD CONSTRAINT "UPD_PARTTXNS_FK1" FOREIGN KEY ("PART_ID") REFERENCES "PARTITIONS" ("PART_ID") DEFERRABLE; + +ALTER TABLE "TBLS" ADD "UPDATE_ID" bigint; +ALTER TABLE "PARTITIONS" ADD "UPDATE_ID" bigint; + +ALTER TABLE "TAB_COL_STATS" ADD "UPDATE_ID" bigint; +ALTER TABLE "PART_COL_STATS" ADD "UPDATE_ID" bigint; + -- These lines need to be last. Insert any changes above. UPDATE "VERSION" SET "SCHEMA_VERSION"='3.0.0', "VERSION_COMMENT"='Hive release version 3.0.0' where "VER_ID"=1; SELECT 'Finished upgrading MetaStore schema from 2.3.0 to 3.0.0'; diff --git standalone-metastore/src/main/thrift/hive_metastore.thrift standalone-metastore/src/main/thrift/hive_metastore.thrift index 19d4433078..b3b0810102 100644 --- standalone-metastore/src/main/thrift/hive_metastore.thrift +++ standalone-metastore/src/main/thrift/hive_metastore.thrift @@ -424,7 +424,9 @@ struct Table { 15: optional bool rewriteEnabled, // rewrite enabled or not 16: optional CreationMetadata creationMetadata, // only for MVs, it stores table names used and txn list at MV creation 17: optional string catName, // Name of the catalog the table is in - 18: optional PrincipalType ownerType = PrincipalType.USER // owner type of this table (default to USER for backward compatibility) + 18: optional PrincipalType ownerType = PrincipalType.USER, // owner type of this table (default to USER for backward compatibility) + 19: optional i64 writeId=-1, + 20: optional string validWriteIdList } struct Partition { @@ -436,7 +438,9 @@ struct Partition { 6: StorageDescriptor sd, 7: map parameters, 8: optional PrincipalPrivilegeSet privileges, - 9: optional string catName + 9: optional string catName, + 10: optional i64 writeId=-1, + 11: optional string validWriteIdList } struct PartitionWithoutSD { @@ -451,6 +455,8 @@ struct PartitionWithoutSD { struct PartitionSpecWithSharedSD { 1: list partitions, 2: StorageDescriptor sd, + 3: optional i64 writeId=-1, + 4: optional string validWriteIdList } struct PartitionListComposingSpec { @@ -553,7 +559,9 @@ struct ColumnStatisticsDesc { 3: required string tableName, 4: optional string partName, 5: optional i64 lastAnalyzed, -6: optional string catName +6: optional string catName, +7: optional i64 writeId=-1, +8: optional string validWriteIdList } struct ColumnStatistics { @@ -568,7 +576,9 @@ struct AggrStats { struct SetPartitionsStatsRequest { 1: required list colStats, -2: optional bool needMerge //stats need to be merged with the existing stats +2: optional bool needMerge, //stats need to be merged with the existing stats +3: optional i64 writeId=-1, +4: optional string validWriteIdList } // schema of the table/query results etc. @@ -708,7 +718,9 @@ struct TableStatsRequest { 1: required string dbName, 2: required string tblName, 3: required list colNames - 4: optional string catName + 4: optional string catName, + 5: optional i64 writeId=-1, + 6: optional string validWriteIdList } struct PartitionsStatsRequest { @@ -716,7 +728,9 @@ struct PartitionsStatsRequest { 2: required string tblName, 3: required list colNames, 4: required list partNames, - 5: optional string catName + 5: optional string catName, + 6: optional i64 writeId=-1, + 7: optional string validWriteIdList } // Return type for add_partitions_req @@ -1203,7 +1217,9 @@ struct GetTableRequest { 1: required string dbName, 2: required string tblName, 3: optional ClientCapabilities capabilities, - 4: optional string catName + 4: optional string catName, + 5: optional i64 writeId=-1, + 6: optional string validWriteIdList } struct GetTableResult {