Index: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java =================================================================== --- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (revision 1440777) +++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (working copy) @@ -128,6 +128,7 @@ HiveConf.ConfVars.HMSHANDLERATTEMPTS, HiveConf.ConfVars.HMSHANDLERINTERVAL, HiveConf.ConfVars.HMSHANDLERFORCERELOADCONF, + HiveConf.ConfVars.METASTORE_PARTITION_NAME_WHITELIST_PATTERN }; /** Index: conf/hive-default.xml.template =================================================================== --- conf/hive-default.xml.template (revision 1440777) +++ conf/hive-default.xml.template (working copy) @@ -286,7 +286,7 @@ hive.metastore.partition.name.whitelist.pattern - Partition names will be checked against this regex pattern and rejected if not matched. To use, enable hive.metastore.pre.event.listeners=org.apache.hadoop.hive.metastore.PartitionNameWhitelistPreEventListener Listener will not register if this property value is empty. + Partition names will be checked against this regex pattern and rejected if not matched. Index: metastore/if/hive_metastore.thrift =================================================================== --- metastore/if/hive_metastore.thrift (revision 1440777) +++ metastore/if/hive_metastore.thrift (working copy) @@ -499,6 +499,11 @@ void rename_partition(1:string db_name, 2:string tbl_name, 3:list part_vals, 4:Partition new_part) throws (1:InvalidOperationException o1, 2:MetaException o2) + // returns whether or not the partition name is valid based on the value of the config + // hive.metastore.partition.name.whitelist.pattern + bool partition_name_has_valid_characters(1:list part_vals, 2:bool throw_exception) + throws(1: MetaException o1) + // gets the value of the configuration key in the metastore server. returns // defaultValue if the key does not exist. if the configuration key does not // begin with "hive", "mapred", or "hdfs", a ConfigValSecurityException is Index: metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp =================================================================== --- metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp (revision 1440777) +++ metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp (working copy) @@ -10942,6 +10942,232 @@ return xfer; } +uint32_t ThriftHiveMetastore_partition_name_has_valid_characters_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->part_vals.clear(); + uint32_t _size497; + ::apache::thrift::protocol::TType _etype500; + xfer += iprot->readListBegin(_etype500, _size497); + this->part_vals.resize(_size497); + uint32_t _i501; + for (_i501 = 0; _i501 < _size497; ++_i501) + { + xfer += iprot->readString(this->part_vals[_i501]); + } + xfer += iprot->readListEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->throw_exception); + this->__isset.throw_exception = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_partition_name_has_valid_characters_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_partition_name_has_valid_characters_args"); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); + std::vector ::const_iterator _iter502; + for (_iter502 = this->part_vals.begin(); _iter502 != this->part_vals.end(); ++_iter502) + { + xfer += oprot->writeString((*_iter502)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("throw_exception", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->throw_exception); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_partition_name_has_valid_characters_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_partition_name_has_valid_characters_pargs"); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); + std::vector ::const_iterator _iter503; + for (_iter503 = (*(this->part_vals)).begin(); _iter503 != (*(this->part_vals)).end(); ++_iter503) + { + xfer += oprot->writeString((*_iter503)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("throw_exception", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool((*(this->throw_exception))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_partition_name_has_valid_characters_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_partition_name_has_valid_characters_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_partition_name_has_valid_characters_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_partition_name_has_valid_characters_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + uint32_t ThriftHiveMetastore_get_config_value_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; @@ -11230,14 +11456,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size497; - ::apache::thrift::protocol::TType _etype500; - xfer += iprot->readListBegin(_etype500, _size497); - this->success.resize(_size497); - uint32_t _i501; - for (_i501 = 0; _i501 < _size497; ++_i501) + uint32_t _size504; + ::apache::thrift::protocol::TType _etype507; + xfer += iprot->readListBegin(_etype507, _size504); + this->success.resize(_size504); + uint32_t _i508; + for (_i508 = 0; _i508 < _size504; ++_i508) { - xfer += iprot->readString(this->success[_i501]); + xfer += iprot->readString(this->success[_i508]); } xfer += iprot->readListEnd(); } @@ -11276,10 +11502,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); - std::vector ::const_iterator _iter502; - for (_iter502 = this->success.begin(); _iter502 != this->success.end(); ++_iter502) + std::vector ::const_iterator _iter509; + for (_iter509 = this->success.begin(); _iter509 != this->success.end(); ++_iter509) { - xfer += oprot->writeString((*_iter502)); + xfer += oprot->writeString((*_iter509)); } xfer += oprot->writeListEnd(); } @@ -11318,14 +11544,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size503; - ::apache::thrift::protocol::TType _etype506; - xfer += iprot->readListBegin(_etype506, _size503); - (*(this->success)).resize(_size503); - uint32_t _i507; - for (_i507 = 0; _i507 < _size503; ++_i507) + uint32_t _size510; + ::apache::thrift::protocol::TType _etype513; + xfer += iprot->readListBegin(_etype513, _size510); + (*(this->success)).resize(_size510); + uint32_t _i514; + for (_i514 = 0; _i514 < _size510; ++_i514) { - xfer += iprot->readString((*(this->success))[_i507]); + xfer += iprot->readString((*(this->success))[_i514]); } xfer += iprot->readListEnd(); } @@ -11444,17 +11670,17 @@ if (ftype == ::apache::thrift::protocol::T_MAP) { { this->success.clear(); - uint32_t _size508; - ::apache::thrift::protocol::TType _ktype509; - ::apache::thrift::protocol::TType _vtype510; - xfer += iprot->readMapBegin(_ktype509, _vtype510, _size508); - uint32_t _i512; - for (_i512 = 0; _i512 < _size508; ++_i512) + uint32_t _size515; + ::apache::thrift::protocol::TType _ktype516; + ::apache::thrift::protocol::TType _vtype517; + xfer += iprot->readMapBegin(_ktype516, _vtype517, _size515); + uint32_t _i519; + for (_i519 = 0; _i519 < _size515; ++_i519) { - std::string _key513; - xfer += iprot->readString(_key513); - std::string& _val514 = this->success[_key513]; - xfer += iprot->readString(_val514); + std::string _key520; + xfer += iprot->readString(_key520); + std::string& _val521 = this->success[_key520]; + xfer += iprot->readString(_val521); } xfer += iprot->readMapEnd(); } @@ -11493,11 +11719,11 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0); { xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); - std::map ::const_iterator _iter515; - for (_iter515 = this->success.begin(); _iter515 != this->success.end(); ++_iter515) + std::map ::const_iterator _iter522; + for (_iter522 = this->success.begin(); _iter522 != this->success.end(); ++_iter522) { - xfer += oprot->writeString(_iter515->first); - xfer += oprot->writeString(_iter515->second); + xfer += oprot->writeString(_iter522->first); + xfer += oprot->writeString(_iter522->second); } xfer += oprot->writeMapEnd(); } @@ -11536,17 +11762,17 @@ if (ftype == ::apache::thrift::protocol::T_MAP) { { (*(this->success)).clear(); - uint32_t _size516; - ::apache::thrift::protocol::TType _ktype517; - ::apache::thrift::protocol::TType _vtype518; - xfer += iprot->readMapBegin(_ktype517, _vtype518, _size516); - uint32_t _i520; - for (_i520 = 0; _i520 < _size516; ++_i520) + uint32_t _size523; + ::apache::thrift::protocol::TType _ktype524; + ::apache::thrift::protocol::TType _vtype525; + xfer += iprot->readMapBegin(_ktype524, _vtype525, _size523); + uint32_t _i527; + for (_i527 = 0; _i527 < _size523; ++_i527) { - std::string _key521; - xfer += iprot->readString(_key521); - std::string& _val522 = (*(this->success))[_key521]; - xfer += iprot->readString(_val522); + std::string _key528; + xfer += iprot->readString(_key528); + std::string& _val529 = (*(this->success))[_key528]; + xfer += iprot->readString(_val529); } xfer += iprot->readMapEnd(); } @@ -11615,17 +11841,17 @@ if (ftype == ::apache::thrift::protocol::T_MAP) { { this->part_vals.clear(); - uint32_t _size523; - ::apache::thrift::protocol::TType _ktype524; - ::apache::thrift::protocol::TType _vtype525; - xfer += iprot->readMapBegin(_ktype524, _vtype525, _size523); - uint32_t _i527; - for (_i527 = 0; _i527 < _size523; ++_i527) + uint32_t _size530; + ::apache::thrift::protocol::TType _ktype531; + ::apache::thrift::protocol::TType _vtype532; + xfer += iprot->readMapBegin(_ktype531, _vtype532, _size530); + uint32_t _i534; + for (_i534 = 0; _i534 < _size530; ++_i534) { - std::string _key528; - xfer += iprot->readString(_key528); - std::string& _val529 = this->part_vals[_key528]; - xfer += iprot->readString(_val529); + std::string _key535; + xfer += iprot->readString(_key535); + std::string& _val536 = this->part_vals[_key535]; + xfer += iprot->readString(_val536); } xfer += iprot->readMapEnd(); } @@ -11636,9 +11862,9 @@ break; case 4: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast530; - xfer += iprot->readI32(ecast530); - this->eventType = (PartitionEventType::type)ecast530; + int32_t ecast537; + xfer += iprot->readI32(ecast537); + this->eventType = (PartitionEventType::type)ecast537; this->__isset.eventType = true; } else { xfer += iprot->skip(ftype); @@ -11671,11 +11897,11 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_MAP, 3); { xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); - std::map ::const_iterator _iter531; - for (_iter531 = this->part_vals.begin(); _iter531 != this->part_vals.end(); ++_iter531) + std::map ::const_iterator _iter538; + for (_iter538 = this->part_vals.begin(); _iter538 != this->part_vals.end(); ++_iter538) { - xfer += oprot->writeString(_iter531->first); - xfer += oprot->writeString(_iter531->second); + xfer += oprot->writeString(_iter538->first); + xfer += oprot->writeString(_iter538->second); } xfer += oprot->writeMapEnd(); } @@ -11705,11 +11931,11 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_MAP, 3); { xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); - std::map ::const_iterator _iter532; - for (_iter532 = (*(this->part_vals)).begin(); _iter532 != (*(this->part_vals)).end(); ++_iter532) + std::map ::const_iterator _iter539; + for (_iter539 = (*(this->part_vals)).begin(); _iter539 != (*(this->part_vals)).end(); ++_iter539) { - xfer += oprot->writeString(_iter532->first); - xfer += oprot->writeString(_iter532->second); + xfer += oprot->writeString(_iter539->first); + xfer += oprot->writeString(_iter539->second); } xfer += oprot->writeMapEnd(); } @@ -11960,17 +12186,17 @@ if (ftype == ::apache::thrift::protocol::T_MAP) { { this->part_vals.clear(); - uint32_t _size533; - ::apache::thrift::protocol::TType _ktype534; - ::apache::thrift::protocol::TType _vtype535; - xfer += iprot->readMapBegin(_ktype534, _vtype535, _size533); - uint32_t _i537; - for (_i537 = 0; _i537 < _size533; ++_i537) + uint32_t _size540; + ::apache::thrift::protocol::TType _ktype541; + ::apache::thrift::protocol::TType _vtype542; + xfer += iprot->readMapBegin(_ktype541, _vtype542, _size540); + uint32_t _i544; + for (_i544 = 0; _i544 < _size540; ++_i544) { - std::string _key538; - xfer += iprot->readString(_key538); - std::string& _val539 = this->part_vals[_key538]; - xfer += iprot->readString(_val539); + std::string _key545; + xfer += iprot->readString(_key545); + std::string& _val546 = this->part_vals[_key545]; + xfer += iprot->readString(_val546); } xfer += iprot->readMapEnd(); } @@ -11981,9 +12207,9 @@ break; case 4: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast540; - xfer += iprot->readI32(ecast540); - this->eventType = (PartitionEventType::type)ecast540; + int32_t ecast547; + xfer += iprot->readI32(ecast547); + this->eventType = (PartitionEventType::type)ecast547; this->__isset.eventType = true; } else { xfer += iprot->skip(ftype); @@ -12016,11 +12242,11 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_MAP, 3); { xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); - std::map ::const_iterator _iter541; - for (_iter541 = this->part_vals.begin(); _iter541 != this->part_vals.end(); ++_iter541) + std::map ::const_iterator _iter548; + for (_iter548 = this->part_vals.begin(); _iter548 != this->part_vals.end(); ++_iter548) { - xfer += oprot->writeString(_iter541->first); - xfer += oprot->writeString(_iter541->second); + xfer += oprot->writeString(_iter548->first); + xfer += oprot->writeString(_iter548->second); } xfer += oprot->writeMapEnd(); } @@ -12050,11 +12276,11 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_MAP, 3); { xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); - std::map ::const_iterator _iter542; - for (_iter542 = (*(this->part_vals)).begin(); _iter542 != (*(this->part_vals)).end(); ++_iter542) + std::map ::const_iterator _iter549; + for (_iter549 = (*(this->part_vals)).begin(); _iter549 != (*(this->part_vals)).end(); ++_iter549) { - xfer += oprot->writeString(_iter542->first); - xfer += oprot->writeString(_iter542->second); + xfer += oprot->writeString(_iter549->first); + xfer += oprot->writeString(_iter549->second); } xfer += oprot->writeMapEnd(); } @@ -13359,14 +13585,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size543; - ::apache::thrift::protocol::TType _etype546; - xfer += iprot->readListBegin(_etype546, _size543); - this->success.resize(_size543); - uint32_t _i547; - for (_i547 = 0; _i547 < _size543; ++_i547) + uint32_t _size550; + ::apache::thrift::protocol::TType _etype553; + xfer += iprot->readListBegin(_etype553, _size550); + this->success.resize(_size550); + uint32_t _i554; + for (_i554 = 0; _i554 < _size550; ++_i554) { - xfer += this->success[_i547].read(iprot); + xfer += this->success[_i554].read(iprot); } xfer += iprot->readListEnd(); } @@ -13413,10 +13639,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); - std::vector ::const_iterator _iter548; - for (_iter548 = this->success.begin(); _iter548 != this->success.end(); ++_iter548) + std::vector ::const_iterator _iter555; + for (_iter555 = this->success.begin(); _iter555 != this->success.end(); ++_iter555) { - xfer += (*_iter548).write(oprot); + xfer += (*_iter555).write(oprot); } xfer += oprot->writeListEnd(); } @@ -13459,14 +13685,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size549; - ::apache::thrift::protocol::TType _etype552; - xfer += iprot->readListBegin(_etype552, _size549); - (*(this->success)).resize(_size549); - uint32_t _i553; - for (_i553 = 0; _i553 < _size549; ++_i553) + uint32_t _size556; + ::apache::thrift::protocol::TType _etype559; + xfer += iprot->readListBegin(_etype559, _size556); + (*(this->success)).resize(_size556); + uint32_t _i560; + for (_i560 = 0; _i560 < _size556; ++_i560) { - xfer += (*(this->success))[_i553].read(iprot); + xfer += (*(this->success))[_i560].read(iprot); } xfer += iprot->readListEnd(); } @@ -13625,14 +13851,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size554; - ::apache::thrift::protocol::TType _etype557; - xfer += iprot->readListBegin(_etype557, _size554); - this->success.resize(_size554); - uint32_t _i558; - for (_i558 = 0; _i558 < _size554; ++_i558) + uint32_t _size561; + ::apache::thrift::protocol::TType _etype564; + xfer += iprot->readListBegin(_etype564, _size561); + this->success.resize(_size561); + uint32_t _i565; + for (_i565 = 0; _i565 < _size561; ++_i565) { - xfer += iprot->readString(this->success[_i558]); + xfer += iprot->readString(this->success[_i565]); } xfer += iprot->readListEnd(); } @@ -13671,10 +13897,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); - std::vector ::const_iterator _iter559; - for (_iter559 = this->success.begin(); _iter559 != this->success.end(); ++_iter559) + std::vector ::const_iterator _iter566; + for (_iter566 = this->success.begin(); _iter566 != this->success.end(); ++_iter566) { - xfer += oprot->writeString((*_iter559)); + xfer += oprot->writeString((*_iter566)); } xfer += oprot->writeListEnd(); } @@ -13713,14 +13939,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size560; - ::apache::thrift::protocol::TType _etype563; - xfer += iprot->readListBegin(_etype563, _size560); - (*(this->success)).resize(_size560); - uint32_t _i564; - for (_i564 = 0; _i564 < _size560; ++_i564) + uint32_t _size567; + ::apache::thrift::protocol::TType _etype570; + xfer += iprot->readListBegin(_etype570, _size567); + (*(this->success)).resize(_size567); + uint32_t _i571; + for (_i571 = 0; _i571 < _size567; ++_i571) { - xfer += iprot->readString((*(this->success))[_i564]); + xfer += iprot->readString((*(this->success))[_i571]); } xfer += iprot->readListEnd(); } @@ -15794,14 +16020,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size565; - ::apache::thrift::protocol::TType _etype568; - xfer += iprot->readListBegin(_etype568, _size565); - this->success.resize(_size565); - uint32_t _i569; - for (_i569 = 0; _i569 < _size565; ++_i569) + uint32_t _size572; + ::apache::thrift::protocol::TType _etype575; + xfer += iprot->readListBegin(_etype575, _size572); + this->success.resize(_size572); + uint32_t _i576; + for (_i576 = 0; _i576 < _size572; ++_i576) { - xfer += iprot->readString(this->success[_i569]); + xfer += iprot->readString(this->success[_i576]); } xfer += iprot->readListEnd(); } @@ -15840,10 +16066,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); - std::vector ::const_iterator _iter570; - for (_iter570 = this->success.begin(); _iter570 != this->success.end(); ++_iter570) + std::vector ::const_iterator _iter577; + for (_iter577 = this->success.begin(); _iter577 != this->success.end(); ++_iter577) { - xfer += oprot->writeString((*_iter570)); + xfer += oprot->writeString((*_iter577)); } xfer += oprot->writeListEnd(); } @@ -15882,14 +16108,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size571; - ::apache::thrift::protocol::TType _etype574; - xfer += iprot->readListBegin(_etype574, _size571); - (*(this->success)).resize(_size571); - uint32_t _i575; - for (_i575 = 0; _i575 < _size571; ++_i575) + uint32_t _size578; + ::apache::thrift::protocol::TType _etype581; + xfer += iprot->readListBegin(_etype581, _size578); + (*(this->success)).resize(_size578); + uint32_t _i582; + for (_i582 = 0; _i582 < _size578; ++_i582) { - xfer += iprot->readString((*(this->success))[_i575]); + xfer += iprot->readString((*(this->success))[_i582]); } xfer += iprot->readListEnd(); } @@ -15956,9 +16182,9 @@ break; case 3: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast576; - xfer += iprot->readI32(ecast576); - this->principal_type = (PrincipalType::type)ecast576; + int32_t ecast583; + xfer += iprot->readI32(ecast583); + this->principal_type = (PrincipalType::type)ecast583; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -15974,9 +16200,9 @@ break; case 5: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast577; - xfer += iprot->readI32(ecast577); - this->grantorType = (PrincipalType::type)ecast577; + int32_t ecast584; + xfer += iprot->readI32(ecast584); + this->grantorType = (PrincipalType::type)ecast584; this->__isset.grantorType = true; } else { xfer += iprot->skip(ftype); @@ -16222,9 +16448,9 @@ break; case 3: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast578; - xfer += iprot->readI32(ecast578); - this->principal_type = (PrincipalType::type)ecast578; + int32_t ecast585; + xfer += iprot->readI32(ecast585); + this->principal_type = (PrincipalType::type)ecast585; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -16430,9 +16656,9 @@ break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast579; - xfer += iprot->readI32(ecast579); - this->principal_type = (PrincipalType::type)ecast579; + int32_t ecast586; + xfer += iprot->readI32(ecast586); + this->principal_type = (PrincipalType::type)ecast586; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -16508,14 +16734,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size580; - ::apache::thrift::protocol::TType _etype583; - xfer += iprot->readListBegin(_etype583, _size580); - this->success.resize(_size580); - uint32_t _i584; - for (_i584 = 0; _i584 < _size580; ++_i584) + uint32_t _size587; + ::apache::thrift::protocol::TType _etype590; + xfer += iprot->readListBegin(_etype590, _size587); + this->success.resize(_size587); + uint32_t _i591; + for (_i591 = 0; _i591 < _size587; ++_i591) { - xfer += this->success[_i584].read(iprot); + xfer += this->success[_i591].read(iprot); } xfer += iprot->readListEnd(); } @@ -16554,10 +16780,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); - std::vector ::const_iterator _iter585; - for (_iter585 = this->success.begin(); _iter585 != this->success.end(); ++_iter585) + std::vector ::const_iterator _iter592; + for (_iter592 = this->success.begin(); _iter592 != this->success.end(); ++_iter592) { - xfer += (*_iter585).write(oprot); + xfer += (*_iter592).write(oprot); } xfer += oprot->writeListEnd(); } @@ -16596,14 +16822,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size586; - ::apache::thrift::protocol::TType _etype589; - xfer += iprot->readListBegin(_etype589, _size586); - (*(this->success)).resize(_size586); - uint32_t _i590; - for (_i590 = 0; _i590 < _size586; ++_i590) + uint32_t _size593; + ::apache::thrift::protocol::TType _etype596; + xfer += iprot->readListBegin(_etype596, _size593); + (*(this->success)).resize(_size593); + uint32_t _i597; + for (_i597 = 0; _i597 < _size593; ++_i597) { - xfer += (*(this->success))[_i590].read(iprot); + xfer += (*(this->success))[_i597].read(iprot); } xfer += iprot->readListEnd(); } @@ -16672,14 +16898,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->group_names.clear(); - uint32_t _size591; - ::apache::thrift::protocol::TType _etype594; - xfer += iprot->readListBegin(_etype594, _size591); - this->group_names.resize(_size591); - uint32_t _i595; - for (_i595 = 0; _i595 < _size591; ++_i595) + uint32_t _size598; + ::apache::thrift::protocol::TType _etype601; + xfer += iprot->readListBegin(_etype601, _size598); + this->group_names.resize(_size598); + uint32_t _i602; + for (_i602 = 0; _i602 < _size598; ++_i602) { - xfer += iprot->readString(this->group_names[_i595]); + xfer += iprot->readString(this->group_names[_i602]); } xfer += iprot->readListEnd(); } @@ -16715,10 +16941,10 @@ xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->group_names.size())); - std::vector ::const_iterator _iter596; - for (_iter596 = this->group_names.begin(); _iter596 != this->group_names.end(); ++_iter596) + std::vector ::const_iterator _iter603; + for (_iter603 = this->group_names.begin(); _iter603 != this->group_names.end(); ++_iter603) { - xfer += oprot->writeString((*_iter596)); + xfer += oprot->writeString((*_iter603)); } xfer += oprot->writeListEnd(); } @@ -16744,10 +16970,10 @@ xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->group_names)).size())); - std::vector ::const_iterator _iter597; - for (_iter597 = (*(this->group_names)).begin(); _iter597 != (*(this->group_names)).end(); ++_iter597) + std::vector ::const_iterator _iter604; + for (_iter604 = (*(this->group_names)).begin(); _iter604 != (*(this->group_names)).end(); ++_iter604) { - xfer += oprot->writeString((*_iter597)); + xfer += oprot->writeString((*_iter604)); } xfer += oprot->writeListEnd(); } @@ -16904,9 +17130,9 @@ break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast598; - xfer += iprot->readI32(ecast598); - this->principal_type = (PrincipalType::type)ecast598; + int32_t ecast605; + xfer += iprot->readI32(ecast605); + this->principal_type = (PrincipalType::type)ecast605; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -16998,14 +17224,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size599; - ::apache::thrift::protocol::TType _etype602; - xfer += iprot->readListBegin(_etype602, _size599); - this->success.resize(_size599); - uint32_t _i603; - for (_i603 = 0; _i603 < _size599; ++_i603) + uint32_t _size606; + ::apache::thrift::protocol::TType _etype609; + xfer += iprot->readListBegin(_etype609, _size606); + this->success.resize(_size606); + uint32_t _i610; + for (_i610 = 0; _i610 < _size606; ++_i610) { - xfer += this->success[_i603].read(iprot); + xfer += this->success[_i610].read(iprot); } xfer += iprot->readListEnd(); } @@ -17044,10 +17270,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); - std::vector ::const_iterator _iter604; - for (_iter604 = this->success.begin(); _iter604 != this->success.end(); ++_iter604) + std::vector ::const_iterator _iter611; + for (_iter611 = this->success.begin(); _iter611 != this->success.end(); ++_iter611) { - xfer += (*_iter604).write(oprot); + xfer += (*_iter611).write(oprot); } xfer += oprot->writeListEnd(); } @@ -17086,14 +17312,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size605; - ::apache::thrift::protocol::TType _etype608; - xfer += iprot->readListBegin(_etype608, _size605); - (*(this->success)).resize(_size605); - uint32_t _i609; - for (_i609 = 0; _i609 < _size605; ++_i609) + uint32_t _size612; + ::apache::thrift::protocol::TType _etype615; + xfer += iprot->readListBegin(_etype615, _size612); + (*(this->success)).resize(_size612); + uint32_t _i616; + for (_i616 = 0; _i616 < _size612; ++_i616) { - xfer += (*(this->success))[_i609].read(iprot); + xfer += (*(this->success))[_i616].read(iprot); } xfer += iprot->readListEnd(); } @@ -17518,14 +17744,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->group_names.clear(); - uint32_t _size610; - ::apache::thrift::protocol::TType _etype613; - xfer += iprot->readListBegin(_etype613, _size610); - this->group_names.resize(_size610); - uint32_t _i614; - for (_i614 = 0; _i614 < _size610; ++_i614) + uint32_t _size617; + ::apache::thrift::protocol::TType _etype620; + xfer += iprot->readListBegin(_etype620, _size617); + this->group_names.resize(_size617); + uint32_t _i621; + for (_i621 = 0; _i621 < _size617; ++_i621) { - xfer += iprot->readString(this->group_names[_i614]); + xfer += iprot->readString(this->group_names[_i621]); } xfer += iprot->readListEnd(); } @@ -17557,10 +17783,10 @@ xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 2); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->group_names.size())); - std::vector ::const_iterator _iter615; - for (_iter615 = this->group_names.begin(); _iter615 != this->group_names.end(); ++_iter615) + std::vector ::const_iterator _iter622; + for (_iter622 = this->group_names.begin(); _iter622 != this->group_names.end(); ++_iter622) { - xfer += oprot->writeString((*_iter615)); + xfer += oprot->writeString((*_iter622)); } xfer += oprot->writeListEnd(); } @@ -17582,10 +17808,10 @@ xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 2); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->group_names)).size())); - std::vector ::const_iterator _iter616; - for (_iter616 = (*(this->group_names)).begin(); _iter616 != (*(this->group_names)).end(); ++_iter616) + std::vector ::const_iterator _iter623; + for (_iter623 = (*(this->group_names)).begin(); _iter623 != (*(this->group_names)).end(); ++_iter623) { - xfer += oprot->writeString((*_iter616)); + xfer += oprot->writeString((*_iter623)); } xfer += oprot->writeListEnd(); } @@ -17620,14 +17846,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size617; - ::apache::thrift::protocol::TType _etype620; - xfer += iprot->readListBegin(_etype620, _size617); - this->success.resize(_size617); - uint32_t _i621; - for (_i621 = 0; _i621 < _size617; ++_i621) + uint32_t _size624; + ::apache::thrift::protocol::TType _etype627; + xfer += iprot->readListBegin(_etype627, _size624); + this->success.resize(_size624); + uint32_t _i628; + for (_i628 = 0; _i628 < _size624; ++_i628) { - xfer += iprot->readString(this->success[_i621]); + xfer += iprot->readString(this->success[_i628]); } xfer += iprot->readListEnd(); } @@ -17666,10 +17892,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); - std::vector ::const_iterator _iter622; - for (_iter622 = this->success.begin(); _iter622 != this->success.end(); ++_iter622) + std::vector ::const_iterator _iter629; + for (_iter629 = this->success.begin(); _iter629 != this->success.end(); ++_iter629) { - xfer += oprot->writeString((*_iter622)); + xfer += oprot->writeString((*_iter629)); } xfer += oprot->writeListEnd(); } @@ -17708,14 +17934,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size623; - ::apache::thrift::protocol::TType _etype626; - xfer += iprot->readListBegin(_etype626, _size623); - (*(this->success)).resize(_size623); - uint32_t _i627; - for (_i627 = 0; _i627 < _size623; ++_i627) + uint32_t _size630; + ::apache::thrift::protocol::TType _etype633; + xfer += iprot->readListBegin(_etype633, _size630); + (*(this->success)).resize(_size630); + uint32_t _i634; + for (_i634 = 0; _i634 < _size630; ++_i634) { - xfer += iprot->readString((*(this->success))[_i627]); + xfer += iprot->readString((*(this->success))[_i634]); } xfer += iprot->readListEnd(); } @@ -21142,6 +21368,68 @@ return; } +bool ThriftHiveMetastoreClient::partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception) +{ + send_partition_name_has_valid_characters(part_vals, throw_exception); + return recv_partition_name_has_valid_characters(); +} + +void ThriftHiveMetastoreClient::send_partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("partition_name_has_valid_characters", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_partition_name_has_valid_characters_pargs args; + args.part_vals = &part_vals; + args.throw_exception = &throw_exception; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_partition_name_has_valid_characters() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("partition_name_has_valid_characters") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_partition_name_has_valid_characters_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "partition_name_has_valid_characters failed: unknown result"); +} + void ThriftHiveMetastoreClient::get_config_value(std::string& _return, const std::string& name, const std::string& defaultValue) { send_get_config_value(name, defaultValue); @@ -25831,6 +26119,63 @@ } } +void ThriftHiveMetastoreProcessor::process_partition_name_has_valid_characters(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.partition_name_has_valid_characters", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.partition_name_has_valid_characters"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.partition_name_has_valid_characters"); + } + + ThriftHiveMetastore_partition_name_has_valid_characters_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.partition_name_has_valid_characters", bytes); + } + + ThriftHiveMetastore_partition_name_has_valid_characters_result result; + try { + result.success = iface_->partition_name_has_valid_characters(args.part_vals, args.throw_exception); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = o1; + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.partition_name_has_valid_characters"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("partition_name_has_valid_characters", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.partition_name_has_valid_characters"); + } + + oprot->writeMessageBegin("partition_name_has_valid_characters", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.partition_name_has_valid_characters", bytes); + } +} + void ThriftHiveMetastoreProcessor::process_get_config_value(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { void* ctx = NULL; Index: metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h =================================================================== --- metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h (revision 1440777) +++ metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h (working copy) @@ -60,6 +60,7 @@ virtual void alter_partitions(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts) = 0; virtual void alter_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const Partition& new_part, const EnvironmentContext& environment_context) = 0; virtual void rename_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const Partition& new_part) = 0; + virtual bool partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception) = 0; virtual void get_config_value(std::string& _return, const std::string& name, const std::string& defaultValue) = 0; virtual void partition_name_to_vals(std::vector & _return, const std::string& part_name) = 0; virtual void partition_name_to_spec(std::map & _return, const std::string& part_name) = 0; @@ -257,6 +258,10 @@ void rename_partition(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::vector & /* part_vals */, const Partition& /* new_part */) { return; } + bool partition_name_has_valid_characters(const std::vector & /* part_vals */, const bool /* throw_exception */) { + bool _return = false; + return _return; + } void get_config_value(std::string& /* _return */, const std::string& /* name */, const std::string& /* defaultValue */) { return; } @@ -6602,6 +6607,133 @@ }; +typedef struct _ThriftHiveMetastore_partition_name_has_valid_characters_args__isset { + _ThriftHiveMetastore_partition_name_has_valid_characters_args__isset() : part_vals(false), throw_exception(false) {} + bool part_vals; + bool throw_exception; +} _ThriftHiveMetastore_partition_name_has_valid_characters_args__isset; + +class ThriftHiveMetastore_partition_name_has_valid_characters_args { + public: + + ThriftHiveMetastore_partition_name_has_valid_characters_args() : throw_exception(0) { + } + + virtual ~ThriftHiveMetastore_partition_name_has_valid_characters_args() throw() {} + + std::vector part_vals; + bool throw_exception; + + _ThriftHiveMetastore_partition_name_has_valid_characters_args__isset __isset; + + void __set_part_vals(const std::vector & val) { + part_vals = val; + } + + void __set_throw_exception(const bool val) { + throw_exception = val; + } + + bool operator == (const ThriftHiveMetastore_partition_name_has_valid_characters_args & rhs) const + { + if (!(part_vals == rhs.part_vals)) + return false; + if (!(throw_exception == rhs.throw_exception)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_partition_name_has_valid_characters_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_partition_name_has_valid_characters_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_partition_name_has_valid_characters_pargs { + public: + + + virtual ~ThriftHiveMetastore_partition_name_has_valid_characters_pargs() throw() {} + + const std::vector * part_vals; + const bool* throw_exception; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_partition_name_has_valid_characters_result__isset { + _ThriftHiveMetastore_partition_name_has_valid_characters_result__isset() : success(false), o1(false) {} + bool success; + bool o1; +} _ThriftHiveMetastore_partition_name_has_valid_characters_result__isset; + +class ThriftHiveMetastore_partition_name_has_valid_characters_result { + public: + + ThriftHiveMetastore_partition_name_has_valid_characters_result() : success(0) { + } + + virtual ~ThriftHiveMetastore_partition_name_has_valid_characters_result() throw() {} + + bool success; + MetaException o1; + + _ThriftHiveMetastore_partition_name_has_valid_characters_result__isset __isset; + + void __set_success(const bool val) { + success = val; + } + + void __set_o1(const MetaException& val) { + o1 = val; + } + + bool operator == (const ThriftHiveMetastore_partition_name_has_valid_characters_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(o1 == rhs.o1)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_partition_name_has_valid_characters_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_partition_name_has_valid_characters_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_partition_name_has_valid_characters_presult__isset { + _ThriftHiveMetastore_partition_name_has_valid_characters_presult__isset() : success(false), o1(false) {} + bool success; + bool o1; +} _ThriftHiveMetastore_partition_name_has_valid_characters_presult__isset; + +class ThriftHiveMetastore_partition_name_has_valid_characters_presult { + public: + + + virtual ~ThriftHiveMetastore_partition_name_has_valid_characters_presult() throw() {} + + bool* success; + MetaException o1; + + _ThriftHiveMetastore_partition_name_has_valid_characters_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + typedef struct _ThriftHiveMetastore_get_config_value_args__isset { _ThriftHiveMetastore_get_config_value_args__isset() : name(false), defaultValue(false) {} bool name; @@ -11096,6 +11228,9 @@ void rename_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const Partition& new_part); void send_rename_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const Partition& new_part); void recv_rename_partition(); + bool partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception); + void send_partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception); + bool recv_partition_name_has_valid_characters(); void get_config_value(std::string& _return, const std::string& name, const std::string& defaultValue); void send_get_config_value(const std::string& name, const std::string& defaultValue); void recv_get_config_value(std::string& _return); @@ -11243,6 +11378,7 @@ void process_alter_partitions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_alter_partition_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_rename_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_partition_name_has_valid_characters(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_get_config_value(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_partition_name_to_vals(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_partition_name_to_spec(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); @@ -11322,6 +11458,7 @@ processMap_["alter_partitions"] = &ThriftHiveMetastoreProcessor::process_alter_partitions; processMap_["alter_partition_with_environment_context"] = &ThriftHiveMetastoreProcessor::process_alter_partition_with_environment_context; processMap_["rename_partition"] = &ThriftHiveMetastoreProcessor::process_rename_partition; + processMap_["partition_name_has_valid_characters"] = &ThriftHiveMetastoreProcessor::process_partition_name_has_valid_characters; processMap_["get_config_value"] = &ThriftHiveMetastoreProcessor::process_get_config_value; processMap_["partition_name_to_vals"] = &ThriftHiveMetastoreProcessor::process_partition_name_to_vals; processMap_["partition_name_to_spec"] = &ThriftHiveMetastoreProcessor::process_partition_name_to_spec; @@ -11809,6 +11946,15 @@ ifaces_[i]->rename_partition(db_name, tbl_name, part_vals, new_part); } + bool partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->partition_name_has_valid_characters(part_vals, throw_exception); + } + return ifaces_[i]->partition_name_has_valid_characters(part_vals, throw_exception); + } + void get_config_value(std::string& _return, const std::string& name, const std::string& defaultValue) { size_t sz = ifaces_.size(); size_t i = 0; Index: metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp =================================================================== --- metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp (revision 1440777) +++ metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp (working copy) @@ -242,6 +242,11 @@ printf("rename_partition\n"); } + bool partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception) { + // Your implementation goes here + printf("partition_name_has_valid_characters\n"); + } + void get_config_value(std::string& _return, const std::string& name, const std::string& defaultValue) { // Your implementation goes here printf("get_config_value\n"); Index: metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java =================================================================== --- metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java (revision 1440777) +++ metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java (working copy) @@ -126,6 +126,8 @@ public void rename_partition(String db_name, String tbl_name, List part_vals, Partition new_part) throws InvalidOperationException, MetaException, org.apache.thrift.TException; + public boolean partition_name_has_valid_characters(List part_vals, boolean throw_exception) throws MetaException, org.apache.thrift.TException; + public String get_config_value(String name, String defaultValue) throws ConfigValSecurityException, org.apache.thrift.TException; public List partition_name_to_vals(String part_name) throws MetaException, org.apache.thrift.TException; @@ -280,6 +282,8 @@ public void rename_partition(String db_name, String tbl_name, List part_vals, Partition new_part, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void partition_name_has_valid_characters(List part_vals, boolean throw_exception, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void get_config_value(String name, String defaultValue, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void partition_name_to_vals(String part_name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -1704,6 +1708,33 @@ return; } + public boolean partition_name_has_valid_characters(List part_vals, boolean throw_exception) throws MetaException, org.apache.thrift.TException + { + send_partition_name_has_valid_characters(part_vals, throw_exception); + return recv_partition_name_has_valid_characters(); + } + + public void send_partition_name_has_valid_characters(List part_vals, boolean throw_exception) throws org.apache.thrift.TException + { + partition_name_has_valid_characters_args args = new partition_name_has_valid_characters_args(); + args.setPart_vals(part_vals); + args.setThrow_exception(throw_exception); + sendBase("partition_name_has_valid_characters", args); + } + + public boolean recv_partition_name_has_valid_characters() throws MetaException, org.apache.thrift.TException + { + partition_name_has_valid_characters_result result = new partition_name_has_valid_characters_result(); + receiveBase(result, "partition_name_has_valid_characters"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "partition_name_has_valid_characters failed: unknown result"); + } + public String get_config_value(String name, String defaultValue) throws ConfigValSecurityException, org.apache.thrift.TException { send_get_config_value(name, defaultValue); @@ -4282,6 +4313,41 @@ } } + public void partition_name_has_valid_characters(List part_vals, boolean throw_exception, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + partition_name_has_valid_characters_call method_call = new partition_name_has_valid_characters_call(part_vals, throw_exception, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class partition_name_has_valid_characters_call extends org.apache.thrift.async.TAsyncMethodCall { + private List part_vals; + private boolean throw_exception; + public partition_name_has_valid_characters_call(List part_vals, boolean throw_exception, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.part_vals = part_vals; + this.throw_exception = throw_exception; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("partition_name_has_valid_characters", org.apache.thrift.protocol.TMessageType.CALL, 0)); + partition_name_has_valid_characters_args args = new partition_name_has_valid_characters_args(); + args.setPart_vals(part_vals); + args.setThrow_exception(throw_exception); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws MetaException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_partition_name_has_valid_characters(); + } + } + public void get_config_value(String name, String defaultValue, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); get_config_value_call method_call = new get_config_value_call(name, defaultValue, resultHandler, this, ___protocolFactory, ___transport); @@ -5460,6 +5526,7 @@ processMap.put("alter_partitions", new alter_partitions()); processMap.put("alter_partition_with_environment_context", new alter_partition_with_environment_context()); processMap.put("rename_partition", new rename_partition()); + processMap.put("partition_name_has_valid_characters", new partition_name_has_valid_characters()); processMap.put("get_config_value", new get_config_value()); processMap.put("partition_name_to_vals", new partition_name_to_vals()); processMap.put("partition_name_to_spec", new partition_name_to_spec()); @@ -6663,6 +6730,31 @@ } } + public static class partition_name_has_valid_characters extends org.apache.thrift.ProcessFunction { + public partition_name_has_valid_characters() { + super("partition_name_has_valid_characters"); + } + + public partition_name_has_valid_characters_args getEmptyArgsInstance() { + return new partition_name_has_valid_characters_args(); + } + + protected boolean isOneway() { + return false; + } + + public partition_name_has_valid_characters_result getResult(I iface, partition_name_has_valid_characters_args args) throws org.apache.thrift.TException { + partition_name_has_valid_characters_result result = new partition_name_has_valid_characters_result(); + try { + result.success = iface.partition_name_has_valid_characters(args.part_vals, args.throw_exception); + result.setSuccessIsSet(true); + } catch (MetaException o1) { + result.o1 = o1; + } + return result; + } + } + public static class get_config_value extends org.apache.thrift.ProcessFunction { public get_config_value() { super("get_config_value"); @@ -57221,6 +57313,982 @@ } + public static class partition_name_has_valid_characters_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("partition_name_has_valid_characters_args"); + + private static final org.apache.thrift.protocol.TField PART_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("part_vals", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField THROW_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("throw_exception", org.apache.thrift.protocol.TType.BOOL, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new partition_name_has_valid_characters_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new partition_name_has_valid_characters_argsTupleSchemeFactory()); + } + + private List part_vals; // required + private boolean throw_exception; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + PART_VALS((short)1, "part_vals"), + THROW_EXCEPTION((short)2, "throw_exception"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // PART_VALS + return PART_VALS; + case 2: // THROW_EXCEPTION + return THROW_EXCEPTION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __THROW_EXCEPTION_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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); + tmpMap.put(_Fields.PART_VALS, new org.apache.thrift.meta_data.FieldMetaData("part_vals", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.THROW_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("throw_exception", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(partition_name_has_valid_characters_args.class, metaDataMap); + } + + public partition_name_has_valid_characters_args() { + } + + public partition_name_has_valid_characters_args( + List part_vals, + boolean throw_exception) + { + this(); + this.part_vals = part_vals; + this.throw_exception = throw_exception; + setThrow_exceptionIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public partition_name_has_valid_characters_args(partition_name_has_valid_characters_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetPart_vals()) { + List __this__part_vals = new ArrayList(); + for (String other_element : other.part_vals) { + __this__part_vals.add(other_element); + } + this.part_vals = __this__part_vals; + } + this.throw_exception = other.throw_exception; + } + + public partition_name_has_valid_characters_args deepCopy() { + return new partition_name_has_valid_characters_args(this); + } + + @Override + public void clear() { + this.part_vals = null; + setThrow_exceptionIsSet(false); + this.throw_exception = false; + } + + public int getPart_valsSize() { + return (this.part_vals == null) ? 0 : this.part_vals.size(); + } + + public java.util.Iterator getPart_valsIterator() { + return (this.part_vals == null) ? null : this.part_vals.iterator(); + } + + public void addToPart_vals(String elem) { + if (this.part_vals == null) { + this.part_vals = new ArrayList(); + } + this.part_vals.add(elem); + } + + public List getPart_vals() { + return this.part_vals; + } + + public void setPart_vals(List part_vals) { + this.part_vals = part_vals; + } + + public void unsetPart_vals() { + this.part_vals = null; + } + + /** Returns true if field part_vals is set (has been assigned a value) and false otherwise */ + public boolean isSetPart_vals() { + return this.part_vals != null; + } + + public void setPart_valsIsSet(boolean value) { + if (!value) { + this.part_vals = null; + } + } + + public boolean isThrow_exception() { + return this.throw_exception; + } + + public void setThrow_exception(boolean throw_exception) { + this.throw_exception = throw_exception; + setThrow_exceptionIsSet(true); + } + + public void unsetThrow_exception() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __THROW_EXCEPTION_ISSET_ID); + } + + /** Returns true if field throw_exception is set (has been assigned a value) and false otherwise */ + public boolean isSetThrow_exception() { + return EncodingUtils.testBit(__isset_bitfield, __THROW_EXCEPTION_ISSET_ID); + } + + public void setThrow_exceptionIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __THROW_EXCEPTION_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case PART_VALS: + if (value == null) { + unsetPart_vals(); + } else { + setPart_vals((List)value); + } + break; + + case THROW_EXCEPTION: + if (value == null) { + unsetThrow_exception(); + } else { + setThrow_exception((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case PART_VALS: + return getPart_vals(); + + case THROW_EXCEPTION: + return Boolean.valueOf(isThrow_exception()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case PART_VALS: + return isSetPart_vals(); + case THROW_EXCEPTION: + return isSetThrow_exception(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof partition_name_has_valid_characters_args) + return this.equals((partition_name_has_valid_characters_args)that); + return false; + } + + public boolean equals(partition_name_has_valid_characters_args that) { + if (that == null) + return false; + + boolean this_present_part_vals = true && this.isSetPart_vals(); + boolean that_present_part_vals = true && that.isSetPart_vals(); + if (this_present_part_vals || that_present_part_vals) { + if (!(this_present_part_vals && that_present_part_vals)) + return false; + if (!this.part_vals.equals(that.part_vals)) + return false; + } + + boolean this_present_throw_exception = true; + boolean that_present_throw_exception = true; + if (this_present_throw_exception || that_present_throw_exception) { + if (!(this_present_throw_exception && that_present_throw_exception)) + return false; + if (this.throw_exception != that.throw_exception) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_part_vals = true && (isSetPart_vals()); + builder.append(present_part_vals); + if (present_part_vals) + builder.append(part_vals); + + boolean present_throw_exception = true; + builder.append(present_throw_exception); + if (present_throw_exception) + builder.append(throw_exception); + + return builder.toHashCode(); + } + + public int compareTo(partition_name_has_valid_characters_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + partition_name_has_valid_characters_args typedOther = (partition_name_has_valid_characters_args)other; + + lastComparison = Boolean.valueOf(isSetPart_vals()).compareTo(typedOther.isSetPart_vals()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPart_vals()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.part_vals, typedOther.part_vals); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetThrow_exception()).compareTo(typedOther.isSetThrow_exception()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetThrow_exception()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.throw_exception, typedOther.throw_exception); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("partition_name_has_valid_characters_args("); + boolean first = true; + + sb.append("part_vals:"); + if (this.part_vals == null) { + sb.append("null"); + } else { + sb.append(this.part_vals); + } + first = false; + if (!first) sb.append(", "); + sb.append("throw_exception:"); + sb.append(this.throw_exception); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + } + } + + private static class partition_name_has_valid_characters_argsStandardSchemeFactory implements SchemeFactory { + public partition_name_has_valid_characters_argsStandardScheme getScheme() { + return new partition_name_has_valid_characters_argsStandardScheme(); + } + } + + private static class partition_name_has_valid_characters_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, partition_name_has_valid_characters_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PART_VALS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list514 = iprot.readListBegin(); + struct.part_vals = new ArrayList(_list514.size); + for (int _i515 = 0; _i515 < _list514.size; ++_i515) + { + String _elem516; // required + _elem516 = iprot.readString(); + struct.part_vals.add(_elem516); + } + iprot.readListEnd(); + } + struct.setPart_valsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // THROW_EXCEPTION + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.throw_exception = iprot.readBool(); + struct.setThrow_exceptionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, partition_name_has_valid_characters_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.part_vals != null) { + oprot.writeFieldBegin(PART_VALS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.part_vals.size())); + for (String _iter517 : struct.part_vals) + { + oprot.writeString(_iter517); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(THROW_EXCEPTION_FIELD_DESC); + oprot.writeBool(struct.throw_exception); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class partition_name_has_valid_characters_argsTupleSchemeFactory implements SchemeFactory { + public partition_name_has_valid_characters_argsTupleScheme getScheme() { + return new partition_name_has_valid_characters_argsTupleScheme(); + } + } + + private static class partition_name_has_valid_characters_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, partition_name_has_valid_characters_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetPart_vals()) { + optionals.set(0); + } + if (struct.isSetThrow_exception()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetPart_vals()) { + { + oprot.writeI32(struct.part_vals.size()); + for (String _iter518 : struct.part_vals) + { + oprot.writeString(_iter518); + } + } + } + if (struct.isSetThrow_exception()) { + oprot.writeBool(struct.throw_exception); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, partition_name_has_valid_characters_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list519 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.part_vals = new ArrayList(_list519.size); + for (int _i520 = 0; _i520 < _list519.size; ++_i520) + { + String _elem521; // required + _elem521 = iprot.readString(); + struct.part_vals.add(_elem521); + } + } + struct.setPart_valsIsSet(true); + } + if (incoming.get(1)) { + struct.throw_exception = iprot.readBool(); + struct.setThrow_exceptionIsSet(true); + } + } + } + + } + + public static class partition_name_has_valid_characters_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("partition_name_has_valid_characters_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + private static final org.apache.thrift.protocol.TField O1_FIELD_DESC = new org.apache.thrift.protocol.TField("o1", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new partition_name_has_valid_characters_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new partition_name_has_valid_characters_resultTupleSchemeFactory()); + } + + private boolean success; // required + private MetaException o1; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"), + O1((short)1, "o1"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // O1 + return O1; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.O1, new org.apache.thrift.meta_data.FieldMetaData("o1", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(partition_name_has_valid_characters_result.class, metaDataMap); + } + + public partition_name_has_valid_characters_result() { + } + + public partition_name_has_valid_characters_result( + boolean success, + MetaException o1) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.o1 = o1; + } + + /** + * Performs a deep copy on other. + */ + public partition_name_has_valid_characters_result(partition_name_has_valid_characters_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + } + + public partition_name_has_valid_characters_result deepCopy() { + return new partition_name_has_valid_characters_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + this.o1 = null; + } + + public boolean isSuccess() { + return this.success; + } + + public void setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + /** Returns true if field o1 is set (has been assigned a value) and false otherwise */ + public boolean isSetO1() { + return this.o1 != null; + } + + public void setO1IsSet(boolean value) { + if (!value) { + this.o1 = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + case O1: + return getO1(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof partition_name_has_valid_characters_result) + return this.equals((partition_name_has_valid_characters_result)that); + return false; + } + + public boolean equals(partition_name_has_valid_characters_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_success = true; + builder.append(present_success); + if (present_success) + builder.append(success); + + boolean present_o1 = true && (isSetO1()); + builder.append(present_o1); + if (present_o1) + builder.append(o1); + + return builder.toHashCode(); + } + + public int compareTo(partition_name_has_valid_characters_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + partition_name_has_valid_characters_result typedOther = (partition_name_has_valid_characters_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO1()).compareTo(typedOther.isSetO1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO1()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.o1, typedOther.o1); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("partition_name_has_valid_characters_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + } + } + + private static class partition_name_has_valid_characters_resultStandardSchemeFactory implements SchemeFactory { + public partition_name_has_valid_characters_resultStandardScheme getScheme() { + return new partition_name_has_valid_characters_resultStandardScheme(); + } + } + + private static class partition_name_has_valid_characters_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, partition_name_has_valid_characters_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // O1 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.o1 = new MetaException(); + struct.o1.read(iprot); + struct.setO1IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, partition_name_has_valid_characters_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + if (struct.o1 != null) { + oprot.writeFieldBegin(O1_FIELD_DESC); + struct.o1.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class partition_name_has_valid_characters_resultTupleSchemeFactory implements SchemeFactory { + public partition_name_has_valid_characters_resultTupleScheme getScheme() { + return new partition_name_has_valid_characters_resultTupleScheme(); + } + } + + private static class partition_name_has_valid_characters_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, partition_name_has_valid_characters_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetO1()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + if (struct.isSetO1()) { + struct.o1.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, partition_name_has_valid_characters_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.o1 = new MetaException(); + struct.o1.read(iprot); + struct.setO1IsSet(true); + } + } + } + + } + public static class get_config_value_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("get_config_value_args"); @@ -58901,13 +59969,13 @@ case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list514 = iprot.readListBegin(); - struct.success = new ArrayList(_list514.size); - for (int _i515 = 0; _i515 < _list514.size; ++_i515) + org.apache.thrift.protocol.TList _list522 = iprot.readListBegin(); + struct.success = new ArrayList(_list522.size); + for (int _i523 = 0; _i523 < _list522.size; ++_i523) { - String _elem516; // required - _elem516 = iprot.readString(); - struct.success.add(_elem516); + String _elem524; // required + _elem524 = iprot.readString(); + struct.success.add(_elem524); } iprot.readListEnd(); } @@ -58942,9 +60010,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); - for (String _iter517 : struct.success) + for (String _iter525 : struct.success) { - oprot.writeString(_iter517); + oprot.writeString(_iter525); } oprot.writeListEnd(); } @@ -58983,9 +60051,9 @@ if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (String _iter518 : struct.success) + for (String _iter526 : struct.success) { - oprot.writeString(_iter518); + oprot.writeString(_iter526); } } } @@ -59000,13 +60068,13 @@ BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list519 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.success = new ArrayList(_list519.size); - for (int _i520 = 0; _i520 < _list519.size; ++_i520) + org.apache.thrift.protocol.TList _list527 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new ArrayList(_list527.size); + for (int _i528 = 0; _i528 < _list527.size; ++_i528) { - String _elem521; // required - _elem521 = iprot.readString(); - struct.success.add(_elem521); + String _elem529; // required + _elem529 = iprot.readString(); + struct.success.add(_elem529); } } struct.setSuccessIsSet(true); @@ -59780,15 +60848,15 @@ case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map522 = iprot.readMapBegin(); - struct.success = new HashMap(2*_map522.size); - for (int _i523 = 0; _i523 < _map522.size; ++_i523) + org.apache.thrift.protocol.TMap _map530 = iprot.readMapBegin(); + struct.success = new HashMap(2*_map530.size); + for (int _i531 = 0; _i531 < _map530.size; ++_i531) { - String _key524; // required - String _val525; // optional - _key524 = iprot.readString(); - _val525 = iprot.readString(); - struct.success.put(_key524, _val525); + String _key532; // required + String _val533; // optional + _key532 = iprot.readString(); + _val533 = iprot.readString(); + struct.success.put(_key532, _val533); } iprot.readMapEnd(); } @@ -59823,10 +60891,10 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size())); - for (Map.Entry _iter526 : struct.success.entrySet()) + for (Map.Entry _iter534 : struct.success.entrySet()) { - oprot.writeString(_iter526.getKey()); - oprot.writeString(_iter526.getValue()); + oprot.writeString(_iter534.getKey()); + oprot.writeString(_iter534.getValue()); } oprot.writeMapEnd(); } @@ -59865,10 +60933,10 @@ if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (Map.Entry _iter527 : struct.success.entrySet()) + for (Map.Entry _iter535 : struct.success.entrySet()) { - oprot.writeString(_iter527.getKey()); - oprot.writeString(_iter527.getValue()); + oprot.writeString(_iter535.getKey()); + oprot.writeString(_iter535.getValue()); } } } @@ -59883,15 +60951,15 @@ BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map528 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.success = new HashMap(2*_map528.size); - for (int _i529 = 0; _i529 < _map528.size; ++_i529) + org.apache.thrift.protocol.TMap _map536 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new HashMap(2*_map536.size); + for (int _i537 = 0; _i537 < _map536.size; ++_i537) { - String _key530; // required - String _val531; // optional - _key530 = iprot.readString(); - _val531 = iprot.readString(); - struct.success.put(_key530, _val531); + String _key538; // required + String _val539; // optional + _key538 = iprot.readString(); + _val539 = iprot.readString(); + struct.success.put(_key538, _val539); } } struct.setSuccessIsSet(true); @@ -60497,15 +61565,15 @@ case 3: // PART_VALS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map532 = iprot.readMapBegin(); - struct.part_vals = new HashMap(2*_map532.size); - for (int _i533 = 0; _i533 < _map532.size; ++_i533) + org.apache.thrift.protocol.TMap _map540 = iprot.readMapBegin(); + struct.part_vals = new HashMap(2*_map540.size); + for (int _i541 = 0; _i541 < _map540.size; ++_i541) { - String _key534; // required - String _val535; // optional - _key534 = iprot.readString(); - _val535 = iprot.readString(); - struct.part_vals.put(_key534, _val535); + String _key542; // required + String _val543; // optional + _key542 = iprot.readString(); + _val543 = iprot.readString(); + struct.part_vals.put(_key542, _val543); } iprot.readMapEnd(); } @@ -60549,10 +61617,10 @@ oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.part_vals.size())); - for (Map.Entry _iter536 : struct.part_vals.entrySet()) + for (Map.Entry _iter544 : struct.part_vals.entrySet()) { - oprot.writeString(_iter536.getKey()); - oprot.writeString(_iter536.getValue()); + oprot.writeString(_iter544.getKey()); + oprot.writeString(_iter544.getValue()); } oprot.writeMapEnd(); } @@ -60603,10 +61671,10 @@ if (struct.isSetPart_vals()) { { oprot.writeI32(struct.part_vals.size()); - for (Map.Entry _iter537 : struct.part_vals.entrySet()) + for (Map.Entry _iter545 : struct.part_vals.entrySet()) { - oprot.writeString(_iter537.getKey()); - oprot.writeString(_iter537.getValue()); + oprot.writeString(_iter545.getKey()); + oprot.writeString(_iter545.getValue()); } } } @@ -60629,15 +61697,15 @@ } if (incoming.get(2)) { { - org.apache.thrift.protocol.TMap _map538 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.part_vals = new HashMap(2*_map538.size); - for (int _i539 = 0; _i539 < _map538.size; ++_i539) + org.apache.thrift.protocol.TMap _map546 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.part_vals = new HashMap(2*_map546.size); + for (int _i547 = 0; _i547 < _map546.size; ++_i547) { - String _key540; // required - String _val541; // optional - _key540 = iprot.readString(); - _val541 = iprot.readString(); - struct.part_vals.put(_key540, _val541); + String _key548; // required + String _val549; // optional + _key548 = iprot.readString(); + _val549 = iprot.readString(); + struct.part_vals.put(_key548, _val549); } } struct.setPart_valsIsSet(true); @@ -62132,15 +63200,15 @@ case 3: // PART_VALS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map542 = iprot.readMapBegin(); - struct.part_vals = new HashMap(2*_map542.size); - for (int _i543 = 0; _i543 < _map542.size; ++_i543) + org.apache.thrift.protocol.TMap _map550 = iprot.readMapBegin(); + struct.part_vals = new HashMap(2*_map550.size); + for (int _i551 = 0; _i551 < _map550.size; ++_i551) { - String _key544; // required - String _val545; // optional - _key544 = iprot.readString(); - _val545 = iprot.readString(); - struct.part_vals.put(_key544, _val545); + String _key552; // required + String _val553; // optional + _key552 = iprot.readString(); + _val553 = iprot.readString(); + struct.part_vals.put(_key552, _val553); } iprot.readMapEnd(); } @@ -62184,10 +63252,10 @@ oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.part_vals.size())); - for (Map.Entry _iter546 : struct.part_vals.entrySet()) + for (Map.Entry _iter554 : struct.part_vals.entrySet()) { - oprot.writeString(_iter546.getKey()); - oprot.writeString(_iter546.getValue()); + oprot.writeString(_iter554.getKey()); + oprot.writeString(_iter554.getValue()); } oprot.writeMapEnd(); } @@ -62238,10 +63306,10 @@ if (struct.isSetPart_vals()) { { oprot.writeI32(struct.part_vals.size()); - for (Map.Entry _iter547 : struct.part_vals.entrySet()) + for (Map.Entry _iter555 : struct.part_vals.entrySet()) { - oprot.writeString(_iter547.getKey()); - oprot.writeString(_iter547.getValue()); + oprot.writeString(_iter555.getKey()); + oprot.writeString(_iter555.getValue()); } } } @@ -62264,15 +63332,15 @@ } if (incoming.get(2)) { { - org.apache.thrift.protocol.TMap _map548 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.part_vals = new HashMap(2*_map548.size); - for (int _i549 = 0; _i549 < _map548.size; ++_i549) + org.apache.thrift.protocol.TMap _map556 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.part_vals = new HashMap(2*_map556.size); + for (int _i557 = 0; _i557 < _map556.size; ++_i557) { - String _key550; // required - String _val551; // optional - _key550 = iprot.readString(); - _val551 = iprot.readString(); - struct.part_vals.put(_key550, _val551); + String _key558; // required + String _val559; // optional + _key558 = iprot.readString(); + _val559 = iprot.readString(); + struct.part_vals.put(_key558, _val559); } } struct.setPart_valsIsSet(true); @@ -68996,14 +70064,14 @@ case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list552 = iprot.readListBegin(); - struct.success = new ArrayList(_list552.size); - for (int _i553 = 0; _i553 < _list552.size; ++_i553) + org.apache.thrift.protocol.TList _list560 = iprot.readListBegin(); + struct.success = new ArrayList(_list560.size); + for (int _i561 = 0; _i561 < _list560.size; ++_i561) { - Index _elem554; // required - _elem554 = new Index(); - _elem554.read(iprot); - struct.success.add(_elem554); + Index _elem562; // required + _elem562 = new Index(); + _elem562.read(iprot); + struct.success.add(_elem562); } iprot.readListEnd(); } @@ -69047,9 +70115,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (Index _iter555 : struct.success) + for (Index _iter563 : struct.success) { - _iter555.write(oprot); + _iter563.write(oprot); } oprot.writeListEnd(); } @@ -69096,9 +70164,9 @@ if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (Index _iter556 : struct.success) + for (Index _iter564 : struct.success) { - _iter556.write(oprot); + _iter564.write(oprot); } } } @@ -69116,14 +70184,14 @@ BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list557 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list557.size); - for (int _i558 = 0; _i558 < _list557.size; ++_i558) + org.apache.thrift.protocol.TList _list565 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list565.size); + for (int _i566 = 0; _i566 < _list565.size; ++_i566) { - Index _elem559; // required - _elem559 = new Index(); - _elem559.read(iprot); - struct.success.add(_elem559); + Index _elem567; // required + _elem567 = new Index(); + _elem567.read(iprot); + struct.success.add(_elem567); } } struct.setSuccessIsSet(true); @@ -70105,13 +71173,13 @@ case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list560 = iprot.readListBegin(); - struct.success = new ArrayList(_list560.size); - for (int _i561 = 0; _i561 < _list560.size; ++_i561) + org.apache.thrift.protocol.TList _list568 = iprot.readListBegin(); + struct.success = new ArrayList(_list568.size); + for (int _i569 = 0; _i569 < _list568.size; ++_i569) { - String _elem562; // required - _elem562 = iprot.readString(); - struct.success.add(_elem562); + String _elem570; // required + _elem570 = iprot.readString(); + struct.success.add(_elem570); } iprot.readListEnd(); } @@ -70146,9 +71214,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); - for (String _iter563 : struct.success) + for (String _iter571 : struct.success) { - oprot.writeString(_iter563); + oprot.writeString(_iter571); } oprot.writeListEnd(); } @@ -70187,9 +71255,9 @@ if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (String _iter564 : struct.success) + for (String _iter572 : struct.success) { - oprot.writeString(_iter564); + oprot.writeString(_iter572); } } } @@ -70204,13 +71272,13 @@ BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list565 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.success = new ArrayList(_list565.size); - for (int _i566 = 0; _i566 < _list565.size; ++_i566) + org.apache.thrift.protocol.TList _list573 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new ArrayList(_list573.size); + for (int _i574 = 0; _i574 < _list573.size; ++_i574) { - String _elem567; // required - _elem567 = iprot.readString(); - struct.success.add(_elem567); + String _elem575; // required + _elem575 = iprot.readString(); + struct.success.add(_elem575); } } struct.setSuccessIsSet(true); @@ -80416,13 +81484,13 @@ case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list568 = iprot.readListBegin(); - struct.success = new ArrayList(_list568.size); - for (int _i569 = 0; _i569 < _list568.size; ++_i569) + org.apache.thrift.protocol.TList _list576 = iprot.readListBegin(); + struct.success = new ArrayList(_list576.size); + for (int _i577 = 0; _i577 < _list576.size; ++_i577) { - String _elem570; // required - _elem570 = iprot.readString(); - struct.success.add(_elem570); + String _elem578; // required + _elem578 = iprot.readString(); + struct.success.add(_elem578); } iprot.readListEnd(); } @@ -80457,9 +81525,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); - for (String _iter571 : struct.success) + for (String _iter579 : struct.success) { - oprot.writeString(_iter571); + oprot.writeString(_iter579); } oprot.writeListEnd(); } @@ -80498,9 +81566,9 @@ if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (String _iter572 : struct.success) + for (String _iter580 : struct.success) { - oprot.writeString(_iter572); + oprot.writeString(_iter580); } } } @@ -80515,13 +81583,13 @@ BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list573 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.success = new ArrayList(_list573.size); - for (int _i574 = 0; _i574 < _list573.size; ++_i574) + org.apache.thrift.protocol.TList _list581 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new ArrayList(_list581.size); + for (int _i582 = 0; _i582 < _list581.size; ++_i582) { - String _elem575; // required - _elem575 = iprot.readString(); - struct.success.add(_elem575); + String _elem583; // required + _elem583 = iprot.readString(); + struct.success.add(_elem583); } } struct.setSuccessIsSet(true); @@ -83812,14 +84880,14 @@ case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list576 = iprot.readListBegin(); - struct.success = new ArrayList(_list576.size); - for (int _i577 = 0; _i577 < _list576.size; ++_i577) + org.apache.thrift.protocol.TList _list584 = iprot.readListBegin(); + struct.success = new ArrayList(_list584.size); + for (int _i585 = 0; _i585 < _list584.size; ++_i585) { - Role _elem578; // required - _elem578 = new Role(); - _elem578.read(iprot); - struct.success.add(_elem578); + Role _elem586; // required + _elem586 = new Role(); + _elem586.read(iprot); + struct.success.add(_elem586); } iprot.readListEnd(); } @@ -83854,9 +84922,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (Role _iter579 : struct.success) + for (Role _iter587 : struct.success) { - _iter579.write(oprot); + _iter587.write(oprot); } oprot.writeListEnd(); } @@ -83895,9 +84963,9 @@ if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (Role _iter580 : struct.success) + for (Role _iter588 : struct.success) { - _iter580.write(oprot); + _iter588.write(oprot); } } } @@ -83912,14 +84980,14 @@ BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list581 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list581.size); - for (int _i582 = 0; _i582 < _list581.size; ++_i582) + org.apache.thrift.protocol.TList _list589 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list589.size); + for (int _i590 = 0; _i590 < _list589.size; ++_i590) { - Role _elem583; // required - _elem583 = new Role(); - _elem583.read(iprot); - struct.success.add(_elem583); + Role _elem591; // required + _elem591 = new Role(); + _elem591.read(iprot); + struct.success.add(_elem591); } } struct.setSuccessIsSet(true); @@ -84431,13 +85499,13 @@ case 3: // GROUP_NAMES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list584 = iprot.readListBegin(); - struct.group_names = new ArrayList(_list584.size); - for (int _i585 = 0; _i585 < _list584.size; ++_i585) + org.apache.thrift.protocol.TList _list592 = iprot.readListBegin(); + struct.group_names = new ArrayList(_list592.size); + for (int _i593 = 0; _i593 < _list592.size; ++_i593) { - String _elem586; // required - _elem586 = iprot.readString(); - struct.group_names.add(_elem586); + String _elem594; // required + _elem594 = iprot.readString(); + struct.group_names.add(_elem594); } iprot.readListEnd(); } @@ -84473,9 +85541,9 @@ oprot.writeFieldBegin(GROUP_NAMES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.group_names.size())); - for (String _iter587 : struct.group_names) + for (String _iter595 : struct.group_names) { - oprot.writeString(_iter587); + oprot.writeString(_iter595); } oprot.writeListEnd(); } @@ -84518,9 +85586,9 @@ if (struct.isSetGroup_names()) { { oprot.writeI32(struct.group_names.size()); - for (String _iter588 : struct.group_names) + for (String _iter596 : struct.group_names) { - oprot.writeString(_iter588); + oprot.writeString(_iter596); } } } @@ -84541,13 +85609,13 @@ } if (incoming.get(2)) { { - org.apache.thrift.protocol.TList _list589 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.group_names = new ArrayList(_list589.size); - for (int _i590 = 0; _i590 < _list589.size; ++_i590) + org.apache.thrift.protocol.TList _list597 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.group_names = new ArrayList(_list597.size); + for (int _i598 = 0; _i598 < _list597.size; ++_i598) { - String _elem591; // required - _elem591 = iprot.readString(); - struct.group_names.add(_elem591); + String _elem599; // required + _elem599 = iprot.readString(); + struct.group_names.add(_elem599); } } struct.setGroup_namesIsSet(true); @@ -86005,14 +87073,14 @@ case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list592 = iprot.readListBegin(); - struct.success = new ArrayList(_list592.size); - for (int _i593 = 0; _i593 < _list592.size; ++_i593) + org.apache.thrift.protocol.TList _list600 = iprot.readListBegin(); + struct.success = new ArrayList(_list600.size); + for (int _i601 = 0; _i601 < _list600.size; ++_i601) { - HiveObjectPrivilege _elem594; // required - _elem594 = new HiveObjectPrivilege(); - _elem594.read(iprot); - struct.success.add(_elem594); + HiveObjectPrivilege _elem602; // required + _elem602 = new HiveObjectPrivilege(); + _elem602.read(iprot); + struct.success.add(_elem602); } iprot.readListEnd(); } @@ -86047,9 +87115,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (HiveObjectPrivilege _iter595 : struct.success) + for (HiveObjectPrivilege _iter603 : struct.success) { - _iter595.write(oprot); + _iter603.write(oprot); } oprot.writeListEnd(); } @@ -86088,9 +87156,9 @@ if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (HiveObjectPrivilege _iter596 : struct.success) + for (HiveObjectPrivilege _iter604 : struct.success) { - _iter596.write(oprot); + _iter604.write(oprot); } } } @@ -86105,14 +87173,14 @@ BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list597 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list597.size); - for (int _i598 = 0; _i598 < _list597.size; ++_i598) + org.apache.thrift.protocol.TList _list605 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list605.size); + for (int _i606 = 0; _i606 < _list605.size; ++_i606) { - HiveObjectPrivilege _elem599; // required - _elem599 = new HiveObjectPrivilege(); - _elem599.read(iprot); - struct.success.add(_elem599); + HiveObjectPrivilege _elem607; // required + _elem607 = new HiveObjectPrivilege(); + _elem607.read(iprot); + struct.success.add(_elem607); } } struct.setSuccessIsSet(true); @@ -88185,13 +89253,13 @@ case 2: // GROUP_NAMES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list600 = iprot.readListBegin(); - struct.group_names = new ArrayList(_list600.size); - for (int _i601 = 0; _i601 < _list600.size; ++_i601) + org.apache.thrift.protocol.TList _list608 = iprot.readListBegin(); + struct.group_names = new ArrayList(_list608.size); + for (int _i609 = 0; _i609 < _list608.size; ++_i609) { - String _elem602; // required - _elem602 = iprot.readString(); - struct.group_names.add(_elem602); + String _elem610; // required + _elem610 = iprot.readString(); + struct.group_names.add(_elem610); } iprot.readListEnd(); } @@ -88222,9 +89290,9 @@ oprot.writeFieldBegin(GROUP_NAMES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.group_names.size())); - for (String _iter603 : struct.group_names) + for (String _iter611 : struct.group_names) { - oprot.writeString(_iter603); + oprot.writeString(_iter611); } oprot.writeListEnd(); } @@ -88261,9 +89329,9 @@ if (struct.isSetGroup_names()) { { oprot.writeI32(struct.group_names.size()); - for (String _iter604 : struct.group_names) + for (String _iter612 : struct.group_names) { - oprot.writeString(_iter604); + oprot.writeString(_iter612); } } } @@ -88279,13 +89347,13 @@ } if (incoming.get(1)) { { - org.apache.thrift.protocol.TList _list605 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.group_names = new ArrayList(_list605.size); - for (int _i606 = 0; _i606 < _list605.size; ++_i606) + org.apache.thrift.protocol.TList _list613 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.group_names = new ArrayList(_list613.size); + for (int _i614 = 0; _i614 < _list613.size; ++_i614) { - String _elem607; // required - _elem607 = iprot.readString(); - struct.group_names.add(_elem607); + String _elem615; // required + _elem615 = iprot.readString(); + struct.group_names.add(_elem615); } } struct.setGroup_namesIsSet(true); @@ -88691,13 +89759,13 @@ case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list608 = iprot.readListBegin(); - struct.success = new ArrayList(_list608.size); - for (int _i609 = 0; _i609 < _list608.size; ++_i609) + org.apache.thrift.protocol.TList _list616 = iprot.readListBegin(); + struct.success = new ArrayList(_list616.size); + for (int _i617 = 0; _i617 < _list616.size; ++_i617) { - String _elem610; // required - _elem610 = iprot.readString(); - struct.success.add(_elem610); + String _elem618; // required + _elem618 = iprot.readString(); + struct.success.add(_elem618); } iprot.readListEnd(); } @@ -88732,9 +89800,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); - for (String _iter611 : struct.success) + for (String _iter619 : struct.success) { - oprot.writeString(_iter611); + oprot.writeString(_iter619); } oprot.writeListEnd(); } @@ -88773,9 +89841,9 @@ if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (String _iter612 : struct.success) + for (String _iter620 : struct.success) { - oprot.writeString(_iter612); + oprot.writeString(_iter620); } } } @@ -88790,13 +89858,13 @@ BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list613 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.success = new ArrayList(_list613.size); - for (int _i614 = 0; _i614 < _list613.size; ++_i614) + org.apache.thrift.protocol.TList _list621 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new ArrayList(_list621.size); + for (int _i622 = 0; _i622 < _list621.size; ++_i622) { - String _elem615; // required - _elem615 = iprot.readString(); - struct.success.add(_elem615); + String _elem623; // required + _elem623 = iprot.readString(); + struct.success.add(_elem623); } } struct.setSuccessIsSet(true); Index: metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php =================================================================== --- metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php (revision 1440777) +++ metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php (working copy) @@ -60,6 +60,7 @@ public function alter_partitions($db_name, $tbl_name, $new_parts); public function alter_partition_with_environment_context($db_name, $tbl_name, \metastore\Partition $new_part, \metastore\EnvironmentContext $environment_context); public function rename_partition($db_name, $tbl_name, $part_vals, \metastore\Partition $new_part); + public function partition_name_has_valid_characters($part_vals, $throw_exception); public function get_config_value($name, $defaultValue); public function partition_name_to_vals($part_name); public function partition_name_to_spec($part_name); @@ -2670,6 +2671,61 @@ return; } + public function partition_name_has_valid_characters($part_vals, $throw_exception) + { + $this->send_partition_name_has_valid_characters($part_vals, $throw_exception); + return $this->recv_partition_name_has_valid_characters(); + } + + public function send_partition_name_has_valid_characters($part_vals, $throw_exception) + { + $args = new \metastore\ThriftHiveMetastore_partition_name_has_valid_characters_args(); + $args->part_vals = $part_vals; + $args->throw_exception = $throw_exception; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'partition_name_has_valid_characters', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('partition_name_has_valid_characters', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_partition_name_has_valid_characters() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\metastore\ThriftHiveMetastore_partition_name_has_valid_characters_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \metastore\ThriftHiveMetastore_partition_name_has_valid_characters_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new \Exception("partition_name_has_valid_characters failed: unknown result"); + } + public function get_config_value($name, $defaultValue) { $this->send_get_config_value($name, $defaultValue); @@ -15128,6 +15184,218 @@ } +class ThriftHiveMetastore_partition_name_has_valid_characters_args { + static $_TSPEC; + + public $part_vals = null; + public $throw_exception = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'part_vals', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 2 => array( + 'var' => 'throw_exception', + 'type' => TType::BOOL, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['part_vals'])) { + $this->part_vals = $vals['part_vals']; + } + if (isset($vals['throw_exception'])) { + $this->throw_exception = $vals['throw_exception']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_partition_name_has_valid_characters_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::LST) { + $this->part_vals = array(); + $_size453 = 0; + $_etype456 = 0; + $xfer += $input->readListBegin($_etype456, $_size453); + for ($_i457 = 0; $_i457 < $_size453; ++$_i457) + { + $elem458 = null; + $xfer += $input->readString($elem458); + $this->part_vals []= $elem458; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->throw_exception); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_partition_name_has_valid_characters_args'); + if ($this->part_vals !== null) { + if (!is_array($this->part_vals)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('part_vals', TType::LST, 1); + { + $output->writeListBegin(TType::STRING, count($this->part_vals)); + { + foreach ($this->part_vals as $iter459) + { + $xfer += $output->writeString($iter459); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->throw_exception !== null) { + $xfer += $output->writeFieldBegin('throw_exception', TType::BOOL, 2); + $xfer += $output->writeBool($this->throw_exception); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHiveMetastore_partition_name_has_valid_characters_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::BOOL, + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => '\metastore\MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_partition_name_has_valid_characters_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->success); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new \metastore\MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_partition_name_has_valid_characters_result'); + if ($this->success !== null) { + $xfer += $output->writeFieldBegin('success', TType::BOOL, 0); + $xfer += $output->writeBool($this->success); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + class ThriftHiveMetastore_get_config_value_args { static $_TSPEC; @@ -15442,14 +15710,14 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size453 = 0; - $_etype456 = 0; - $xfer += $input->readListBegin($_etype456, $_size453); - for ($_i457 = 0; $_i457 < $_size453; ++$_i457) + $_size460 = 0; + $_etype463 = 0; + $xfer += $input->readListBegin($_etype463, $_size460); + for ($_i464 = 0; $_i464 < $_size460; ++$_i464) { - $elem458 = null; - $xfer += $input->readString($elem458); - $this->success []= $elem458; + $elem465 = null; + $xfer += $input->readString($elem465); + $this->success []= $elem465; } $xfer += $input->readListEnd(); } else { @@ -15485,9 +15753,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter459) + foreach ($this->success as $iter466) { - $xfer += $output->writeString($iter459); + $xfer += $output->writeString($iter466); } } $output->writeListEnd(); @@ -15638,17 +15906,17 @@ case 0: if ($ftype == TType::MAP) { $this->success = array(); - $_size460 = 0; - $_ktype461 = 0; - $_vtype462 = 0; - $xfer += $input->readMapBegin($_ktype461, $_vtype462, $_size460); - for ($_i464 = 0; $_i464 < $_size460; ++$_i464) + $_size467 = 0; + $_ktype468 = 0; + $_vtype469 = 0; + $xfer += $input->readMapBegin($_ktype468, $_vtype469, $_size467); + for ($_i471 = 0; $_i471 < $_size467; ++$_i471) { - $key465 = ''; - $val466 = ''; - $xfer += $input->readString($key465); - $xfer += $input->readString($val466); - $this->success[$key465] = $val466; + $key472 = ''; + $val473 = ''; + $xfer += $input->readString($key472); + $xfer += $input->readString($val473); + $this->success[$key472] = $val473; } $xfer += $input->readMapEnd(); } else { @@ -15684,10 +15952,10 @@ { $output->writeMapBegin(TType::STRING, TType::STRING, count($this->success)); { - foreach ($this->success as $kiter467 => $viter468) + foreach ($this->success as $kiter474 => $viter475) { - $xfer += $output->writeString($kiter467); - $xfer += $output->writeString($viter468); + $xfer += $output->writeString($kiter474); + $xfer += $output->writeString($viter475); } } $output->writeMapEnd(); @@ -15795,17 +16063,17 @@ case 3: if ($ftype == TType::MAP) { $this->part_vals = array(); - $_size469 = 0; - $_ktype470 = 0; - $_vtype471 = 0; - $xfer += $input->readMapBegin($_ktype470, $_vtype471, $_size469); - for ($_i473 = 0; $_i473 < $_size469; ++$_i473) + $_size476 = 0; + $_ktype477 = 0; + $_vtype478 = 0; + $xfer += $input->readMapBegin($_ktype477, $_vtype478, $_size476); + for ($_i480 = 0; $_i480 < $_size476; ++$_i480) { - $key474 = ''; - $val475 = ''; - $xfer += $input->readString($key474); - $xfer += $input->readString($val475); - $this->part_vals[$key474] = $val475; + $key481 = ''; + $val482 = ''; + $xfer += $input->readString($key481); + $xfer += $input->readString($val482); + $this->part_vals[$key481] = $val482; } $xfer += $input->readMapEnd(); } else { @@ -15850,10 +16118,10 @@ { $output->writeMapBegin(TType::STRING, TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $kiter476 => $viter477) + foreach ($this->part_vals as $kiter483 => $viter484) { - $xfer += $output->writeString($kiter476); - $xfer += $output->writeString($viter477); + $xfer += $output->writeString($kiter483); + $xfer += $output->writeString($viter484); } } $output->writeMapEnd(); @@ -16145,17 +16413,17 @@ case 3: if ($ftype == TType::MAP) { $this->part_vals = array(); - $_size478 = 0; - $_ktype479 = 0; - $_vtype480 = 0; - $xfer += $input->readMapBegin($_ktype479, $_vtype480, $_size478); - for ($_i482 = 0; $_i482 < $_size478; ++$_i482) + $_size485 = 0; + $_ktype486 = 0; + $_vtype487 = 0; + $xfer += $input->readMapBegin($_ktype486, $_vtype487, $_size485); + for ($_i489 = 0; $_i489 < $_size485; ++$_i489) { - $key483 = ''; - $val484 = ''; - $xfer += $input->readString($key483); - $xfer += $input->readString($val484); - $this->part_vals[$key483] = $val484; + $key490 = ''; + $val491 = ''; + $xfer += $input->readString($key490); + $xfer += $input->readString($val491); + $this->part_vals[$key490] = $val491; } $xfer += $input->readMapEnd(); } else { @@ -16200,10 +16468,10 @@ { $output->writeMapBegin(TType::STRING, TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $kiter485 => $viter486) + foreach ($this->part_vals as $kiter492 => $viter493) { - $xfer += $output->writeString($kiter485); - $xfer += $output->writeString($viter486); + $xfer += $output->writeString($kiter492); + $xfer += $output->writeString($viter493); } } $output->writeMapEnd(); @@ -17563,15 +17831,15 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size487 = 0; - $_etype490 = 0; - $xfer += $input->readListBegin($_etype490, $_size487); - for ($_i491 = 0; $_i491 < $_size487; ++$_i491) + $_size494 = 0; + $_etype497 = 0; + $xfer += $input->readListBegin($_etype497, $_size494); + for ($_i498 = 0; $_i498 < $_size494; ++$_i498) { - $elem492 = null; - $elem492 = new \metastore\Index(); - $xfer += $elem492->read($input); - $this->success []= $elem492; + $elem499 = null; + $elem499 = new \metastore\Index(); + $xfer += $elem499->read($input); + $this->success []= $elem499; } $xfer += $input->readListEnd(); } else { @@ -17615,9 +17883,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter493) + foreach ($this->success as $iter500) { - $xfer += $iter493->write($output); + $xfer += $iter500->write($output); } } $output->writeListEnd(); @@ -17809,14 +18077,14 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size494 = 0; - $_etype497 = 0; - $xfer += $input->readListBegin($_etype497, $_size494); - for ($_i498 = 0; $_i498 < $_size494; ++$_i498) + $_size501 = 0; + $_etype504 = 0; + $xfer += $input->readListBegin($_etype504, $_size501); + for ($_i505 = 0; $_i505 < $_size501; ++$_i505) { - $elem499 = null; - $xfer += $input->readString($elem499); - $this->success []= $elem499; + $elem506 = null; + $xfer += $input->readString($elem506); + $this->success []= $elem506; } $xfer += $input->readListEnd(); } else { @@ -17852,9 +18120,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter500) + foreach ($this->success as $iter507) { - $xfer += $output->writeString($iter500); + $xfer += $output->writeString($iter507); } } $output->writeListEnd(); @@ -19928,14 +20196,14 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size501 = 0; - $_etype504 = 0; - $xfer += $input->readListBegin($_etype504, $_size501); - for ($_i505 = 0; $_i505 < $_size501; ++$_i505) + $_size508 = 0; + $_etype511 = 0; + $xfer += $input->readListBegin($_etype511, $_size508); + for ($_i512 = 0; $_i512 < $_size508; ++$_i512) { - $elem506 = null; - $xfer += $input->readString($elem506); - $this->success []= $elem506; + $elem513 = null; + $xfer += $input->readString($elem513); + $this->success []= $elem513; } $xfer += $input->readListEnd(); } else { @@ -19971,9 +20239,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter507) + foreach ($this->success as $iter514) { - $xfer += $output->writeString($iter507); + $xfer += $output->writeString($iter514); } } $output->writeListEnd(); @@ -20613,15 +20881,15 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size508 = 0; - $_etype511 = 0; - $xfer += $input->readListBegin($_etype511, $_size508); - for ($_i512 = 0; $_i512 < $_size508; ++$_i512) + $_size515 = 0; + $_etype518 = 0; + $xfer += $input->readListBegin($_etype518, $_size515); + for ($_i519 = 0; $_i519 < $_size515; ++$_i519) { - $elem513 = null; - $elem513 = new \metastore\Role(); - $xfer += $elem513->read($input); - $this->success []= $elem513; + $elem520 = null; + $elem520 = new \metastore\Role(); + $xfer += $elem520->read($input); + $this->success []= $elem520; } $xfer += $input->readListEnd(); } else { @@ -20657,9 +20925,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter514) + foreach ($this->success as $iter521) { - $xfer += $iter514->write($output); + $xfer += $iter521->write($output); } } $output->writeListEnd(); @@ -20757,14 +21025,14 @@ case 3: if ($ftype == TType::LST) { $this->group_names = array(); - $_size515 = 0; - $_etype518 = 0; - $xfer += $input->readListBegin($_etype518, $_size515); - for ($_i519 = 0; $_i519 < $_size515; ++$_i519) + $_size522 = 0; + $_etype525 = 0; + $xfer += $input->readListBegin($_etype525, $_size522); + for ($_i526 = 0; $_i526 < $_size522; ++$_i526) { - $elem520 = null; - $xfer += $input->readString($elem520); - $this->group_names []= $elem520; + $elem527 = null; + $xfer += $input->readString($elem527); + $this->group_names []= $elem527; } $xfer += $input->readListEnd(); } else { @@ -20805,9 +21073,9 @@ { $output->writeListBegin(TType::STRING, count($this->group_names)); { - foreach ($this->group_names as $iter521) + foreach ($this->group_names as $iter528) { - $xfer += $output->writeString($iter521); + $xfer += $output->writeString($iter528); } } $output->writeListEnd(); @@ -21094,15 +21362,15 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size522 = 0; - $_etype525 = 0; - $xfer += $input->readListBegin($_etype525, $_size522); - for ($_i526 = 0; $_i526 < $_size522; ++$_i526) + $_size529 = 0; + $_etype532 = 0; + $xfer += $input->readListBegin($_etype532, $_size529); + for ($_i533 = 0; $_i533 < $_size529; ++$_i533) { - $elem527 = null; - $elem527 = new \metastore\HiveObjectPrivilege(); - $xfer += $elem527->read($input); - $this->success []= $elem527; + $elem534 = null; + $elem534 = new \metastore\HiveObjectPrivilege(); + $xfer += $elem534->read($input); + $this->success []= $elem534; } $xfer += $input->readListEnd(); } else { @@ -21138,9 +21406,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter528) + foreach ($this->success as $iter535) { - $xfer += $iter528->write($output); + $xfer += $iter535->write($output); } } $output->writeListEnd(); @@ -21563,14 +21831,14 @@ case 2: if ($ftype == TType::LST) { $this->group_names = array(); - $_size529 = 0; - $_etype532 = 0; - $xfer += $input->readListBegin($_etype532, $_size529); - for ($_i533 = 0; $_i533 < $_size529; ++$_i533) + $_size536 = 0; + $_etype539 = 0; + $xfer += $input->readListBegin($_etype539, $_size536); + for ($_i540 = 0; $_i540 < $_size536; ++$_i540) { - $elem534 = null; - $xfer += $input->readString($elem534); - $this->group_names []= $elem534; + $elem541 = null; + $xfer += $input->readString($elem541); + $this->group_names []= $elem541; } $xfer += $input->readListEnd(); } else { @@ -21603,9 +21871,9 @@ { $output->writeListBegin(TType::STRING, count($this->group_names)); { - foreach ($this->group_names as $iter535) + foreach ($this->group_names as $iter542) { - $xfer += $output->writeString($iter535); + $xfer += $output->writeString($iter542); } } $output->writeListEnd(); @@ -21675,14 +21943,14 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size536 = 0; - $_etype539 = 0; - $xfer += $input->readListBegin($_etype539, $_size536); - for ($_i540 = 0; $_i540 < $_size536; ++$_i540) + $_size543 = 0; + $_etype546 = 0; + $xfer += $input->readListBegin($_etype546, $_size543); + for ($_i547 = 0; $_i547 < $_size543; ++$_i547) { - $elem541 = null; - $xfer += $input->readString($elem541); - $this->success []= $elem541; + $elem548 = null; + $xfer += $input->readString($elem548); + $this->success []= $elem548; } $xfer += $input->readListEnd(); } else { @@ -21718,9 +21986,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter542) + foreach ($this->success as $iter549) { - $xfer += $output->writeString($iter542); + $xfer += $output->writeString($iter549); } } $output->writeListEnd(); Index: metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote =================================================================== --- metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote (revision 1440777) +++ metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote (working copy) @@ -67,6 +67,7 @@ print ' void alter_partitions(string db_name, string tbl_name, new_parts)' print ' void alter_partition_with_environment_context(string db_name, string tbl_name, Partition new_part, EnvironmentContext environment_context)' print ' void rename_partition(string db_name, string tbl_name, part_vals, Partition new_part)' + print ' bool partition_name_has_valid_characters( part_vals, bool throw_exception)' print ' string get_config_value(string name, string defaultValue)' print ' partition_name_to_vals(string part_name)' print ' partition_name_to_spec(string part_name)' @@ -413,6 +414,12 @@ sys.exit(1) pp.pprint(client.rename_partition(args[0],args[1],eval(args[2]),eval(args[3]),)) +elif cmd == 'partition_name_has_valid_characters': + if len(args) != 2: + print 'partition_name_has_valid_characters requires 2 args' + sys.exit(1) + pp.pprint(client.partition_name_has_valid_characters(eval(args[0]),eval(args[1]),)) + elif cmd == 'get_config_value': if len(args) != 2: print 'get_config_value requires 2 args' Index: metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py =================================================================== --- metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py (revision 1440777) +++ metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py (working copy) @@ -397,6 +397,14 @@ """ pass + def partition_name_has_valid_characters(self, part_vals, throw_exception): + """ + Parameters: + - part_vals + - throw_exception + """ + pass + def get_config_value(self, name, defaultValue): """ Parameters: @@ -2291,6 +2299,40 @@ raise result.o2 return + def partition_name_has_valid_characters(self, part_vals, throw_exception): + """ + Parameters: + - part_vals + - throw_exception + """ + self.send_partition_name_has_valid_characters(part_vals, throw_exception) + return self.recv_partition_name_has_valid_characters() + + def send_partition_name_has_valid_characters(self, part_vals, throw_exception): + self._oprot.writeMessageBegin('partition_name_has_valid_characters', TMessageType.CALL, self._seqid) + args = partition_name_has_valid_characters_args() + args.part_vals = part_vals + args.throw_exception = throw_exception + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_partition_name_has_valid_characters(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = partition_name_has_valid_characters_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.o1 is not None: + raise result.o1 + raise TApplicationException(TApplicationException.MISSING_RESULT, "partition_name_has_valid_characters failed: unknown result"); + def get_config_value(self, name, defaultValue): """ Parameters: @@ -3476,6 +3518,7 @@ self._processMap["alter_partitions"] = Processor.process_alter_partitions self._processMap["alter_partition_with_environment_context"] = Processor.process_alter_partition_with_environment_context self._processMap["rename_partition"] = Processor.process_rename_partition + self._processMap["partition_name_has_valid_characters"] = Processor.process_partition_name_has_valid_characters self._processMap["get_config_value"] = Processor.process_get_config_value self._processMap["partition_name_to_vals"] = Processor.process_partition_name_to_vals self._processMap["partition_name_to_spec"] = Processor.process_partition_name_to_spec @@ -4247,6 +4290,20 @@ oprot.writeMessageEnd() oprot.trans.flush() + def process_partition_name_has_valid_characters(self, seqid, iprot, oprot): + args = partition_name_has_valid_characters_args() + args.read(iprot) + iprot.readMessageEnd() + result = partition_name_has_valid_characters_result() + try: + result.success = self._handler.partition_name_has_valid_characters(args.part_vals, args.throw_exception) + except MetaException as o1: + result.o1 = o1 + oprot.writeMessageBegin("partition_name_has_valid_characters", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_get_config_value(self, seqid, iprot, oprot): args = get_config_value_args() args.read(iprot) @@ -12260,6 +12317,158 @@ def __ne__(self, other): return not (self == other) +class partition_name_has_valid_characters_args: + """ + Attributes: + - part_vals + - throw_exception + """ + + thrift_spec = ( + None, # 0 + (1, TType.LIST, 'part_vals', (TType.STRING,None), None, ), # 1 + (2, TType.BOOL, 'throw_exception', None, None, ), # 2 + ) + + def __init__(self, part_vals=None, throw_exception=None,): + self.part_vals = part_vals + self.throw_exception = throw_exception + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.LIST: + self.part_vals = [] + (_etype456, _size453) = iprot.readListBegin() + for _i457 in xrange(_size453): + _elem458 = iprot.readString(); + self.part_vals.append(_elem458) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.BOOL: + self.throw_exception = iprot.readBool(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('partition_name_has_valid_characters_args') + if self.part_vals is not None: + oprot.writeFieldBegin('part_vals', TType.LIST, 1) + oprot.writeListBegin(TType.STRING, len(self.part_vals)) + for iter459 in self.part_vals: + oprot.writeString(iter459) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.throw_exception is not None: + oprot.writeFieldBegin('throw_exception', TType.BOOL, 2) + oprot.writeBool(self.throw_exception) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class partition_name_has_valid_characters_result: + """ + Attributes: + - success + - o1 + """ + + thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, o1=None,): + self.success = success + self.o1 = o1 + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.BOOL: + self.success = iprot.readBool(); + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.o1 = MetaException() + self.o1.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('partition_name_has_valid_characters_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) + oprot.writeFieldEnd() + if self.o1 is not None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + class get_config_value_args: """ Attributes: @@ -12492,10 +12701,10 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype456, _size453) = iprot.readListBegin() - for _i457 in xrange(_size453): - _elem458 = iprot.readString(); - self.success.append(_elem458) + (_etype463, _size460) = iprot.readListBegin() + for _i464 in xrange(_size460): + _elem465 = iprot.readString(); + self.success.append(_elem465) iprot.readListEnd() else: iprot.skip(ftype) @@ -12518,8 +12727,8 @@ if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter459 in self.success: - oprot.writeString(iter459) + for iter466 in self.success: + oprot.writeString(iter466) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -12632,11 +12841,11 @@ if fid == 0: if ftype == TType.MAP: self.success = {} - (_ktype461, _vtype462, _size460 ) = iprot.readMapBegin() - for _i464 in xrange(_size460): - _key465 = iprot.readString(); - _val466 = iprot.readString(); - self.success[_key465] = _val466 + (_ktype468, _vtype469, _size467 ) = iprot.readMapBegin() + for _i471 in xrange(_size467): + _key472 = iprot.readString(); + _val473 = iprot.readString(); + self.success[_key472] = _val473 iprot.readMapEnd() else: iprot.skip(ftype) @@ -12659,9 +12868,9 @@ if self.success is not None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success)) - for kiter467,viter468 in self.success.items(): - oprot.writeString(kiter467) - oprot.writeString(viter468) + for kiter474,viter475 in self.success.items(): + oprot.writeString(kiter474) + oprot.writeString(viter475) oprot.writeMapEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -12731,11 +12940,11 @@ elif fid == 3: if ftype == TType.MAP: self.part_vals = {} - (_ktype470, _vtype471, _size469 ) = iprot.readMapBegin() - for _i473 in xrange(_size469): - _key474 = iprot.readString(); - _val475 = iprot.readString(); - self.part_vals[_key474] = _val475 + (_ktype477, _vtype478, _size476 ) = iprot.readMapBegin() + for _i480 in xrange(_size476): + _key481 = iprot.readString(); + _val482 = iprot.readString(); + self.part_vals[_key481] = _val482 iprot.readMapEnd() else: iprot.skip(ftype) @@ -12765,9 +12974,9 @@ if self.part_vals is not None: oprot.writeFieldBegin('part_vals', TType.MAP, 3) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.part_vals)) - for kiter476,viter477 in self.part_vals.items(): - oprot.writeString(kiter476) - oprot.writeString(viter477) + for kiter483,viter484 in self.part_vals.items(): + oprot.writeString(kiter483) + oprot.writeString(viter484) oprot.writeMapEnd() oprot.writeFieldEnd() if self.eventType is not None: @@ -12963,11 +13172,11 @@ elif fid == 3: if ftype == TType.MAP: self.part_vals = {} - (_ktype479, _vtype480, _size478 ) = iprot.readMapBegin() - for _i482 in xrange(_size478): - _key483 = iprot.readString(); - _val484 = iprot.readString(); - self.part_vals[_key483] = _val484 + (_ktype486, _vtype487, _size485 ) = iprot.readMapBegin() + for _i489 in xrange(_size485): + _key490 = iprot.readString(); + _val491 = iprot.readString(); + self.part_vals[_key490] = _val491 iprot.readMapEnd() else: iprot.skip(ftype) @@ -12997,9 +13206,9 @@ if self.part_vals is not None: oprot.writeFieldBegin('part_vals', TType.MAP, 3) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.part_vals)) - for kiter485,viter486 in self.part_vals.items(): - oprot.writeString(kiter485) - oprot.writeString(viter486) + for kiter492,viter493 in self.part_vals.items(): + oprot.writeString(kiter492) + oprot.writeString(viter493) oprot.writeMapEnd() oprot.writeFieldEnd() if self.eventType is not None: @@ -13971,11 +14180,11 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype490, _size487) = iprot.readListBegin() - for _i491 in xrange(_size487): - _elem492 = Index() - _elem492.read(iprot) - self.success.append(_elem492) + (_etype497, _size494) = iprot.readListBegin() + for _i498 in xrange(_size494): + _elem499 = Index() + _elem499.read(iprot) + self.success.append(_elem499) iprot.readListEnd() else: iprot.skip(ftype) @@ -14004,8 +14213,8 @@ if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter493 in self.success: - iter493.write(oprot) + for iter500 in self.success: + iter500.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -14146,10 +14355,10 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype497, _size494) = iprot.readListBegin() - for _i498 in xrange(_size494): - _elem499 = iprot.readString(); - self.success.append(_elem499) + (_etype504, _size501) = iprot.readListBegin() + for _i505 in xrange(_size501): + _elem506 = iprot.readString(); + self.success.append(_elem506) iprot.readListEnd() else: iprot.skip(ftype) @@ -14172,8 +14381,8 @@ if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter500 in self.success: - oprot.writeString(iter500) + for iter507 in self.success: + oprot.writeString(iter507) oprot.writeListEnd() oprot.writeFieldEnd() if self.o2 is not None: @@ -15683,10 +15892,10 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype504, _size501) = iprot.readListBegin() - for _i505 in xrange(_size501): - _elem506 = iprot.readString(); - self.success.append(_elem506) + (_etype511, _size508) = iprot.readListBegin() + for _i512 in xrange(_size508): + _elem513 = iprot.readString(); + self.success.append(_elem513) iprot.readListEnd() else: iprot.skip(ftype) @@ -15709,8 +15918,8 @@ if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter507 in self.success: - oprot.writeString(iter507) + for iter514 in self.success: + oprot.writeString(iter514) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -16183,11 +16392,11 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype511, _size508) = iprot.readListBegin() - for _i512 in xrange(_size508): - _elem513 = Role() - _elem513.read(iprot) - self.success.append(_elem513) + (_etype518, _size515) = iprot.readListBegin() + for _i519 in xrange(_size515): + _elem520 = Role() + _elem520.read(iprot) + self.success.append(_elem520) iprot.readListEnd() else: iprot.skip(ftype) @@ -16210,8 +16419,8 @@ if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter514 in self.success: - iter514.write(oprot) + for iter521 in self.success: + iter521.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -16279,10 +16488,10 @@ elif fid == 3: if ftype == TType.LIST: self.group_names = [] - (_etype518, _size515) = iprot.readListBegin() - for _i519 in xrange(_size515): - _elem520 = iprot.readString(); - self.group_names.append(_elem520) + (_etype525, _size522) = iprot.readListBegin() + for _i526 in xrange(_size522): + _elem527 = iprot.readString(); + self.group_names.append(_elem527) iprot.readListEnd() else: iprot.skip(ftype) @@ -16307,8 +16516,8 @@ if self.group_names is not None: oprot.writeFieldBegin('group_names', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.group_names)) - for iter521 in self.group_names: - oprot.writeString(iter521) + for iter528 in self.group_names: + oprot.writeString(iter528) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -16515,11 +16724,11 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype525, _size522) = iprot.readListBegin() - for _i526 in xrange(_size522): - _elem527 = HiveObjectPrivilege() - _elem527.read(iprot) - self.success.append(_elem527) + (_etype532, _size529) = iprot.readListBegin() + for _i533 in xrange(_size529): + _elem534 = HiveObjectPrivilege() + _elem534.read(iprot) + self.success.append(_elem534) iprot.readListEnd() else: iprot.skip(ftype) @@ -16542,8 +16751,8 @@ if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter528 in self.success: - iter528.write(oprot) + for iter535 in self.success: + iter535.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -16868,10 +17077,10 @@ elif fid == 2: if ftype == TType.LIST: self.group_names = [] - (_etype532, _size529) = iprot.readListBegin() - for _i533 in xrange(_size529): - _elem534 = iprot.readString(); - self.group_names.append(_elem534) + (_etype539, _size536) = iprot.readListBegin() + for _i540 in xrange(_size536): + _elem541 = iprot.readString(); + self.group_names.append(_elem541) iprot.readListEnd() else: iprot.skip(ftype) @@ -16892,8 +17101,8 @@ if self.group_names is not None: oprot.writeFieldBegin('group_names', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.group_names)) - for iter535 in self.group_names: - oprot.writeString(iter535) + for iter542 in self.group_names: + oprot.writeString(iter542) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -16942,10 +17151,10 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype539, _size536) = iprot.readListBegin() - for _i540 in xrange(_size536): - _elem541 = iprot.readString(); - self.success.append(_elem541) + (_etype546, _size543) = iprot.readListBegin() + for _i547 in xrange(_size543): + _elem548 = iprot.readString(); + self.success.append(_elem548) iprot.readListEnd() else: iprot.skip(ftype) @@ -16968,8 +17177,8 @@ if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter542 in self.success: - oprot.writeString(iter542) + for iter549 in self.success: + oprot.writeString(iter549) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: Index: metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb =================================================================== --- metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb (revision 1440777) +++ metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb (working copy) @@ -758,6 +758,22 @@ return end + def partition_name_has_valid_characters(part_vals, throw_exception) + send_partition_name_has_valid_characters(part_vals, throw_exception) + return recv_partition_name_has_valid_characters() + end + + def send_partition_name_has_valid_characters(part_vals, throw_exception) + send_message('partition_name_has_valid_characters', Partition_name_has_valid_characters_args, :part_vals => part_vals, :throw_exception => throw_exception) + end + + def recv_partition_name_has_valid_characters() + result = receive_message(Partition_name_has_valid_characters_result) + return result.success unless result.success.nil? + raise result.o1 unless result.o1.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'partition_name_has_valid_characters failed: unknown result') + end + def get_config_value(name, defaultValue) send_get_config_value(name, defaultValue) return recv_get_config_value() @@ -1882,6 +1898,17 @@ write_result(result, oprot, 'rename_partition', seqid) end + def process_partition_name_has_valid_characters(seqid, iprot, oprot) + args = read_args(iprot, Partition_name_has_valid_characters_args) + result = Partition_name_has_valid_characters_result.new() + begin + result.success = @handler.partition_name_has_valid_characters(args.part_vals, args.throw_exception) + rescue ::MetaException => o1 + result.o1 = o1 + end + write_result(result, oprot, 'partition_name_has_valid_characters', seqid) + end + def process_get_config_value(seqid, iprot, oprot) args = read_args(iprot, Get_config_value_args) result = Get_config_value_result.new() @@ -4016,6 +4043,42 @@ ::Thrift::Struct.generate_accessors self end + class Partition_name_has_valid_characters_args + include ::Thrift::Struct, ::Thrift::Struct_Union + PART_VALS = 1 + THROW_EXCEPTION = 2 + + FIELDS = { + PART_VALS => {:type => ::Thrift::Types::LIST, :name => 'part_vals', :element => {:type => ::Thrift::Types::STRING}}, + THROW_EXCEPTION => {:type => ::Thrift::Types::BOOL, :name => 'throw_exception'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Partition_name_has_valid_characters_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + O1 = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::BOOL, :name => 'success'}, + O1 => {:type => ::Thrift::Types::STRUCT, :name => 'o1', :class => ::MetaException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + class Get_config_value_args include ::Thrift::Struct, ::Thrift::Struct_Union NAME = 1 Index: metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (revision 1440777) +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (working copy) @@ -295,6 +295,7 @@ private List listeners; private List endFunctionListeners; private List initListeners; + private Pattern partitionValidationPattern; { classLoader = Thread.currentThread().getContextClassLoader(); @@ -344,6 +345,14 @@ MetaStoreEndFunctionListener.class, hiveConf, hiveConf.getVar(HiveConf.ConfVars.METASTORE_END_FUNCTION_LISTENERS)); + String partitionValidationRegex = + hiveConf.getVar(HiveConf.ConfVars.METASTORE_PARTITION_NAME_WHITELIST_PATTERN); + if (partitionValidationRegex != null && partitionValidationRegex != "") { + partitionValidationPattern = Pattern.compile(partitionValidationRegex); + } else { + partitionValidationPattern = null; + } + long cleanFreq = hiveConf.getLongVar(ConfVars.METASTORE_EVENT_CLEAN_FREQ) * 1000L; if (cleanFreq > 0) { // In default config, there is no timer. @@ -1480,6 +1489,8 @@ PreAddPartitionEvent event = new PreAddPartitionEvent(part, this); firePreEvent(event); + MetaStoreUtils.validatePartitionNameCharacters(part_vals, partitionValidationPattern); + tbl = ms.getTable(part.getDbName(), part.getTableName()); if (tbl == null) { throw new InvalidObjectException( @@ -1672,6 +1683,9 @@ try { firePreEvent(new PreAddPartitionEvent(part, this)); + MetaStoreUtils.validatePartitionNameCharacters(part.getValues(), + partitionValidationPattern); + Partition old_part = null; try { old_part = ms.getPartition(part.getDbName(), part @@ -2121,6 +2135,11 @@ try { firePreEvent(new PreAlterPartitionEvent(db_name, tbl_name, part_vals, new_part, this)); + if (part_vals != null && !part_vals.isEmpty()) { + MetaStoreUtils.validatePartitionNameCharacters(new_part.getValues(), + partitionValidationPattern); + } + oldPart = alterHandler.alterPartition(getMS(), wh, db_name, tbl_name, part_vals, new_part); for (MetaStoreEventListener listener : listeners) { @@ -4010,6 +4029,34 @@ Collections.addAll(groupNames, username); return groupNames; } + + @Override + public boolean partition_name_has_valid_characters(List part_vals, + boolean throw_exception) throws TException, MetaException { + startFunction("partition_name_has_valid_characters"); + boolean ret = false; + Exception ex = null; + try { + if (throw_exception) { + MetaStoreUtils.validatePartitionNameCharacters(part_vals, partitionValidationPattern); + ret = true; + } else { + ret = MetaStoreUtils.partitionNameHasValidCharacters(part_vals, + partitionValidationPattern); + } + } catch (Exception e) { + if (e instanceof MetaException) { + throw (MetaException)e; + } else { + ex = e; + MetaException me = new MetaException(); + me.initCause(e); + throw me; + } + } + endFunction("partition_name_has_valid_characters", true, null); + return ret; + } } public static IHMSHandler newHMSHandler(String name, HiveConf hiveConf) throws MetaException { Index: metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java (revision 1440777) +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java (working copy) @@ -400,6 +400,11 @@ client.append_partition_by_name(dbName, tableName, partName)); } + public void validatePartitionNameCharacters(List partVals) + throws TException, MetaException { + client.partition_name_has_valid_characters(partVals, true); + } + /** * Create a new Database * @param db Index: metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java (revision 1440777) +++ metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java (working copy) @@ -491,6 +491,15 @@ UnknownTableException, UnknownDBException, UnknownPartitionException, InvalidPartitionException; /** + * @param partVals + * @throws TException + * @throws MetaException + */ + public void validatePartitionNameCharacters(List partVals) + throws TException, MetaException; + + + /** * @param tbl * @throws AlreadyExistsException * @throws InvalidObjectException Index: metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java (revision 1440777) +++ metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java (working copy) @@ -1102,4 +1102,37 @@ } } + public static void validatePartitionNameCharacters(List partVals, + Pattern partitionValidationPattern) throws MetaException { + + String invalidPartitionVal = + getPartitionValWithInvalidCharacter(partVals, partitionValidationPattern); + if (invalidPartitionVal != null) { + throw new MetaException("Partition value '" + invalidPartitionVal + + "' contains a character " + "not matched by whitelist pattern '" + + partitionValidationPattern.toString() + "'. " + "(configure with " + + HiveConf.ConfVars.METASTORE_PARTITION_NAME_WHITELIST_PATTERN.varname + ")"); + } + } + + public static boolean partitionNameHasValidCharacters(List partVals, + Pattern partitionValidationPattern) { + return getPartitionValWithInvalidCharacter(partVals, partitionValidationPattern) == null; + } + + private static String getPartitionValWithInvalidCharacter(List partVals, + Pattern partitionValidationPattern) { + if (partitionValidationPattern == null) { + return null; + } + + for (String partVal : partVals) { + if (!partitionValidationPattern.matcher(partVal).matches()) { + return partVal; + } + } + + return null; + } + } Index: metastore/src/java/org/apache/hadoop/hive/metastore/PartitionNameWhitelistPreEventListener.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/PartitionNameWhitelistPreEventListener.java (revision 1440777) +++ metastore/src/java/org/apache/hadoop/hive/metastore/PartitionNameWhitelistPreEventListener.java (working copy) @@ -1,70 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.hive.metastore; - -import java.util.List; -import java.util.regex.Pattern; - -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.metastore.api.InvalidOperationException; -import org.apache.hadoop.hive.metastore.api.MetaException; -import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; -import org.apache.hadoop.hive.metastore.events.PreAddPartitionEvent; -import org.apache.hadoop.hive.metastore.events.PreEventContext; - -public class PartitionNameWhitelistPreEventListener extends MetaStorePreEventListener { - - // When enabled, this hook causes an exception to be thrown - // if partition fields contain characters which are not - // matched by the whitelist - - private static String regex; - private static Pattern pattern; - - public PartitionNameWhitelistPreEventListener(Configuration config) { - super(config); - - regex = config.get(HiveConf.ConfVars.METASTORE_PARTITION_NAME_WHITELIST_PATTERN.varname); - pattern = Pattern.compile(regex); - } - - @Override - public void onEvent(PreEventContext event) throws MetaException, NoSuchObjectException, - InvalidOperationException { - - switch (event.getEventType()) { - case ADD_PARTITION: - checkWhitelist(((PreAddPartitionEvent) event).getPartition().getValues()); - break; - } - - } - - private static void checkWhitelist(List partVals) throws MetaException { - for (String partVal : partVals) { - if (!pattern.matcher(partVal).matches()) { - throw new MetaException("Partition value '" + partVal + "' contains a character " - + "not matched by whitelist pattern '" + regex + "'. " + "(configure with " - + HiveConf.ConfVars.METASTORE_PARTITION_NAME_WHITELIST_PATTERN.varname + ")"); - } - } - } - -} Index: metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java =================================================================== --- metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java (revision 1440777) +++ metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java (working copy) @@ -854,8 +854,8 @@ public void testDatabaseLocationWithPermissionProblems() throws Exception { - // Note: The following test will fail if you are running this test as root. Setting - // permission to '0' on the database folder will not preclude root from being able + // Note: The following test will fail if you are running this test as root. Setting + // permission to '0' on the database folder will not preclude root from being able // to create the necessary files. if (System.getProperty("user.name").equals("root")) { @@ -1757,7 +1757,7 @@ } catch (TException e) { e.printStackTrace(); assert (false); - } + } assert (threwException); } @@ -2106,7 +2106,7 @@ * at least works correctly. */ public void testSynchronized() throws Exception { - int currentNumberOfDbs = client.getAllDatabases().size(); + int currentNumberOfDbs = client.getAllDatabases().size(); IMetaStoreClient synchronizedClient = HiveMetaStoreClient.newSynchronizedClient(client); @@ -2340,6 +2340,8 @@ } } + + /** * This method simulates another Hive metastore renaming a table, by accessing the db and * updating the name. Index: metastore/src/test/org/apache/hadoop/hive/metastore/TestPartitionNameWhitelistPreEventHook.java =================================================================== --- metastore/src/test/org/apache/hadoop/hive/metastore/TestPartitionNameWhitelistPreEventHook.java (revision 1440777) +++ metastore/src/test/org/apache/hadoop/hive/metastore/TestPartitionNameWhitelistPreEventHook.java (working copy) @@ -1,164 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.hive.metastore; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; - -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.metastore.api.Partition; -import org.apache.hadoop.hive.metastore.events.PreAddPartitionEvent; -import org.apache.hadoop.hive.metastore.events.PreEventContext; -import org.junit.Test; - -// Validate CharacterWhitelistPreEventHook to ensure it refuses to process -// a partition add or append request if partition fields contain -// Unicode characters or commas - -public class TestPartitionNameWhitelistPreEventHook { - - // Runs an instance of DisallowUnicodePreEventListener - // Returns whether or not it succeeded - private boolean runHook(PreEventContext event) { - - Configuration config = new Configuration(); - - // match the printable ASCII characters except for commas - config.set(HiveConf.ConfVars.METASTORE_PARTITION_NAME_WHITELIST_PATTERN.varname - , "[\\x20-\\x7E&&[^,]]*"); - - PartitionNameWhitelistPreEventListener hook = - new PartitionNameWhitelistPreEventListener(config); - - try { - hook.onEvent(event); - } catch (Exception e) { - return false; - } - - return true; - } - - // Sample data - private List getPartValsWithUnicode() { - - List partVals = new ArrayList(); - partVals.add("klâwen"); - partVals.add("tägelîch"); - - return partVals; - - } - - private List getPartValsWithCommas() { - - List partVals = new ArrayList(); - partVals.add("a,b"); - partVals.add("c,d,e,f"); - - return partVals; - - } - - private List getPartValsWithValidCharacters() { - - List partVals = new ArrayList(); - partVals.add("part1"); - partVals.add("part2"); - - return partVals; - - } - - @Test - public void testAddPartitionWithCommas() { - - Partition partition = new Partition(); - partition.setValues(getPartValsWithCommas()); - - PreAddPartitionEvent event = new PreAddPartitionEvent(partition, null); - - Assert.assertFalse("Add a partition with commas in name", - runHook(event)); - } - - @Test - public void testAddPartitionWithUnicode() { - - Partition partition = new Partition(); - partition.setValues(getPartValsWithUnicode()); - - PreAddPartitionEvent event = new PreAddPartitionEvent(partition, null); - - Assert.assertFalse("Add a partition with unicode characters in name", - runHook(event)); - } - - @Test - public void testAddPartitionWithValidPartVal() { - - Partition p = new Partition(); - p.setValues(getPartValsWithValidCharacters()); - - PreAddPartitionEvent event = new PreAddPartitionEvent(p, null); - - Assert.assertTrue("Add a partition with unicode characters in name", - runHook(event)); - } - - @Test - public void testAppendPartitionWithUnicode() { - - Partition p = new Partition(); - p.setValues(getPartValsWithUnicode()); - - PreAddPartitionEvent event = new PreAddPartitionEvent(p, null); - - Assert.assertFalse("Append a partition with unicode characters in name", - runHook(event)); - } - - @Test - public void testAppendPartitionWithCommas() { - - Partition p = new Partition(); - p.setValues(getPartValsWithCommas()); - - PreAddPartitionEvent event = new PreAddPartitionEvent(p, null); - - Assert.assertFalse("Append a partition with unicode characters in name", - runHook(event)); - } - - @Test - public void testAppendPartitionWithValidCharacters() { - - Partition p = new Partition(); - p.setValues(getPartValsWithValidCharacters()); - - PreAddPartitionEvent event = new PreAddPartitionEvent(p, null); - - Assert.assertTrue("Append a partition with no unicode characters in name", - runHook(event)); - } - -} Index: metastore/src/test/org/apache/hadoop/hive/metastore/TestPartitionNameWhitelistValidation.java =================================================================== --- metastore/src/test/org/apache/hadoop/hive/metastore/TestPartitionNameWhitelistValidation.java (revision 0) +++ metastore/src/test/org/apache/hadoop/hive/metastore/TestPartitionNameWhitelistValidation.java (working copy) @@ -0,0 +1,146 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.metastore; + +import java.util.ArrayList; +import java.util.List; + +import junit.framework.Assert; +import junit.framework.TestCase; + +import org.apache.hadoop.hive.cli.CliSessionState; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.ql.Driver; +import org.apache.hadoop.hive.ql.session.SessionState; +import org.apache.hadoop.hive.shims.ShimLoader; +import org.junit.Test; + +// Validate the metastore client call validatePartitionNameCharacters to ensure it throws +// an exception if partition fields contain Unicode characters or commas + +public class TestPartitionNameWhitelistValidation extends TestCase { + + private static final String partitionValidationPattern = "[\\x20-\\x7E&&[^,]]*"; + + private HiveConf hiveConf; + private HiveMetaStoreClient msc; + private Driver driver; + + @Override + protected void setUp() throws Exception { + super.setUp(); + System.setProperty(HiveConf.ConfVars.METASTORE_PARTITION_NAME_WHITELIST_PATTERN.varname, + partitionValidationPattern); + int port = MetaStoreUtils.findFreePort(); + MetaStoreUtils.startMetaStore(port, ShimLoader.getHadoopThriftAuthBridge()); + hiveConf = new HiveConf(this.getClass()); + hiveConf.setVar(HiveConf.ConfVars.METASTOREURIS, "thrift://localhost:" + port); + hiveConf.setIntVar(HiveConf.ConfVars.METASTORETHRIFTCONNECTIONRETRIES, 3); + SessionState.start(new CliSessionState(hiveConf)); + msc = new HiveMetaStoreClient(hiveConf, null); + driver = new Driver(hiveConf); + } + + // Runs an instance of DisallowUnicodePreEventListener + // Returns whether or not it succeeded + private boolean runValidation(List partVals) { + + try { + msc.validatePartitionNameCharacters(partVals); + } catch (Exception e) { + return false; + } + + return true; + } + + // Sample data + private List getPartValsWithUnicode() { + + List partVals = new ArrayList(); + partVals.add("klâwen"); + partVals.add("tägelîch"); + + return partVals; + + } + + private List getPartValsWithCommas() { + + List partVals = new ArrayList(); + partVals.add("a,b"); + partVals.add("c,d,e,f"); + + return partVals; + + } + + private List getPartValsWithValidCharacters() { + + List partVals = new ArrayList(); + partVals.add("part1"); + partVals.add("part2"); + + return partVals; + + } + + @Test + public void testAddPartitionWithCommas() { + + Assert.assertFalse("Add a partition with commas in name", + runValidation(getPartValsWithCommas())); + } + + @Test + public void testAddPartitionWithUnicode() { + + Assert.assertFalse("Add a partition with unicode characters in name", + runValidation(getPartValsWithUnicode())); + } + + @Test + public void testAddPartitionWithValidPartVal() { + + Assert.assertTrue("Add a partition with unicode characters in name", + runValidation(getPartValsWithValidCharacters())); + } + + @Test + public void testAppendPartitionWithUnicode() { + + Assert.assertFalse("Append a partition with unicode characters in name", + runValidation(getPartValsWithUnicode())); + } + + @Test + public void testAppendPartitionWithCommas() { + + Assert.assertFalse("Append a partition with unicode characters in name", + runValidation(getPartValsWithCommas())); + } + + @Test + public void testAppendPartitionWithValidCharacters() { + + Assert.assertTrue("Append a partition with no unicode characters in name", + runValidation(getPartValsWithValidCharacters())); + } + +} Index: ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java (revision 1440777) +++ ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java (working copy) @@ -46,6 +46,7 @@ import org.apache.hadoop.hive.ql.lockmgr.HiveLock; import org.apache.hadoop.hive.ql.lockmgr.HiveLockManager; import org.apache.hadoop.hive.ql.lockmgr.HiveLockObj; +import org.apache.hadoop.hive.ql.metadata.Hive; import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.ql.metadata.Partition; import org.apache.hadoop.hive.ql.metadata.Table; @@ -393,6 +394,8 @@ } dc = null; // reset data container to prevent it being added again. } else { // static partitions + List partVals = Hive.getPvals(table.getPartCols(), tbd.getPartitionSpec()); + db.validatePartitionNameCharacters(partVals); db.loadPartition(new Path(tbd.getSourceDir()), tbd.getTable().getTableName(), tbd.getPartitionSpec(), tbd.getReplace(), tbd.getHoldDDLTime(), tbd.getInheritTableSpecs(), isSkewedStoredAsDirs(tbd)); Index: ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java (revision 1440777) +++ ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java (working copy) @@ -1355,6 +1355,11 @@ // No leaves in this directory LOG.info("NOT moving empty directory: " + s.getPath()); } else { + try { + validatePartitionNameCharacters(Warehouse.getPartValuesFromPartName(s.getPath().getParent().toString())); + } catch (MetaException e) { + throw new HiveException(e); + } validPartitions.add(s.getPath().getParent()); } } @@ -1700,7 +1705,7 @@ } } - private static List getPvals(List partCols, + public static List getPvals(List partCols, Map partSpec) { List pvals = new ArrayList(); for (FieldSchema field : partCols) { @@ -1873,6 +1878,15 @@ return results; } + public void validatePartitionNameCharacters(List partVals) throws HiveException { + try { + getMSC().validatePartitionNameCharacters(partVals); + } catch (Exception e) { + LOG.error(StringUtils.stringifyException(e)); + throw new HiveException(e); + } + } + /** * Get the name of the current database * @return the current database name Index: ql/src/test/org/apache/hadoop/hive/ql/hooks/VerifyTableDirectoryIsEmptyHook.java =================================================================== --- ql/src/test/org/apache/hadoop/hive/ql/hooks/VerifyTableDirectoryIsEmptyHook.java (revision 0) +++ ql/src/test/org/apache/hadoop/hive/ql/hooks/VerifyTableDirectoryIsEmptyHook.java (working copy) @@ -0,0 +1,36 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hive.ql.hooks; + +import java.io.IOException; + +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hive.ql.session.SessionState; + +// This hook verifies that the location of every output table is empty +public class VerifyTableDirectoryIsEmptyHook implements ExecuteWithHookContext { + + public void run(HookContext hookContext) throws IOException { + for (WriteEntity output : hookContext.getOutputs()) { + Path tableLocation = new Path(output.getTable().getDataLocation().toString()); + FileSystem fs = tableLocation.getFileSystem(SessionState.get().getConf()); + assert(fs.listStatus(tableLocation).length == 0); + } + } +} Index: ql/src/test/queries/clientnegative/add_partition_with_whitelist.q =================================================================== --- ql/src/test/queries/clientnegative/add_partition_with_whitelist.q (revision 1440777) +++ ql/src/test/queries/clientnegative/add_partition_with_whitelist.q (working copy) @@ -1,4 +1,3 @@ -SET hive.metastore.pre.event.listeners=org.apache.hadoop.hive.metastore.PartitionNameWhitelistPreEventListener; SET hive.metastore.partition.name.whitelist.pattern=[\\x20-\\x7E&&[^,]]* ; -- This pattern matches all printable ASCII characters (disallow unicode) and disallows commas Index: ql/src/test/queries/clientnegative/alter_partition_with_whitelist.q =================================================================== --- ql/src/test/queries/clientnegative/alter_partition_with_whitelist.q (revision 0) +++ ql/src/test/queries/clientnegative/alter_partition_with_whitelist.q (working copy) @@ -0,0 +1,9 @@ +SET hive.metastore.partition.name.whitelist.pattern=[\\x20-\\x7E&&[^,]]* ; +-- This pattern matches all printable ASCII characters (disallow unicode) and disallows commas + +CREATE TABLE part_whitelist_test (key STRING, value STRING) PARTITIONED BY (ds STRING); +SHOW PARTITIONS part_whitelist_test; + +ALTER TABLE part_whitelist_test ADD PARTITION (ds='1'); + +ALTER TABLE part_whitelist_test PARTITION (ds='1') rename to partition (ds='1,2,3'); Index: ql/src/test/queries/clientnegative/dynamic_partitions_with_whitelist.q =================================================================== --- ql/src/test/queries/clientnegative/dynamic_partitions_with_whitelist.q (revision 1440777) +++ ql/src/test/queries/clientnegative/dynamic_partitions_with_whitelist.q (working copy) @@ -1,5 +1,5 @@ -SET hive.metastore.pre.event.listeners=org.apache.hadoop.hive.metastore.PartitionNameWhitelistPreEventListener; -SET hive.metastore.partition.name.whitelist.pattern=[A-Za-z]*; +SET hive.metastore.partition.name.whitelist.pattern=[^9]*; +set hive.exec.failure.hooks=org.apache.hadoop.hive.ql.hooks.VerifyTableDirectoryIsEmptyHook; set hive.exec.dynamic.partition=true; set hive.exec.dynamic.partition.mode=nonstrict; @@ -10,5 +10,8 @@ load data local inpath '../data/files/srcbucket20.txt' INTO TABLE source_table partition(ds='2008-04-08', hr=11); -insert overwrite table dest_table partition (ds, hr) select key, value, hr from source_table where ds='2008-04-08'; +-- Tests creating dynamic partitions with characters not in the whitelist (i.e. 9) +-- If the directory is not empty the hook will throw an error, instead the error should come from the metastore +-- This shows that no dynamic partitions were created and left behind or had directories created +insert overwrite table dest_table partition (ds, hr) select key, hr, ds, value from source_table where ds='2008-04-08' order by value asc; Index: ql/src/test/queries/clientpositive/add_partition_no_whitelist.q =================================================================== --- ql/src/test/queries/clientpositive/add_partition_no_whitelist.q (revision 1440777) +++ ql/src/test/queries/clientpositive/add_partition_no_whitelist.q (working copy) @@ -1,5 +1,5 @@ -SET hive.metastore.pre.event.listeners= ; --- Test with PartitionNameWhitelistPreEventListener NOT registered +SET hive.metastore.partition.name.whitelist.pattern=; +-- Test with no partition name whitelist pattern CREATE TABLE part_nowhitelist_test (key STRING, value STRING) PARTITIONED BY (ds STRING); SHOW PARTITIONS part_nowhitelist_test; Index: ql/src/test/queries/clientpositive/add_partition_with_whitelist.q =================================================================== --- ql/src/test/queries/clientpositive/add_partition_with_whitelist.q (revision 1440777) +++ ql/src/test/queries/clientpositive/add_partition_with_whitelist.q (working copy) @@ -1,4 +1,3 @@ -SET hive.metastore.pre.event.listeners=org.apache.hadoop.hive.metastore.PartitionNameWhitelistPreEventListener; SET hive.metastore.partition.name.whitelist.pattern=[A-Za-z]*; -- This pattern matches only letters. Index: ql/src/test/queries/clientpositive/alter_partition_with_whitelist.q =================================================================== --- ql/src/test/queries/clientpositive/alter_partition_with_whitelist.q (revision 0) +++ ql/src/test/queries/clientpositive/alter_partition_with_whitelist.q (working copy) @@ -0,0 +1,9 @@ +SET hive.metastore.partition.name.whitelist.pattern=[A-Za-z]*; +-- This pattern matches only letters. + +CREATE TABLE part_whitelist_test (key STRING, value STRING) PARTITIONED BY (ds STRING); +SHOW PARTITIONS part_whitelist_test; + +ALTER TABLE part_whitelist_test ADD PARTITION (ds='Part'); + +ALTER TABLE part_whitelist_test PARTITION (ds='Part') rename to partition (ds='Apart'); Index: ql/src/test/results/clientnegative/alter_partition_with_whitelist.q.out =================================================================== --- ql/src/test/results/clientnegative/alter_partition_with_whitelist.q.out (revision 0) +++ ql/src/test/results/clientnegative/alter_partition_with_whitelist.q.out (working copy) @@ -0,0 +1,26 @@ +PREHOOK: query: -- This pattern matches all printable ASCII characters (disallow unicode) and disallows commas + +CREATE TABLE part_whitelist_test (key STRING, value STRING) PARTITIONED BY (ds STRING) +PREHOOK: type: CREATETABLE +POSTHOOK: query: -- This pattern matches all printable ASCII characters (disallow unicode) and disallows commas + +CREATE TABLE part_whitelist_test (key STRING, value STRING) PARTITIONED BY (ds STRING) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: default@part_whitelist_test +PREHOOK: query: SHOW PARTITIONS part_whitelist_test +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: SHOW PARTITIONS part_whitelist_test +POSTHOOK: type: SHOWPARTITIONS +PREHOOK: query: ALTER TABLE part_whitelist_test ADD PARTITION (ds='1') +PREHOOK: type: ALTERTABLE_ADDPARTS +PREHOOK: Input: default@part_whitelist_test +POSTHOOK: query: ALTER TABLE part_whitelist_test ADD PARTITION (ds='1') +POSTHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: Input: default@part_whitelist_test +POSTHOOK: Output: default@part_whitelist_test@ds=1 +PREHOOK: query: ALTER TABLE part_whitelist_test PARTITION (ds='1') rename to partition (ds='1,2,3') +PREHOOK: type: ALTERTABLE_RENAMEPART +PREHOOK: Input: default@part_whitelist_test +PREHOOK: Output: default@part_whitelist_test@ds=1 +FAILED: Error in metadata: Unable to rename partition. +FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask Index: ql/src/test/results/clientnegative/dynamic_partitions_with_whitelist.q.out =================================================================== --- ql/src/test/results/clientnegative/dynamic_partitions_with_whitelist.q.out (revision 1440777) +++ ql/src/test/results/clientnegative/dynamic_partitions_with_whitelist.q.out (working copy) @@ -11,5 +11,18 @@ PREHOOK: query: load data local inpath '../data/files/srcbucket20.txt' INTO TABLE source_table partition(ds='2008-04-08', hr=11) PREHOOK: type: LOAD PREHOOK: Output: default@source_table -Failed with exception MetaException(message:Partition value '2008-04-08' contains a character not matched by whitelist pattern '[A-Za-z]*'. (configure with hive.metastore.partition.name.whitelist.pattern)) +POSTHOOK: query: load data local inpath '../data/files/srcbucket20.txt' INTO TABLE source_table partition(ds='2008-04-08', hr=11) +POSTHOOK: type: LOAD +POSTHOOK: Output: default@source_table +POSTHOOK: Output: default@source_table@ds=2008-04-08/hr=11 +PREHOOK: query: -- Tests creating dynamic partitions with characters not in the whitelist (i.e. 9) +-- If the directory is not empty the hook will throw an error, instead the error should come from the metastore +-- This shows that no dynamic partitions were created and left behind or had directories created + +insert overwrite table dest_table partition (ds, hr) select key, hr, ds, value from source_table where ds='2008-04-08' order by value asc +PREHOOK: type: QUERY +PREHOOK: Input: default@source_table +PREHOOK: Input: default@source_table@ds=2008-04-08/hr=11 +PREHOOK: Output: default@dest_table +Failed with exception MetaException(message:Partition value 'val_129' contains a character not matched by whitelist pattern '[^9]*'. (configure with hive.metastore.partition.name.whitelist.pattern)) FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask Index: ql/src/test/results/clientpositive/add_partition_no_whitelist.q.out =================================================================== --- ql/src/test/results/clientpositive/add_partition_no_whitelist.q.out (revision 1440777) +++ ql/src/test/results/clientpositive/add_partition_no_whitelist.q.out (working copy) @@ -1,8 +1,8 @@ -PREHOOK: query: -- Test with PartitionNameWhitelistPreEventListener NOT registered +PREHOOK: query: -- Test with no partition name whitelist pattern CREATE TABLE part_nowhitelist_test (key STRING, value STRING) PARTITIONED BY (ds STRING) PREHOOK: type: CREATETABLE -POSTHOOK: query: -- Test with PartitionNameWhitelistPreEventListener NOT registered +POSTHOOK: query: -- Test with no partition name whitelist pattern CREATE TABLE part_nowhitelist_test (key STRING, value STRING) PARTITIONED BY (ds STRING) POSTHOOK: type: CREATETABLE Index: ql/src/test/results/clientpositive/alter_partition_with_whitelist.q.out =================================================================== --- ql/src/test/results/clientpositive/alter_partition_with_whitelist.q.out (revision 0) +++ ql/src/test/results/clientpositive/alter_partition_with_whitelist.q.out (working copy) @@ -0,0 +1,30 @@ +PREHOOK: query: -- This pattern matches only letters. + +CREATE TABLE part_whitelist_test (key STRING, value STRING) PARTITIONED BY (ds STRING) +PREHOOK: type: CREATETABLE +POSTHOOK: query: -- This pattern matches only letters. + +CREATE TABLE part_whitelist_test (key STRING, value STRING) PARTITIONED BY (ds STRING) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: default@part_whitelist_test +PREHOOK: query: SHOW PARTITIONS part_whitelist_test +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: SHOW PARTITIONS part_whitelist_test +POSTHOOK: type: SHOWPARTITIONS +PREHOOK: query: ALTER TABLE part_whitelist_test ADD PARTITION (ds='Part') +PREHOOK: type: ALTERTABLE_ADDPARTS +PREHOOK: Input: default@part_whitelist_test +POSTHOOK: query: ALTER TABLE part_whitelist_test ADD PARTITION (ds='Part') +POSTHOOK: type: ALTERTABLE_ADDPARTS +POSTHOOK: Input: default@part_whitelist_test +POSTHOOK: Output: default@part_whitelist_test@ds=Part +PREHOOK: query: ALTER TABLE part_whitelist_test PARTITION (ds='Part') rename to partition (ds='Apart') +PREHOOK: type: ALTERTABLE_RENAMEPART +PREHOOK: Input: default@part_whitelist_test +PREHOOK: Output: default@part_whitelist_test@ds=Part +POSTHOOK: query: ALTER TABLE part_whitelist_test PARTITION (ds='Part') rename to partition (ds='Apart') +POSTHOOK: type: ALTERTABLE_RENAMEPART +POSTHOOK: Input: default@part_whitelist_test +POSTHOOK: Input: default@part_whitelist_test@ds=Part +POSTHOOK: Output: default@part_whitelist_test@ds=Apart +POSTHOOK: Output: default@part_whitelist_test@ds=Part