http://git-wip-us.apache.org/repos/asf/hive/blob/bbf5ecce/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py ---------------------------------------------------------------------- diff --git a/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py b/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py index 86bbef3..8ee84af 100644 --- a/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py +++ b/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py @@ -205,6 +205,15 @@ class Iface(fb303.FacebookService.Iface): """ pass + def truncate_table(self, dbName, tableName, partNames): + """ + Parameters: + - dbName + - tableName + - partNames + """ + pass + def get_tables(self, db_name, pattern): """ Parameters: @@ -2101,6 +2110,41 @@ class Client(fb303.FacebookService.Client, Iface): raise result.o3 return + def truncate_table(self, dbName, tableName, partNames): + """ + Parameters: + - dbName + - tableName + - partNames + """ + self.send_truncate_table(dbName, tableName, partNames) + self.recv_truncate_table() + + def send_truncate_table(self, dbName, tableName, partNames): + self._oprot.writeMessageBegin('truncate_table', TMessageType.CALL, self._seqid) + args = truncate_table_args() + args.dbName = dbName + args.tableName = tableName + args.partNames = partNames + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_truncate_table(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = truncate_table_result() + result.read(iprot) + iprot.readMessageEnd() + if result.o1 is not None: + raise result.o1 + return + def get_tables(self, db_name, pattern): """ Parameters: @@ -6788,6 +6832,7 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): self._processMap["add_foreign_key"] = Processor.process_add_foreign_key self._processMap["drop_table"] = Processor.process_drop_table self._processMap["drop_table_with_environment_context"] = Processor.process_drop_table_with_environment_context + self._processMap["truncate_table"] = Processor.process_truncate_table self._processMap["get_tables"] = Processor.process_get_tables self._processMap["get_tables_by_type"] = Processor.process_get_tables_by_type self._processMap["get_table_meta"] = Processor.process_get_table_meta @@ -7557,6 +7602,28 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() + def process_truncate_table(self, seqid, iprot, oprot): + args = truncate_table_args() + args.read(iprot) + iprot.readMessageEnd() + result = truncate_table_result() + try: + self._handler.truncate_table(args.dbName, args.tableName, args.partNames) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except MetaException as o1: + msg_type = TMessageType.REPLY + result.o1 = o1 + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("truncate_table", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_get_tables(self, seqid, iprot, oprot): args = get_tables_args() args.read(iprot) @@ -14715,6 +14782,171 @@ class drop_table_with_environment_context_result: def __ne__(self, other): return not (self == other) +class truncate_table_args: + """ + Attributes: + - dbName + - tableName + - partNames + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'dbName', None, None, ), # 1 + (2, TType.STRING, 'tableName', None, None, ), # 2 + (3, TType.LIST, 'partNames', (TType.STRING,None), None, ), # 3 + ) + + def __init__(self, dbName=None, tableName=None, partNames=None,): + self.dbName = dbName + self.tableName = tableName + self.partNames = partNames + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.dbName = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.tableName = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.partNames = [] + (_etype662, _size659) = iprot.readListBegin() + for _i663 in xrange(_size659): + _elem664 = iprot.readString() + self.partNames.append(_elem664) + iprot.readListEnd() + 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('truncate_table_args') + if self.dbName is not None: + oprot.writeFieldBegin('dbName', TType.STRING, 1) + oprot.writeString(self.dbName) + oprot.writeFieldEnd() + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 2) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.partNames is not None: + oprot.writeFieldBegin('partNames', TType.LIST, 3) + oprot.writeListBegin(TType.STRING, len(self.partNames)) + for iter665 in self.partNames: + oprot.writeString(iter665) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.dbName) + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.partNames) + return value + + 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 truncate_table_result: + """ + Attributes: + - o1 + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1 + ) + + def __init__(self, o1=None,): + 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 == 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('truncate_table_result') + 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 __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.o1) + return value + + 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_tables_args: """ Attributes: @@ -14821,10 +15053,10 @@ class get_tables_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype662, _size659) = iprot.readListBegin() - for _i663 in xrange(_size659): - _elem664 = iprot.readString() - self.success.append(_elem664) + (_etype669, _size666) = iprot.readListBegin() + for _i670 in xrange(_size666): + _elem671 = iprot.readString() + self.success.append(_elem671) iprot.readListEnd() else: iprot.skip(ftype) @@ -14847,8 +15079,8 @@ class get_tables_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter665 in self.success: - oprot.writeString(iter665) + for iter672 in self.success: + oprot.writeString(iter672) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -14998,10 +15230,10 @@ class get_tables_by_type_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype669, _size666) = iprot.readListBegin() - for _i670 in xrange(_size666): - _elem671 = iprot.readString() - self.success.append(_elem671) + (_etype676, _size673) = iprot.readListBegin() + for _i677 in xrange(_size673): + _elem678 = iprot.readString() + self.success.append(_elem678) iprot.readListEnd() else: iprot.skip(ftype) @@ -15024,8 +15256,8 @@ class get_tables_by_type_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter672 in self.success: - oprot.writeString(iter672) + for iter679 in self.success: + oprot.writeString(iter679) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -15098,10 +15330,10 @@ class get_table_meta_args: elif fid == 3: if ftype == TType.LIST: self.tbl_types = [] - (_etype676, _size673) = iprot.readListBegin() - for _i677 in xrange(_size673): - _elem678 = iprot.readString() - self.tbl_types.append(_elem678) + (_etype683, _size680) = iprot.readListBegin() + for _i684 in xrange(_size680): + _elem685 = iprot.readString() + self.tbl_types.append(_elem685) iprot.readListEnd() else: iprot.skip(ftype) @@ -15126,8 +15358,8 @@ class get_table_meta_args: if self.tbl_types is not None: oprot.writeFieldBegin('tbl_types', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.tbl_types)) - for iter679 in self.tbl_types: - oprot.writeString(iter679) + for iter686 in self.tbl_types: + oprot.writeString(iter686) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -15183,11 +15415,11 @@ class get_table_meta_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype683, _size680) = iprot.readListBegin() - for _i684 in xrange(_size680): - _elem685 = TableMeta() - _elem685.read(iprot) - self.success.append(_elem685) + (_etype690, _size687) = iprot.readListBegin() + for _i691 in xrange(_size687): + _elem692 = TableMeta() + _elem692.read(iprot) + self.success.append(_elem692) iprot.readListEnd() else: iprot.skip(ftype) @@ -15210,8 +15442,8 @@ class get_table_meta_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter686 in self.success: - iter686.write(oprot) + for iter693 in self.success: + iter693.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -15335,10 +15567,10 @@ class get_all_tables_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype690, _size687) = iprot.readListBegin() - for _i691 in xrange(_size687): - _elem692 = iprot.readString() - self.success.append(_elem692) + (_etype697, _size694) = iprot.readListBegin() + for _i698 in xrange(_size694): + _elem699 = iprot.readString() + self.success.append(_elem699) iprot.readListEnd() else: iprot.skip(ftype) @@ -15361,8 +15593,8 @@ class get_all_tables_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter693 in self.success: - oprot.writeString(iter693) + for iter700 in self.success: + oprot.writeString(iter700) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -15598,10 +15830,10 @@ class get_table_objects_by_name_args: elif fid == 2: if ftype == TType.LIST: self.tbl_names = [] - (_etype697, _size694) = iprot.readListBegin() - for _i698 in xrange(_size694): - _elem699 = iprot.readString() - self.tbl_names.append(_elem699) + (_etype704, _size701) = iprot.readListBegin() + for _i705 in xrange(_size701): + _elem706 = iprot.readString() + self.tbl_names.append(_elem706) iprot.readListEnd() else: iprot.skip(ftype) @@ -15622,8 +15854,8 @@ class get_table_objects_by_name_args: if self.tbl_names is not None: oprot.writeFieldBegin('tbl_names', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.tbl_names)) - for iter700 in self.tbl_names: - oprot.writeString(iter700) + for iter707 in self.tbl_names: + oprot.writeString(iter707) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -15675,11 +15907,11 @@ class get_table_objects_by_name_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype704, _size701) = iprot.readListBegin() - for _i705 in xrange(_size701): - _elem706 = Table() - _elem706.read(iprot) - self.success.append(_elem706) + (_etype711, _size708) = iprot.readListBegin() + for _i712 in xrange(_size708): + _elem713 = Table() + _elem713.read(iprot) + self.success.append(_elem713) iprot.readListEnd() else: iprot.skip(ftype) @@ -15696,8 +15928,8 @@ class get_table_objects_by_name_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter707 in self.success: - iter707.write(oprot) + for iter714 in self.success: + iter714.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -16180,10 +16412,10 @@ class get_table_names_by_filter_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype711, _size708) = iprot.readListBegin() - for _i712 in xrange(_size708): - _elem713 = iprot.readString() - self.success.append(_elem713) + (_etype718, _size715) = iprot.readListBegin() + for _i719 in xrange(_size715): + _elem720 = iprot.readString() + self.success.append(_elem720) iprot.readListEnd() else: iprot.skip(ftype) @@ -16218,8 +16450,8 @@ class get_table_names_by_filter_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter714 in self.success: - oprot.writeString(iter714) + for iter721 in self.success: + oprot.writeString(iter721) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -17189,11 +17421,11 @@ class add_partitions_args: if fid == 1: if ftype == TType.LIST: self.new_parts = [] - (_etype718, _size715) = iprot.readListBegin() - for _i719 in xrange(_size715): - _elem720 = Partition() - _elem720.read(iprot) - self.new_parts.append(_elem720) + (_etype725, _size722) = iprot.readListBegin() + for _i726 in xrange(_size722): + _elem727 = Partition() + _elem727.read(iprot) + self.new_parts.append(_elem727) iprot.readListEnd() else: iprot.skip(ftype) @@ -17210,8 +17442,8 @@ class add_partitions_args: if self.new_parts is not None: oprot.writeFieldBegin('new_parts', TType.LIST, 1) oprot.writeListBegin(TType.STRUCT, len(self.new_parts)) - for iter721 in self.new_parts: - iter721.write(oprot) + for iter728 in self.new_parts: + iter728.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -17369,11 +17601,11 @@ class add_partitions_pspec_args: if fid == 1: if ftype == TType.LIST: self.new_parts = [] - (_etype725, _size722) = iprot.readListBegin() - for _i726 in xrange(_size722): - _elem727 = PartitionSpec() - _elem727.read(iprot) - self.new_parts.append(_elem727) + (_etype732, _size729) = iprot.readListBegin() + for _i733 in xrange(_size729): + _elem734 = PartitionSpec() + _elem734.read(iprot) + self.new_parts.append(_elem734) iprot.readListEnd() else: iprot.skip(ftype) @@ -17390,8 +17622,8 @@ class add_partitions_pspec_args: if self.new_parts is not None: oprot.writeFieldBegin('new_parts', TType.LIST, 1) oprot.writeListBegin(TType.STRUCT, len(self.new_parts)) - for iter728 in self.new_parts: - iter728.write(oprot) + for iter735 in self.new_parts: + iter735.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -17565,10 +17797,10 @@ class append_partition_args: elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype732, _size729) = iprot.readListBegin() - for _i733 in xrange(_size729): - _elem734 = iprot.readString() - self.part_vals.append(_elem734) + (_etype739, _size736) = iprot.readListBegin() + for _i740 in xrange(_size736): + _elem741 = iprot.readString() + self.part_vals.append(_elem741) iprot.readListEnd() else: iprot.skip(ftype) @@ -17593,8 +17825,8 @@ class append_partition_args: if self.part_vals is not None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter735 in self.part_vals: - oprot.writeString(iter735) + for iter742 in self.part_vals: + oprot.writeString(iter742) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -17947,10 +18179,10 @@ class append_partition_with_environment_context_args: elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype739, _size736) = iprot.readListBegin() - for _i740 in xrange(_size736): - _elem741 = iprot.readString() - self.part_vals.append(_elem741) + (_etype746, _size743) = iprot.readListBegin() + for _i747 in xrange(_size743): + _elem748 = iprot.readString() + self.part_vals.append(_elem748) iprot.readListEnd() else: iprot.skip(ftype) @@ -17981,8 +18213,8 @@ class append_partition_with_environment_context_args: if self.part_vals is not None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter742 in self.part_vals: - oprot.writeString(iter742) + for iter749 in self.part_vals: + oprot.writeString(iter749) oprot.writeListEnd() oprot.writeFieldEnd() if self.environment_context is not None: @@ -18577,10 +18809,10 @@ class drop_partition_args: elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype746, _size743) = iprot.readListBegin() - for _i747 in xrange(_size743): - _elem748 = iprot.readString() - self.part_vals.append(_elem748) + (_etype753, _size750) = iprot.readListBegin() + for _i754 in xrange(_size750): + _elem755 = iprot.readString() + self.part_vals.append(_elem755) iprot.readListEnd() else: iprot.skip(ftype) @@ -18610,8 +18842,8 @@ class drop_partition_args: if self.part_vals is not None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter749 in self.part_vals: - oprot.writeString(iter749) + for iter756 in self.part_vals: + oprot.writeString(iter756) oprot.writeListEnd() oprot.writeFieldEnd() if self.deleteData is not None: @@ -18784,10 +19016,10 @@ class drop_partition_with_environment_context_args: elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype753, _size750) = iprot.readListBegin() - for _i754 in xrange(_size750): - _elem755 = iprot.readString() - self.part_vals.append(_elem755) + (_etype760, _size757) = iprot.readListBegin() + for _i761 in xrange(_size757): + _elem762 = iprot.readString() + self.part_vals.append(_elem762) iprot.readListEnd() else: iprot.skip(ftype) @@ -18823,8 +19055,8 @@ class drop_partition_with_environment_context_args: if self.part_vals is not None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter756 in self.part_vals: - oprot.writeString(iter756) + for iter763 in self.part_vals: + oprot.writeString(iter763) oprot.writeListEnd() oprot.writeFieldEnd() if self.deleteData is not None: @@ -19561,10 +19793,10 @@ class get_partition_args: elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype760, _size757) = iprot.readListBegin() - for _i761 in xrange(_size757): - _elem762 = iprot.readString() - self.part_vals.append(_elem762) + (_etype767, _size764) = iprot.readListBegin() + for _i768 in xrange(_size764): + _elem769 = iprot.readString() + self.part_vals.append(_elem769) iprot.readListEnd() else: iprot.skip(ftype) @@ -19589,8 +19821,8 @@ class get_partition_args: if self.part_vals is not None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter763 in self.part_vals: - oprot.writeString(iter763) + for iter770 in self.part_vals: + oprot.writeString(iter770) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -19749,11 +19981,11 @@ class exchange_partition_args: if fid == 1: if ftype == TType.MAP: self.partitionSpecs = {} - (_ktype765, _vtype766, _size764 ) = iprot.readMapBegin() - for _i768 in xrange(_size764): - _key769 = iprot.readString() - _val770 = iprot.readString() - self.partitionSpecs[_key769] = _val770 + (_ktype772, _vtype773, _size771 ) = iprot.readMapBegin() + for _i775 in xrange(_size771): + _key776 = iprot.readString() + _val777 = iprot.readString() + self.partitionSpecs[_key776] = _val777 iprot.readMapEnd() else: iprot.skip(ftype) @@ -19790,9 +20022,9 @@ class exchange_partition_args: if self.partitionSpecs is not None: oprot.writeFieldBegin('partitionSpecs', TType.MAP, 1) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.partitionSpecs)) - for kiter771,viter772 in self.partitionSpecs.items(): - oprot.writeString(kiter771) - oprot.writeString(viter772) + for kiter778,viter779 in self.partitionSpecs.items(): + oprot.writeString(kiter778) + oprot.writeString(viter779) oprot.writeMapEnd() oprot.writeFieldEnd() if self.source_db is not None: @@ -19997,11 +20229,11 @@ class exchange_partitions_args: if fid == 1: if ftype == TType.MAP: self.partitionSpecs = {} - (_ktype774, _vtype775, _size773 ) = iprot.readMapBegin() - for _i777 in xrange(_size773): - _key778 = iprot.readString() - _val779 = iprot.readString() - self.partitionSpecs[_key778] = _val779 + (_ktype781, _vtype782, _size780 ) = iprot.readMapBegin() + for _i784 in xrange(_size780): + _key785 = iprot.readString() + _val786 = iprot.readString() + self.partitionSpecs[_key785] = _val786 iprot.readMapEnd() else: iprot.skip(ftype) @@ -20038,9 +20270,9 @@ class exchange_partitions_args: if self.partitionSpecs is not None: oprot.writeFieldBegin('partitionSpecs', TType.MAP, 1) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.partitionSpecs)) - for kiter780,viter781 in self.partitionSpecs.items(): - oprot.writeString(kiter780) - oprot.writeString(viter781) + for kiter787,viter788 in self.partitionSpecs.items(): + oprot.writeString(kiter787) + oprot.writeString(viter788) oprot.writeMapEnd() oprot.writeFieldEnd() if self.source_db is not None: @@ -20123,11 +20355,11 @@ class exchange_partitions_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype785, _size782) = iprot.readListBegin() - for _i786 in xrange(_size782): - _elem787 = Partition() - _elem787.read(iprot) - self.success.append(_elem787) + (_etype792, _size789) = iprot.readListBegin() + for _i793 in xrange(_size789): + _elem794 = Partition() + _elem794.read(iprot) + self.success.append(_elem794) iprot.readListEnd() else: iprot.skip(ftype) @@ -20168,8 +20400,8 @@ class exchange_partitions_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter788 in self.success: - iter788.write(oprot) + for iter795 in self.success: + iter795.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -20263,10 +20495,10 @@ class get_partition_with_auth_args: elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype792, _size789) = iprot.readListBegin() - for _i793 in xrange(_size789): - _elem794 = iprot.readString() - self.part_vals.append(_elem794) + (_etype799, _size796) = iprot.readListBegin() + for _i800 in xrange(_size796): + _elem801 = iprot.readString() + self.part_vals.append(_elem801) iprot.readListEnd() else: iprot.skip(ftype) @@ -20278,10 +20510,10 @@ class get_partition_with_auth_args: elif fid == 5: if ftype == TType.LIST: self.group_names = [] - (_etype798, _size795) = iprot.readListBegin() - for _i799 in xrange(_size795): - _elem800 = iprot.readString() - self.group_names.append(_elem800) + (_etype805, _size802) = iprot.readListBegin() + for _i806 in xrange(_size802): + _elem807 = iprot.readString() + self.group_names.append(_elem807) iprot.readListEnd() else: iprot.skip(ftype) @@ -20306,8 +20538,8 @@ class get_partition_with_auth_args: if self.part_vals is not None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter801 in self.part_vals: - oprot.writeString(iter801) + for iter808 in self.part_vals: + oprot.writeString(iter808) oprot.writeListEnd() oprot.writeFieldEnd() if self.user_name is not None: @@ -20317,8 +20549,8 @@ class get_partition_with_auth_args: if self.group_names is not None: oprot.writeFieldBegin('group_names', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.group_names)) - for iter802 in self.group_names: - oprot.writeString(iter802) + for iter809 in self.group_names: + oprot.writeString(iter809) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -20747,11 +20979,11 @@ class get_partitions_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype806, _size803) = iprot.readListBegin() - for _i807 in xrange(_size803): - _elem808 = Partition() - _elem808.read(iprot) - self.success.append(_elem808) + (_etype813, _size810) = iprot.readListBegin() + for _i814 in xrange(_size810): + _elem815 = Partition() + _elem815.read(iprot) + self.success.append(_elem815) iprot.readListEnd() else: iprot.skip(ftype) @@ -20780,8 +21012,8 @@ class get_partitions_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter809 in self.success: - iter809.write(oprot) + for iter816 in self.success: + iter816.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -20875,10 +21107,10 @@ class get_partitions_with_auth_args: elif fid == 5: if ftype == TType.LIST: self.group_names = [] - (_etype813, _size810) = iprot.readListBegin() - for _i814 in xrange(_size810): - _elem815 = iprot.readString() - self.group_names.append(_elem815) + (_etype820, _size817) = iprot.readListBegin() + for _i821 in xrange(_size817): + _elem822 = iprot.readString() + self.group_names.append(_elem822) iprot.readListEnd() else: iprot.skip(ftype) @@ -20911,8 +21143,8 @@ class get_partitions_with_auth_args: if self.group_names is not None: oprot.writeFieldBegin('group_names', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.group_names)) - for iter816 in self.group_names: - oprot.writeString(iter816) + for iter823 in self.group_names: + oprot.writeString(iter823) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -20973,11 +21205,11 @@ class get_partitions_with_auth_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype820, _size817) = iprot.readListBegin() - for _i821 in xrange(_size817): - _elem822 = Partition() - _elem822.read(iprot) - self.success.append(_elem822) + (_etype827, _size824) = iprot.readListBegin() + for _i828 in xrange(_size824): + _elem829 = Partition() + _elem829.read(iprot) + self.success.append(_elem829) iprot.readListEnd() else: iprot.skip(ftype) @@ -21006,8 +21238,8 @@ class get_partitions_with_auth_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter823 in self.success: - iter823.write(oprot) + for iter830 in self.success: + iter830.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -21165,11 +21397,11 @@ class get_partitions_pspec_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype827, _size824) = iprot.readListBegin() - for _i828 in xrange(_size824): - _elem829 = PartitionSpec() - _elem829.read(iprot) - self.success.append(_elem829) + (_etype834, _size831) = iprot.readListBegin() + for _i835 in xrange(_size831): + _elem836 = PartitionSpec() + _elem836.read(iprot) + self.success.append(_elem836) iprot.readListEnd() else: iprot.skip(ftype) @@ -21198,8 +21430,8 @@ class get_partitions_pspec_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter830 in self.success: - iter830.write(oprot) + for iter837 in self.success: + iter837.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -21354,10 +21586,10 @@ class get_partition_names_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype834, _size831) = iprot.readListBegin() - for _i835 in xrange(_size831): - _elem836 = iprot.readString() - self.success.append(_elem836) + (_etype841, _size838) = iprot.readListBegin() + for _i842 in xrange(_size838): + _elem843 = iprot.readString() + self.success.append(_elem843) iprot.readListEnd() else: iprot.skip(ftype) @@ -21380,8 +21612,8 @@ class get_partition_names_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter837 in self.success: - oprot.writeString(iter837) + for iter844 in self.success: + oprot.writeString(iter844) oprot.writeListEnd() oprot.writeFieldEnd() if self.o2 is not None: @@ -21457,10 +21689,10 @@ class get_partitions_ps_args: elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype841, _size838) = iprot.readListBegin() - for _i842 in xrange(_size838): - _elem843 = iprot.readString() - self.part_vals.append(_elem843) + (_etype848, _size845) = iprot.readListBegin() + for _i849 in xrange(_size845): + _elem850 = iprot.readString() + self.part_vals.append(_elem850) iprot.readListEnd() else: iprot.skip(ftype) @@ -21490,8 +21722,8 @@ class get_partitions_ps_args: if self.part_vals is not None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter844 in self.part_vals: - oprot.writeString(iter844) + for iter851 in self.part_vals: + oprot.writeString(iter851) oprot.writeListEnd() oprot.writeFieldEnd() if self.max_parts is not None: @@ -21555,11 +21787,11 @@ class get_partitions_ps_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype848, _size845) = iprot.readListBegin() - for _i849 in xrange(_size845): - _elem850 = Partition() - _elem850.read(iprot) - self.success.append(_elem850) + (_etype855, _size852) = iprot.readListBegin() + for _i856 in xrange(_size852): + _elem857 = Partition() + _elem857.read(iprot) + self.success.append(_elem857) iprot.readListEnd() else: iprot.skip(ftype) @@ -21588,8 +21820,8 @@ class get_partitions_ps_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter851 in self.success: - iter851.write(oprot) + for iter858 in self.success: + iter858.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -21676,10 +21908,10 @@ class get_partitions_ps_with_auth_args: elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype855, _size852) = iprot.readListBegin() - for _i856 in xrange(_size852): - _elem857 = iprot.readString() - self.part_vals.append(_elem857) + (_etype862, _size859) = iprot.readListBegin() + for _i863 in xrange(_size859): + _elem864 = iprot.readString() + self.part_vals.append(_elem864) iprot.readListEnd() else: iprot.skip(ftype) @@ -21696,10 +21928,10 @@ class get_partitions_ps_with_auth_args: elif fid == 6: if ftype == TType.LIST: self.group_names = [] - (_etype861, _size858) = iprot.readListBegin() - for _i862 in xrange(_size858): - _elem863 = iprot.readString() - self.group_names.append(_elem863) + (_etype868, _size865) = iprot.readListBegin() + for _i869 in xrange(_size865): + _elem870 = iprot.readString() + self.group_names.append(_elem870) iprot.readListEnd() else: iprot.skip(ftype) @@ -21724,8 +21956,8 @@ class get_partitions_ps_with_auth_args: if self.part_vals is not None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter864 in self.part_vals: - oprot.writeString(iter864) + for iter871 in self.part_vals: + oprot.writeString(iter871) oprot.writeListEnd() oprot.writeFieldEnd() if self.max_parts is not None: @@ -21739,8 +21971,8 @@ class get_partitions_ps_with_auth_args: if self.group_names is not None: oprot.writeFieldBegin('group_names', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.group_names)) - for iter865 in self.group_names: - oprot.writeString(iter865) + for iter872 in self.group_names: + oprot.writeString(iter872) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -21802,11 +22034,11 @@ class get_partitions_ps_with_auth_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype869, _size866) = iprot.readListBegin() - for _i870 in xrange(_size866): - _elem871 = Partition() - _elem871.read(iprot) - self.success.append(_elem871) + (_etype876, _size873) = iprot.readListBegin() + for _i877 in xrange(_size873): + _elem878 = Partition() + _elem878.read(iprot) + self.success.append(_elem878) iprot.readListEnd() else: iprot.skip(ftype) @@ -21835,8 +22067,8 @@ class get_partitions_ps_with_auth_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter872 in self.success: - iter872.write(oprot) + for iter879 in self.success: + iter879.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -21917,10 +22149,10 @@ class get_partition_names_ps_args: elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype876, _size873) = iprot.readListBegin() - for _i877 in xrange(_size873): - _elem878 = iprot.readString() - self.part_vals.append(_elem878) + (_etype883, _size880) = iprot.readListBegin() + for _i884 in xrange(_size880): + _elem885 = iprot.readString() + self.part_vals.append(_elem885) iprot.readListEnd() else: iprot.skip(ftype) @@ -21950,8 +22182,8 @@ class get_partition_names_ps_args: if self.part_vals is not None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter879 in self.part_vals: - oprot.writeString(iter879) + for iter886 in self.part_vals: + oprot.writeString(iter886) oprot.writeListEnd() oprot.writeFieldEnd() if self.max_parts is not None: @@ -22015,10 +22247,10 @@ class get_partition_names_ps_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype883, _size880) = iprot.readListBegin() - for _i884 in xrange(_size880): - _elem885 = iprot.readString() - self.success.append(_elem885) + (_etype890, _size887) = iprot.readListBegin() + for _i891 in xrange(_size887): + _elem892 = iprot.readString() + self.success.append(_elem892) iprot.readListEnd() else: iprot.skip(ftype) @@ -22047,8 +22279,8 @@ class get_partition_names_ps_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter886 in self.success: - oprot.writeString(iter886) + for iter893 in self.success: + oprot.writeString(iter893) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -22219,11 +22451,11 @@ class get_partitions_by_filter_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype890, _size887) = iprot.readListBegin() - for _i891 in xrange(_size887): - _elem892 = Partition() - _elem892.read(iprot) - self.success.append(_elem892) + (_etype897, _size894) = iprot.readListBegin() + for _i898 in xrange(_size894): + _elem899 = Partition() + _elem899.read(iprot) + self.success.append(_elem899) iprot.readListEnd() else: iprot.skip(ftype) @@ -22252,8 +22484,8 @@ class get_partitions_by_filter_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter893 in self.success: - iter893.write(oprot) + for iter900 in self.success: + iter900.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -22424,11 +22656,11 @@ class get_part_specs_by_filter_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype897, _size894) = iprot.readListBegin() - for _i898 in xrange(_size894): - _elem899 = PartitionSpec() - _elem899.read(iprot) - self.success.append(_elem899) + (_etype904, _size901) = iprot.readListBegin() + for _i905 in xrange(_size901): + _elem906 = PartitionSpec() + _elem906.read(iprot) + self.success.append(_elem906) iprot.readListEnd() else: iprot.skip(ftype) @@ -22457,8 +22689,8 @@ class get_part_specs_by_filter_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter900 in self.success: - iter900.write(oprot) + for iter907 in self.success: + iter907.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -22878,10 +23110,10 @@ class get_partitions_by_names_args: elif fid == 3: if ftype == TType.LIST: self.names = [] - (_etype904, _size901) = iprot.readListBegin() - for _i905 in xrange(_size901): - _elem906 = iprot.readString() - self.names.append(_elem906) + (_etype911, _size908) = iprot.readListBegin() + for _i912 in xrange(_size908): + _elem913 = iprot.readString() + self.names.append(_elem913) iprot.readListEnd() else: iprot.skip(ftype) @@ -22906,8 +23138,8 @@ class get_partitions_by_names_args: if self.names is not None: oprot.writeFieldBegin('names', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.names)) - for iter907 in self.names: - oprot.writeString(iter907) + for iter914 in self.names: + oprot.writeString(iter914) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -22966,11 +23198,11 @@ class get_partitions_by_names_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype911, _size908) = iprot.readListBegin() - for _i912 in xrange(_size908): - _elem913 = Partition() - _elem913.read(iprot) - self.success.append(_elem913) + (_etype918, _size915) = iprot.readListBegin() + for _i919 in xrange(_size915): + _elem920 = Partition() + _elem920.read(iprot) + self.success.append(_elem920) iprot.readListEnd() else: iprot.skip(ftype) @@ -22999,8 +23231,8 @@ class get_partitions_by_names_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter914 in self.success: - iter914.write(oprot) + for iter921 in self.success: + iter921.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -23250,11 +23482,11 @@ class alter_partitions_args: elif fid == 3: if ftype == TType.LIST: self.new_parts = [] - (_etype918, _size915) = iprot.readListBegin() - for _i919 in xrange(_size915): - _elem920 = Partition() - _elem920.read(iprot) - self.new_parts.append(_elem920) + (_etype925, _size922) = iprot.readListBegin() + for _i926 in xrange(_size922): + _elem927 = Partition() + _elem927.read(iprot) + self.new_parts.append(_elem927) iprot.readListEnd() else: iprot.skip(ftype) @@ -23279,8 +23511,8 @@ class alter_partitions_args: if self.new_parts is not None: oprot.writeFieldBegin('new_parts', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.new_parts)) - for iter921 in self.new_parts: - iter921.write(oprot) + for iter928 in self.new_parts: + iter928.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -23433,11 +23665,11 @@ class alter_partitions_with_environment_context_args: elif fid == 3: if ftype == TType.LIST: self.new_parts = [] - (_etype925, _size922) = iprot.readListBegin() - for _i926 in xrange(_size922): - _elem927 = Partition() - _elem927.read(iprot) - self.new_parts.append(_elem927) + (_etype932, _size929) = iprot.readListBegin() + for _i933 in xrange(_size929): + _elem934 = Partition() + _elem934.read(iprot) + self.new_parts.append(_elem934) iprot.readListEnd() else: iprot.skip(ftype) @@ -23468,8 +23700,8 @@ class alter_partitions_with_environment_context_args: if self.new_parts is not None: oprot.writeFieldBegin('new_parts', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.new_parts)) - for iter928 in self.new_parts: - iter928.write(oprot) + for iter935 in self.new_parts: + iter935.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.environment_context is not None: @@ -23813,10 +24045,10 @@ class rename_partition_args: elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype932, _size929) = iprot.readListBegin() - for _i933 in xrange(_size929): - _elem934 = iprot.readString() - self.part_vals.append(_elem934) + (_etype939, _size936) = iprot.readListBegin() + for _i940 in xrange(_size936): + _elem941 = iprot.readString() + self.part_vals.append(_elem941) iprot.readListEnd() else: iprot.skip(ftype) @@ -23847,8 +24079,8 @@ class rename_partition_args: if self.part_vals is not None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter935 in self.part_vals: - oprot.writeString(iter935) + for iter942 in self.part_vals: + oprot.writeString(iter942) oprot.writeListEnd() oprot.writeFieldEnd() if self.new_part is not None: @@ -23990,10 +24222,10 @@ class partition_name_has_valid_characters_args: if fid == 1: if ftype == TType.LIST: self.part_vals = [] - (_etype939, _size936) = iprot.readListBegin() - for _i940 in xrange(_size936): - _elem941 = iprot.readString() - self.part_vals.append(_elem941) + (_etype946, _size943) = iprot.readListBegin() + for _i947 in xrange(_size943): + _elem948 = iprot.readString() + self.part_vals.append(_elem948) iprot.readListEnd() else: iprot.skip(ftype) @@ -24015,8 +24247,8 @@ class 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 iter942 in self.part_vals: - oprot.writeString(iter942) + for iter949 in self.part_vals: + oprot.writeString(iter949) oprot.writeListEnd() oprot.writeFieldEnd() if self.throw_exception is not None: @@ -24374,10 +24606,10 @@ class partition_name_to_vals_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype946, _size943) = iprot.readListBegin() - for _i947 in xrange(_size943): - _elem948 = iprot.readString() - self.success.append(_elem948) + (_etype953, _size950) = iprot.readListBegin() + for _i954 in xrange(_size950): + _elem955 = iprot.readString() + self.success.append(_elem955) iprot.readListEnd() else: iprot.skip(ftype) @@ -24400,8 +24632,8 @@ class partition_name_to_vals_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter949 in self.success: - oprot.writeString(iter949) + for iter956 in self.success: + oprot.writeString(iter956) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -24525,11 +24757,11 @@ class partition_name_to_spec_result: if fid == 0: if ftype == TType.MAP: self.success = {} - (_ktype951, _vtype952, _size950 ) = iprot.readMapBegin() - for _i954 in xrange(_size950): - _key955 = iprot.readString() - _val956 = iprot.readString() - self.success[_key955] = _val956 + (_ktype958, _vtype959, _size957 ) = iprot.readMapBegin() + for _i961 in xrange(_size957): + _key962 = iprot.readString() + _val963 = iprot.readString() + self.success[_key962] = _val963 iprot.readMapEnd() else: iprot.skip(ftype) @@ -24552,9 +24784,9 @@ class partition_name_to_spec_result: if self.success is not None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success)) - for kiter957,viter958 in self.success.items(): - oprot.writeString(kiter957) - oprot.writeString(viter958) + for kiter964,viter965 in self.success.items(): + oprot.writeString(kiter964) + oprot.writeString(viter965) oprot.writeMapEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -24630,11 +24862,11 @@ class markPartitionForEvent_args: elif fid == 3: if ftype == TType.MAP: self.part_vals = {} - (_ktype960, _vtype961, _size959 ) = iprot.readMapBegin() - for _i963 in xrange(_size959): - _key964 = iprot.readString() - _val965 = iprot.readString() - self.part_vals[_key964] = _val965 + (_ktype967, _vtype968, _size966 ) = iprot.readMapBegin() + for _i970 in xrange(_size966): + _key971 = iprot.readString() + _val972 = iprot.readString() + self.part_vals[_key971] = _val972 iprot.readMapEnd() else: iprot.skip(ftype) @@ -24664,9 +24896,9 @@ class markPartitionForEvent_args: 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 kiter966,viter967 in self.part_vals.items(): - oprot.writeString(kiter966) - oprot.writeString(viter967) + for kiter973,viter974 in self.part_vals.items(): + oprot.writeString(kiter973) + oprot.writeString(viter974) oprot.writeMapEnd() oprot.writeFieldEnd() if self.eventType is not None: @@ -24880,11 +25112,11 @@ class isPartitionMarkedForEvent_args: elif fid == 3: if ftype == TType.MAP: self.part_vals = {} - (_ktype969, _vtype970, _size968 ) = iprot.readMapBegin() - for _i972 in xrange(_size968): - _key973 = iprot.readString() - _val974 = iprot.readString() - self.part_vals[_key973] = _val974 + (_ktype976, _vtype977, _size975 ) = iprot.readMapBegin() + for _i979 in xrange(_size975): + _key980 = iprot.readString() + _val981 = iprot.readString() + self.part_vals[_key980] = _val981 iprot.readMapEnd() else: iprot.skip(ftype) @@ -24914,9 +25146,9 @@ class isPartitionMarkedForEvent_args: 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 kiter975,viter976 in self.part_vals.items(): - oprot.writeString(kiter975) - oprot.writeString(viter976) + for kiter982,viter983 in self.part_vals.items(): + oprot.writeString(kiter982) + oprot.writeString(viter983) oprot.writeMapEnd() oprot.writeFieldEnd() if self.eventType is not None: @@ -25971,11 +26203,11 @@ class get_indexes_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype980, _size977) = iprot.readListBegin() - for _i981 in xrange(_size977): - _elem982 = Index() - _elem982.read(iprot) - self.success.append(_elem982) + (_etype987, _size984) = iprot.readListBegin() + for _i988 in xrange(_size984): + _elem989 = Index() + _elem989.read(iprot) + self.success.append(_elem989) iprot.readListEnd() else: iprot.skip(ftype) @@ -26004,8 +26236,8 @@ class get_indexes_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter983 in self.success: - iter983.write(oprot) + for iter990 in self.success: + iter990.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -26160,10 +26392,10 @@ class get_index_names_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype987, _size984) = iprot.readListBegin() - for _i988 in xrange(_size984): - _elem989 = iprot.readString() - self.success.append(_elem989) + (_etype994, _size991) = iprot.readListBegin() + for _i995 in xrange(_size991): + _elem996 = iprot.readString() + self.success.append(_elem996) iprot.readListEnd() else: iprot.skip(ftype) @@ -26186,8 +26418,8 @@ class get_index_names_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter990 in self.success: - oprot.writeString(iter990) + for iter997 in self.success: + oprot.writeString(iter997) oprot.writeListEnd() oprot.writeFieldEnd() if self.o2 is not None: @@ -29053,10 +29285,10 @@ class get_functions_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype994, _size991) = iprot.readListBegin() - for _i995 in xrange(_size991): - _elem996 = iprot.readString() - self.success.append(_elem996) + (_etype1001, _size998) = iprot.readListBegin() + for _i1002 in xrange(_size998): + _elem1003 = iprot.readString() + self.success.append(_elem1003) iprot.readListEnd() else: iprot.skip(ftype) @@ -29079,8 +29311,8 @@ class get_functions_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter997 in self.success: - oprot.writeString(iter997) + for iter1004 in self.success: + oprot.writeString(iter1004) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -29768,10 +30000,10 @@ class get_role_names_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype1001, _size998) = iprot.readListBegin() - for _i1002 in xrange(_size998): - _elem1003 = iprot.readString() - self.success.append(_elem1003) + (_etype1008, _size1005) = iprot.readListBegin() + for _i1009 in xrange(_size1005): + _elem1010 = iprot.readString() + self.success.append(_elem1010) iprot.readListEnd() else: iprot.skip(ftype) @@ -29794,8 +30026,8 @@ class get_role_names_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter1004 in self.success: - oprot.writeString(iter1004) + for iter1011 in self.success: + oprot.writeString(iter1011) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -30309,11 +30541,11 @@ class list_roles_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype1008, _size1005) = iprot.readListBegin() - for _i1009 in xrange(_size1005): - _elem1010 = Role() - _elem1010.read(iprot) - self.success.append(_elem1010) + (_etype1015, _size1012) = iprot.readListBegin() + for _i1016 in xrange(_size1012): + _elem1017 = Role() + _elem1017.read(iprot) + self.success.append(_elem1017) iprot.readListEnd() else: iprot.skip(ftype) @@ -30336,8 +30568,8 @@ class list_roles_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter1011 in self.success: - iter1011.write(oprot) + for iter1018 in self.success: + iter1018.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -30846,10 +31078,10 @@ class get_privilege_set_args: elif fid == 3: if ftype == TType.LIST: self.group_names = [] - (_etype1015, _size1012) = iprot.readListBegin() - for _i1016 in xrange(_size1012): - _elem1017 = iprot.readString() - self.group_names.append(_elem1017) + (_etype1022, _size1019) = iprot.readListBegin() + for _i1023 in xrange(_size1019): + _elem1024 = iprot.readString() + self.group_names.append(_elem1024) iprot.readListEnd() else: iprot.skip(ftype) @@ -30874,8 +31106,8 @@ class get_privilege_set_args: if self.group_names is not None: oprot.writeFieldBegin('group_names', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.group_names)) - for iter1018 in self.group_names: - oprot.writeString(iter1018) + for iter1025 in self.group_names: + oprot.writeString(iter1025) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -31102,11 +31334,11 @@ class list_privileges_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype1022, _size1019) = iprot.readListBegin() - for _i1023 in xrange(_size1019): - _elem1024 = HiveObjectPrivilege() - _elem1024.read(iprot) - self.success.append(_elem1024) + (_etype1029, _size1026) = iprot.readListBegin() + for _i1030 in xrange(_size1026): + _elem1031 = HiveObjectPrivilege() + _elem1031.read(iprot) + self.success.append(_elem1031) iprot.readListEnd() else: iprot.skip(ftype) @@ -31129,8 +31361,8 @@ class list_privileges_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter1025 in self.success: - iter1025.write(oprot) + for iter1032 in self.success: + iter1032.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -31628,10 +31860,10 @@ class set_ugi_args: elif fid == 2: if ftype == TType.LIST: self.group_names = [] - (_etype1029, _size1026) = iprot.readListBegin() - for _i1030 in xrange(_size1026): - _elem1031 = iprot.readString() - self.group_names.append(_elem1031) + (_etype1036, _size1033) = iprot.readListBegin() + for _i1037 in xrange(_size1033): + _elem1038 = iprot.readString() + self.group_names.append(_elem1038) iprot.readListEnd() else: iprot.skip(ftype) @@ -31652,8 +31884,8 @@ class set_ugi_args: if self.group_names is not None: oprot.writeFieldBegin('group_names', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.group_names)) - for iter1032 in self.group_names: - oprot.writeString(iter1032) + for iter1039 in self.group_names: + oprot.writeString(iter1039) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -31708,10 +31940,10 @@ class set_ugi_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype1036, _size1033) = iprot.readListBegin() - for _i1037 in xrange(_size1033): - _elem1038 = iprot.readString() - self.success.append(_elem1038) + (_etype1043, _size1040) = iprot.readListBegin() + for _i1044 in xrange(_size1040): + _elem1045 = iprot.readString() + self.success.append(_elem1045) iprot.readListEnd() else: iprot.skip(ftype) @@ -31734,8 +31966,8 @@ class set_ugi_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter1039 in self.success: - oprot.writeString(iter1039) + for iter1046 in self.success: + oprot.writeString(iter1046) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -32667,10 +32899,10 @@ class get_all_token_identifiers_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype1043, _size1040) = iprot.readListBegin() - for _i1044 in xrange(_size1040): - _elem1045 = iprot.readString() - self.success.append(_elem1045) + (_etype1050, _size1047) = iprot.readListBegin() + for _i1051 in xrange(_size1047): + _elem1052 = iprot.readString() + self.success.append(_elem1052) iprot.readListEnd() else: iprot.skip(ftype) @@ -32687,8 +32919,8 @@ class get_all_token_identifiers_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter1046 in self.success: - oprot.writeString(iter1046) + for iter1053 in self.success: + oprot.writeString(iter1053) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -33215,10 +33447,10 @@ class get_master_keys_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype1050, _size1047) = iprot.readListBegin() - for _i1051 in xrange(_size1047): - _elem1052 = iprot.readString() - self.success.append(_elem1052) + (_etype1057, _size1054) = iprot.readListBegin() + for _i1058 in xrange(_size1054): + _elem1059 = iprot.readString() + self.success.append(_elem1059) iprot.readListEnd() else: iprot.skip(ftype) @@ -33235,8 +33467,8 @@ class get_master_keys_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter1053 in self.success: - oprot.writeString(iter1053) + for iter1060 in self.success: + oprot.writeString(iter1060) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop()
http://git-wip-us.apache.org/repos/asf/hive/blob/bbf5ecce/metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb ---------------------------------------------------------------------- diff --git a/metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb b/metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb index 7cdfc86..04e63f3 100644 --- a/metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb +++ b/metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb @@ -416,6 +416,21 @@ module ThriftHiveMetastore return end + def truncate_table(dbName, tableName, partNames) + send_truncate_table(dbName, tableName, partNames) + recv_truncate_table() + end + + def send_truncate_table(dbName, tableName, partNames) + send_message('truncate_table', Truncate_table_args, :dbName => dbName, :tableName => tableName, :partNames => partNames) + end + + def recv_truncate_table() + result = receive_message(Truncate_table_result) + raise result.o1 unless result.o1.nil? + return + end + def get_tables(db_name, pattern) send_get_tables(db_name, pattern) return recv_get_tables() @@ -2880,6 +2895,17 @@ module ThriftHiveMetastore write_result(result, oprot, 'drop_table_with_environment_context', seqid) end + def process_truncate_table(seqid, iprot, oprot) + args = read_args(iprot, Truncate_table_args) + result = Truncate_table_result.new() + begin + @handler.truncate_table(args.dbName, args.tableName, args.partNames) + rescue ::MetaException => o1 + result.o1 = o1 + end + write_result(result, oprot, 'truncate_table', seqid) + end + def process_get_tables(seqid, iprot, oprot) args = read_args(iprot, Get_tables_args) result = Get_tables_result.new() @@ -5326,6 +5352,42 @@ module ThriftHiveMetastore ::Thrift::Struct.generate_accessors self end + class Truncate_table_args + include ::Thrift::Struct, ::Thrift::Struct_Union + DBNAME = 1 + TABLENAME = 2 + PARTNAMES = 3 + + FIELDS = { + DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, + TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName'}, + PARTNAMES => {:type => ::Thrift::Types::LIST, :name => 'partNames', :element => {:type => ::Thrift::Types::STRING}} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Truncate_table_result + include ::Thrift::Struct, ::Thrift::Struct_Union + O1 = 1 + + FIELDS = { + 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_tables_args include ::Thrift::Struct, ::Thrift::Struct_Union DB_NAME = 1 http://git-wip-us.apache.org/repos/asf/hive/blob/bbf5ecce/metastore/src/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java ---------------------------------------------------------------------- diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java index 77b3541..d2abdff 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java @@ -272,7 +272,7 @@ public class HiveAlterHandler implements AlterHandler { if (transactionalListeners != null && !transactionalListeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(transactionalListeners, EventMessage.EventType.ALTER_TABLE, - new AlterTableEvent(oldt, newt, true, handler), + new AlterTableEvent(oldt, newt, false, true, handler), environmentContext); } // commit the changes @@ -384,7 +384,7 @@ public class HiveAlterHandler implements AlterHandler { if (transactionalListeners != null && !transactionalListeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(transactionalListeners, EventMessage.EventType.ALTER_PARTITION, - new AlterPartitionEvent(oldPart, new_part, tbl, true, handler), + new AlterPartitionEvent(oldPart, new_part, tbl, false, true, handler), environmentContext); @@ -503,7 +503,7 @@ public class HiveAlterHandler implements AlterHandler { if (transactionalListeners != null && !transactionalListeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(transactionalListeners, EventMessage.EventType.ALTER_PARTITION, - new AlterPartitionEvent(oldPart, new_part, tbl, true, handler), + new AlterPartitionEvent(oldPart, new_part, tbl, false, true, handler), environmentContext); } @@ -536,7 +536,7 @@ public class HiveAlterHandler implements AlterHandler { if (transactionalListeners != null && !transactionalListeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(transactionalListeners, EventMessage.EventType.ALTER_PARTITION, - new AlterPartitionEvent(new_part, oldPart, tbl, success, handler), + new AlterPartitionEvent(new_part, oldPart, tbl, false, success, handler), environmentContext); } @@ -625,7 +625,7 @@ public class HiveAlterHandler implements AlterHandler { if (transactionalListeners != null && !transactionalListeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(transactionalListeners, EventMessage.EventType.ALTER_PARTITION, - new AlterPartitionEvent(oldPart, newPart, tbl, true, handler)); + new AlterPartitionEvent(oldPart, newPart, tbl, false, true, handler)); } } http://git-wip-us.apache.org/repos/asf/hive/blob/bbf5ecce/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java ---------------------------------------------------------------------- diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index 557ae5a..cbcfc72 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -63,6 +63,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Multimaps; import org.apache.commons.cli.OptionBuilder; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hive.common.FileUtils; @@ -80,6 +81,7 @@ import org.apache.hadoop.hive.common.metrics.common.MetricsFactory; import org.apache.hadoop.hive.common.metrics.common.MetricsVariable; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.conf.HiveConf.ConfVars; +import org.apache.hadoop.hive.io.HdfsUtils; import org.apache.hadoop.hive.metastore.api.*; import org.apache.hadoop.hive.metastore.events.AddIndexEvent; import org.apache.hadoop.hive.metastore.events.AddPartitionEvent; @@ -1898,6 +1900,151 @@ public class HiveMetaStore extends ThriftHiveMetastore { } + private void updateStatsForTruncate(Map<String,String> props, EnvironmentContext environmentContext) { + if (null == props) { + return; + } + for (String stat : StatsSetupConst.supportedStats) { + String statVal = props.get(stat); + if (statVal != null) { + //In the case of truncate table, we set the stats to be 0. + props.put(stat, "0"); + } + } + //first set basic stats to true + StatsSetupConst.setBasicStatsState(props, StatsSetupConst.TRUE); + environmentContext.putToProperties(StatsSetupConst.STATS_GENERATED, StatsSetupConst.TASK); + //then invalidate column stats + StatsSetupConst.clearColumnStatsState(props); + return; + } + + private void alterPartitionForTruncate(final RawStore ms, + final String dbName, + final String tableName, + final Table table, + final Partition partition) throws Exception { + EnvironmentContext environmentContext = new EnvironmentContext(); + updateStatsForTruncate(partition.getParameters(), environmentContext); + + if (!transactionalListeners.isEmpty()) { + MetaStoreListenerNotifier.notifyEvent(transactionalListeners, + EventType.ALTER_PARTITION, + new AlterPartitionEvent(partition, partition, table, true, true, this)); + } + + if (!listeners.isEmpty()) { + MetaStoreListenerNotifier.notifyEvent(listeners, + EventType.ALTER_PARTITION, + new AlterPartitionEvent(partition, partition, table, true, true, this)); + } + + alterHandler.alterPartition(ms, wh, dbName, tableName, null, partition, environmentContext, this); + } + + private void alterTableStatsForTruncate(final RawStore ms, + final String dbName, + final String tableName, + final Table table, + final List<String> partNames) throws Exception { + if (partNames == null) { + if (0 != table.getPartitionKeysSize()) { + for (Partition partition : ms.getPartitions(dbName, tableName, Integer.MAX_VALUE)) { + alterPartitionForTruncate(ms, dbName, tableName, table, partition); + } + } else { + EnvironmentContext environmentContext = new EnvironmentContext(); + updateStatsForTruncate(table.getParameters(), environmentContext); + + if (!transactionalListeners.isEmpty()) { + MetaStoreListenerNotifier.notifyEvent(transactionalListeners, + EventType.ALTER_TABLE, + new AlterTableEvent(table, table, true, true, this)); + } + + if (!listeners.isEmpty()) { + MetaStoreListenerNotifier.notifyEvent(listeners, + EventType.ALTER_TABLE, + new AlterTableEvent(table, table, true, true, this)); + } + + alterHandler.alterTable(ms, wh, dbName, tableName, table, environmentContext, this); + } + } else { + for (Partition partition : ms.getPartitionsByNames(dbName, tableName, partNames)) { + alterPartitionForTruncate(ms, dbName, tableName, table, partition); + } + } + return; + } + + private List<Path> getLocationsForTruncate(final RawStore ms, + final String dbName, + final String tableName, + final Table table, + final List<String> partNames) throws Exception { + List<Path> locations = new ArrayList<Path>(); + if (partNames == null) { + if (0 != table.getPartitionKeysSize()) { + for (Partition partition : ms.getPartitions(dbName, tableName, Integer.MAX_VALUE)) { + locations.add(new Path(partition.getSd().getLocation())); + } + } else { + locations.add(new Path(table.getSd().getLocation())); + } + } else { + for (Partition partition : ms.getPartitionsByNames(dbName, tableName, partNames)) { + locations.add(new Path(partition.getSd().getLocation())); + } + } + return locations; + } + + @Override + public void truncate_table(final String dbName, final String tableName, List<String> partNames) + throws NoSuchObjectException, MetaException { + try { + Table tbl = get_table_core(dbName, tableName); + boolean isAutopurge = (tbl.isSetParameters() && "true".equalsIgnoreCase(tbl.getParameters().get("auto.purge"))); + + // This is not transactional + for (Path location : getLocationsForTruncate(getMS(), dbName, tableName, tbl, partNames)) { + FileSystem fs = location.getFileSystem(getHiveConf()); + HadoopShims.HdfsEncryptionShim shim + = ShimLoader.getHadoopShims().createHdfsEncryptionShim(fs, getHiveConf()); + if (!shim.isPathEncrypted(location)) { + HdfsUtils.HadoopFileStatus status = new HdfsUtils.HadoopFileStatus(getHiveConf(), fs, location); + FileStatus targetStatus = fs.getFileStatus(location); + String targetGroup = targetStatus == null ? null : targetStatus.getGroup(); + wh.deleteDir(location, true, isAutopurge); + fs.mkdirs(location); + HdfsUtils.setFullFileStatus(getHiveConf(), status, targetGroup, fs, location, false); + } else { + FileStatus[] statuses = fs.listStatus(location, FileUtils.HIDDEN_FILES_PATH_FILTER); + if (statuses == null || statuses.length == 0) { + continue; + } + for (final FileStatus status : statuses) { + wh.deleteDir(status.getPath(), true, isAutopurge); + } + } + } + + // Alter the table/partition stats and also notify truncate table event + alterTableStatsForTruncate(getMS(), dbName, tableName, tbl, partNames); + } catch (IOException e) { + throw new MetaException(e.getMessage()); + } catch (Exception e) { + if (e instanceof MetaException) { + throw (MetaException) e; + } else if (e instanceof NoSuchObjectException) { + throw (NoSuchObjectException) e; + } else { + throw newMetaException(e); + } + } + } + /** * Is this an external table? * @@ -3731,7 +3878,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { MetaStoreListenerNotifier.notifyEvent(listeners, EventType.ALTER_PARTITION, - new AlterPartitionEvent(oldPart, new_part, table, true, this), + new AlterPartitionEvent(oldPart, new_part, table, false, true, this), envContext); } } catch (InvalidObjectException e) { @@ -3804,7 +3951,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { if (!listeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(listeners, EventType.ALTER_PARTITION, - new AlterPartitionEvent(oldTmpPart, tmpPart, table, true, this)); + new AlterPartitionEvent(oldTmpPart, tmpPart, table, false, true, this)); } } } catch (InvalidObjectException e) { @@ -3950,7 +4097,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { if (!listeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(listeners, EventType.ALTER_TABLE, - new AlterTableEvent(oldt, newTable, true, this), + new AlterTableEvent(oldt, newTable, false, true, this), envContext); } } catch (NoSuchObjectException e) { http://git-wip-us.apache.org/repos/asf/hive/blob/bbf5ecce/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java ---------------------------------------------------------------------- diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java index dcb14e8..53f8118 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java @@ -1093,6 +1093,23 @@ public class HiveMetaStoreClient implements IMetaStoreClient { } /** + * Truncate the table/partitions in the DEFAULT database. + * @param dbName + * The db to which the table to be truncate belongs to + * @param tableName + * The table to truncate + * @param partNames + * List of partitions to truncate. NULL will truncate the whole table/all partitions + * @throws MetaException + * @throws TException + * Could not truncate table properly. + */ + @Override + public void truncateTable(String dbName, String tableName, List<String> partNames) throws MetaException, TException { + client.truncate_table(dbName, tableName, partNames); + } + + /** * @param type * @return true if the type is dropped * @throws MetaException http://git-wip-us.apache.org/repos/asf/hive/blob/bbf5ecce/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java ---------------------------------------------------------------------- diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java b/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java index e9df1e1..023a289 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java @@ -304,6 +304,20 @@ public interface IMetaStoreClient { void dropTable(String dbname, String tableName) throws MetaException, TException, NoSuchObjectException; + /** + * Truncate the table/partitions in the DEFAULT database. + * @param dbName + * The db to which the table to be truncate belongs to + * @param tableName + * The table to truncate + * @param partNames + * List of partitions to truncate. NULL will truncate the whole table/all partitions + * @throws MetaException + * @throws TException + * Could not truncate table properly. + */ + void truncateTable(String dbName, String tableName, List<String> partNames) throws MetaException, TException; + boolean tableExists(String databaseName, String tableName) throws MetaException, TException, UnknownDBException; http://git-wip-us.apache.org/repos/asf/hive/blob/bbf5ecce/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreEventListener.java ---------------------------------------------------------------------- diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreEventListener.java b/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreEventListener.java index b0defb5..868e5a5 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreEventListener.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreEventListener.java @@ -75,19 +75,17 @@ public abstract class MetaStoreEventListener implements Configurable { } /** - * @param add partition event - * @throws MetaException - */ - - /** * @param tableEvent alter table event * @throws MetaException */ public void onAlterTable (AlterTableEvent tableEvent) throws MetaException { } - public void onAddPartition (AddPartitionEvent partitionEvent) - throws MetaException { + /** + * @param partitionEvent add partition event + * @throws MetaException + */ + public void onAddPartition (AddPartitionEvent partitionEvent) throws MetaException { } /**