Index: metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java =================================================================== --- metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java (revision 1145366) +++ metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java (working copy) @@ -459,6 +459,143 @@ } } + public void testRenamePartition() throws Throwable { + + try { + String dbName = "compdb1"; + String tblName = "comptbl1"; + List vals = new ArrayList(2); + vals.add("2011-07-11"); + vals.add("8"); + String part_path = "/ds=2011-07-11/hr=8"; + List tmp_vals = new ArrayList(2); + tmp_vals.add("tmp_2011-07-11"); + tmp_vals.add("-8"); + + client.dropTable(dbName, tblName); + silentDropDatabase(dbName); + Database db = new Database(); + db.setName(dbName); + db.setDescription("Rename Partition Test database"); + client.createDatabase(db); + + ArrayList cols = new ArrayList(2); + cols.add(new FieldSchema("name", Constants.STRING_TYPE_NAME, "")); + cols.add(new FieldSchema("income", Constants.INT_TYPE_NAME, "")); + + Table tbl = new Table(); + tbl.setDbName(dbName); + tbl.setTableName(tblName); + StorageDescriptor sd = new StorageDescriptor(); + tbl.setSd(sd); + sd.setCols(cols); + sd.setCompressed(false); + sd.setNumBuckets(1); + sd.setParameters(new HashMap()); + sd.getParameters().put("test_param_1", "Use this for comments etc"); + sd.setBucketCols(new ArrayList(2)); + sd.getBucketCols().add("name"); + sd.setSerdeInfo(new SerDeInfo()); + sd.getSerdeInfo().setName(tbl.getTableName()); + sd.getSerdeInfo().setParameters(new HashMap()); + sd.getSerdeInfo().getParameters() + .put(Constants.SERIALIZATION_FORMAT, "1"); + sd.setSortCols(new ArrayList()); + + tbl.setPartitionKeys(new ArrayList(2)); + tbl.getPartitionKeys().add( + new FieldSchema("ds", Constants.STRING_TYPE_NAME, "")); + tbl.getPartitionKeys().add( + new FieldSchema("hr", Constants.INT_TYPE_NAME, "")); + + client.createTable(tbl); + + if (isThriftClient) { + // the createTable() above does not update the location in the 'tbl' + // object when the client is a thrift client and the code below relies + // on the location being present in the 'tbl' object - so get the table + // from the metastore + tbl = client.getTable(dbName, tblName); + } + + Partition part = new Partition(); + part.setDbName(dbName); + part.setTableName(tblName); + part.setValues(vals); + part.setParameters(new HashMap()); + part.setSd(tbl.getSd().deepCopy()); + part.getSd().setSerdeInfo(tbl.getSd().getSerdeInfo()); + part.getSd().setLocation(tbl.getSd().getLocation() + "/part1"); + part.getParameters().put("retention", "10"); + part.getSd().setNumBuckets(12); + part.getSd().getSerdeInfo().getParameters().put("abc", "1"); + + client.add_partition(part); + + Partition part2 = new Partition(); + part2.setDbName(dbName); + part2.setTableName(tblName); + part2.setValues(tmp_vals); + part2.setParameters(new HashMap()); + part2.setSd(tbl.getSd().deepCopy()); + part2.getSd().setSerdeInfo(tbl.getSd().getSerdeInfo()); + part2.getSd().setLocation(tbl.getSd().getLocation() + "/part2"); + + client.renamePartition(dbName, tblName, part.getValues(), part2); + + boolean exceptionThrown = false; + try { + Partition p = client.getPartition(dbName, tblName, vals); + } catch(Exception e) { + assertEquals("partition should not have existed", + NoSuchObjectException.class, e.getClass()); + exceptionThrown = true; + } + assertTrue("Expected NoSuchObjectException", exceptionThrown); + + Partition part3 = client.getPartition(dbName, tblName, tmp_vals); + assertEquals("couldn't rename partition", part3.getParameters().get( + "retention"), "10"); + assertEquals("couldn't rename partition", part3.getSd().getSerdeInfo() + .getParameters().get("abc"), "1"); + assertEquals("couldn't rename partition", part3.getSd().getNumBuckets(), + 12); + assertEquals("new partition sd matches", part3.getSd().getLocation(), + part2.getSd().getLocation()); + + part.setSd(null); + client.renamePartition(dbName, tblName, tmp_vals, part); + + exceptionThrown = false; + try { + Partition p = client.getPartition(dbName, tblName, tmp_vals); + } catch(Exception e) { + assertEquals("partition should not have existed", + NoSuchObjectException.class, e.getClass()); + exceptionThrown = true; + } + assertTrue("Expected NoSuchObjectException", exceptionThrown); + + part3 = client.getPartition(dbName, tblName, vals); + assertEquals("couldn't rename partition", part3.getParameters().get( + "retention"), "10"); + assertEquals("couldn't rename partition", part3.getSd().getSerdeInfo() + .getParameters().get("abc"), "1"); + assertEquals("couldn't rename partition", part3.getSd().getNumBuckets(), + 12); + assertEquals("new partition sd matches", part3.getSd().getLocation(), + tbl.getSd().getLocation() + part_path); + + client.dropTable(dbName, tblName); + + client.dropDatabase(dbName); + } catch (Exception e) { + System.err.println(StringUtils.stringifyException(e)); + System.err.println("testPartition() failed."); + throw e; + } + } + public void testDatabase() throws Throwable { try { // clear up any existing databases Index: metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java (revision 1145366) +++ metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java (working copy) @@ -144,6 +144,9 @@ public abstract void alterPartition(String db_name, String tbl_name, Partition new_part) throws InvalidObjectException, MetaException; + public abstract void renamePartition(String db_name, String tbl_name, + List part_values, Partition new_part) throws InvalidObjectException, MetaException; + public abstract boolean addIndex(Index index) throws InvalidObjectException, MetaException; @@ -286,6 +289,6 @@ public abstract List listPartitionsPsWithAuth(String db_name, String tbl_name, List part_vals, short max_parts, String userName, List groupNames) throws MetaException, InvalidObjectException; - + public abstract long cleanupEvents(); } Index: metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java (revision 1145366) +++ metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java (working copy) @@ -495,6 +495,31 @@ throws InvalidOperationException, MetaException, TException; /** + * rename a partition to a new partition + * + * @param dbname + * database of the old partition + * @param name + * table name of the old partition + * @param part_vals + * values of the old partition + * @param new_part + * new partition + * @throws InvalidOperationException + * if srcFs and destFs are different + * @throws InvalidObjectException + * if the old partition does not exist + * @throws AlreadyExistsException + * if the new partition already exists + * @throws MetaException + * if error in updating metadata + * @throws TException + * if error in communicating with metastore server + */ + public void renamePartition(final String dbname, final String name, final List part_vals, Partition new_part) + throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException, TException; + + /** * @param db * @param tableName * @throws UnknownTableException Index: metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java (revision 1145366) +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java (working copy) @@ -168,6 +168,26 @@ client.alter_table(dbname, tbl_name, new_tbl); } + /** + * @param dbname + * @param name + * @param part_vals + * @param new_part + * @throws InvalidOperationException + * @throws InvalidObjectException + * @throws AlreadyExistsException + * @throws MetaException + * @throws TException + * @see org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#rename_partition( + * java.lang.String, java.lang.String, java.util.List, + * org.apache.hadoop.hive.metastore.api.Partition) + */ + public void renamePartition(final String dbname, final String name, final List part_vals, Partition new_part) + throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException, + TException { + client.rename_partition(dbname, name, part_vals, new_part); + } + private void open() throws MetaException { for (URI store : metastoreUris) { LOG.info("Trying to connect to metastore with URI " + store); Index: metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (revision 1145366) +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (working copy) @@ -37,6 +37,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hive.common.JavaUtils; import org.apache.hadoop.hive.common.classification.InterfaceAudience; @@ -1783,6 +1784,174 @@ return; } + private void rename_partition_core(final RawStore ms, final String dbname, final String name, final List part_vals, final Partition new_part) + throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException { + boolean success = false; + + Path srcPath = null; + Path destPath = null; + FileSystem srcFs = null; + FileSystem destFs = null; + Table tbl = null; + Partition old_part = null; + + String oldPartLoc = null; + String newPartLoc = null; + + try { + ms.openTransaction(); + try { + old_part = ms.getPartition(dbname, name, part_vals); + } catch (NoSuchObjectException e) { + // this means there is no existing partition + throw new InvalidObjectException( + "Unable to rename partition because old partition does not exist"); + } + if (dbname.compareTo(new_part.getDbName()) != 0 || + name.compareTo(new_part.getTableName()) != 0) { + throw new InvalidObjectException( + "Unable to rename partition because two partitions don't have the same db/table names"); + } + + Partition check_part = null; + try { + check_part = ms.getPartition(new_part.getDbName(), new_part + .getTableName(), new_part.getValues()); + } catch(NoSuchObjectException e) { + // this means there is no existing partition + check_part = null; + } + if (check_part != null) { + throw new AlreadyExistsException("Partition already exists:" + new_part); + } + tbl = ms.getTable(dbname, name); + if (tbl == null) { + throw new InvalidObjectException( + "Unable to rename partition because table or database do not exist"); + } + if (new_part.getSd() != null) { + newPartLoc = new_part.getSd().getLocation(); + } + else { + new_part.setSd(tbl.getSd().deepCopy()); + } + + if (newPartLoc == null || newPartLoc.isEmpty()) { + // set default location if not specified and this is + // a physical table partition (not a view) + if (tbl.getSd().getLocation() != null) { + destPath = new Path(tbl.getSd().getLocation(), Warehouse + .makePartName(tbl.getPartitionKeys(), new_part.getValues())); + } + } else { + if (tbl.getSd().getLocation() == null) { + throw new MetaException( + "Cannot specify location for a view partition"); + } + destPath = wh.getDnsPath(new Path(newPartLoc)); + } + + if (destPath != null) { + new_part.getSd().setLocation(destPath.toString()); + oldPartLoc = old_part.getSd().getLocation(); + srcPath = new Path(oldPartLoc); + + LOG.info("srcPath:" + oldPartLoc); + LOG.info("descPath:" + destPath.toString()); + srcFs = wh.getFs(srcPath); + destFs = wh.getFs(destPath); + // check that src and dest are on the same file system + if (srcFs != destFs) { + throw new InvalidOperationException("table new location " + destPath + + " is on a different file system than the old location " + + srcPath + ". This operation is not supported"); + } + try { + srcFs.exists(srcPath); // check that src exists and also checks + if (destFs.exists(destPath)) { + throw new InvalidOperationException("New location for this table " + + tbl.getDbName() + "." + tbl.getTableName() + + " already exists : " + destPath); + } + } catch (IOException e) { + Warehouse.closeFs(srcFs); + Warehouse.closeFs(destFs); + throw new InvalidOperationException("Unable to access new location " + + destPath + " for partition " + tbl.getDbName() + "." + + tbl.getTableName() + " " + new_part.getValues()); + } + // Set DDL time to now if not specified + if (new_part.getParameters() == null || + new_part.getParameters().get(Constants.DDL_TIME) == null || + Integer.parseInt(new_part.getParameters().get(Constants.DDL_TIME)) == 0) { + new_part.putToParameters(Constants.DDL_TIME, Long.toString(System + .currentTimeMillis() / 1000)); + } + ms.renamePartition(dbname, name, part_vals, new_part); + } + + success = ms.commitTransaction(); + } finally { + if (!success) { + ms.rollbackTransaction(); + } + if (success) { + try { + if (srcFs.exists(srcPath)) { + // rename the src to destination + srcFs.rename(srcPath, destPath); + LOG.info("rename done!"); + } + } catch (IOException e) { + boolean revertMetaDataTransaction = false; + try { + ms.openTransaction(); + ms.renamePartition(dbname, name, new_part.getValues(), old_part); + revertMetaDataTransaction = ms.commitTransaction(); + } catch (Exception e1) { + LOG.error("Reverting metadata opeation failed During HDFS operation failed", e1); + if (!revertMetaDataTransaction) { + ms.rollbackTransaction(); + } + } + throw new InvalidOperationException("Unable to access old location " + + srcPath + " for partition " + tbl.getDbName() + "." + + tbl.getTableName() + " " + part_vals); + } + } + } + } + + public void rename_partition(final String dbname, final String name, final List part_vals, final Partition new_part) + throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException { + startTableFunction("rename_partition", dbname, name); + LOG.info("Old Partition values:" + part_vals); + LOG.info("New Partition values:" + new_part.getValues()); + + try { + executeWithRetry(new Command() { + @Override + public Boolean run(RawStore ms) throws Exception { + rename_partition_core(ms, dbname, name, part_vals, new_part); + return Boolean.TRUE; + } + }); + } catch (InvalidObjectException e) { + throw e; + } catch (AlreadyExistsException e) { + throw e; + } catch (MetaException e) { + throw e; + } catch (Exception e) { + assert(e instanceof RuntimeException); + throw (RuntimeException)e; + } finally { + endFunction("rename_partition"); + } + return; + } + + public boolean create_index(Index index_def) throws IndexAlreadyExistsException, MetaException { endFunction(startFunction("create_index")); Index: metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java (revision 1145366) +++ metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java (working copy) @@ -1704,6 +1704,33 @@ } } + public void renamePartition(String dbname, String name, List part_vals, Partition newPart) + throws InvalidObjectException, MetaException { + boolean success = false; + try { + openTransaction(); + name = name.toLowerCase(); + dbname = dbname.toLowerCase(); + MPartition oldp = getMPartition(dbname, name, part_vals); + MPartition newp = convertToMPart(newPart); + if (oldp == null || newp == null) { + throw new InvalidObjectException("partition does not exist."); + } + + oldp.getSd().setLocation(newp.getSd().getLocation()); + oldp.setValues(newp.getValues()); + oldp.setPartitionName(newp.getPartitionName()); + + success = commitTransaction(); + } finally { + if (!success) { + rollbackTransaction(); + throw new MetaException( + "The transaction for alter partition did not commit successfully."); + } + } + } + public void alterPartition(String dbname, String name, Partition newPart) throws InvalidObjectException, MetaException { boolean success = false; Index: metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py =================================================================== --- metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py (revision 1145366) +++ metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py (working copy) @@ -161,6 +161,16 @@ """ pass + def rename_partition(self, dbname, name, part_vals, new_part): + """ + Parameters: + - dbname + - name + - part_vals + - new_part + """ + pass + def add_partition(self, new_part): """ Parameters: @@ -1188,6 +1198,48 @@ raise result.o2 return + def rename_partition(self, dbname, name, part_vals, new_part): + """ + Parameters: + - dbname + - name + - part_vals + - new_part + """ + self.send_rename_partition(dbname, name, part_vals, new_part) + self.recv_rename_partition() + + def send_rename_partition(self, dbname, name, part_vals, new_part): + self._oprot.writeMessageBegin('rename_partition', TMessageType.CALL, self._seqid) + args = rename_partition_args() + args.dbname = dbname + args.name = name + args.part_vals = part_vals + args.new_part = new_part + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_rename_partition(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = rename_partition_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.o1 != None: + raise result.o1 + if result.o2 != None: + raise result.o2 + if result.o3 != None: + raise result.o3 + if result.o4 != None: + raise result.o4 + return + def add_partition(self, new_part): """ Parameters: @@ -2730,6 +2782,7 @@ self._processMap["get_table"] = Processor.process_get_table self._processMap["get_table_objects_by_name"] = Processor.process_get_table_objects_by_name self._processMap["alter_table"] = Processor.process_alter_table + self._processMap["rename_partition"] = Processor.process_rename_partition self._processMap["add_partition"] = Processor.process_add_partition self._processMap["append_partition"] = Processor.process_append_partition self._processMap["append_partition_by_name"] = Processor.process_append_partition_by_name @@ -3097,6 +3150,26 @@ oprot.writeMessageEnd() oprot.trans.flush() + def process_rename_partition(self, seqid, iprot, oprot): + args = rename_partition_args() + args.read(iprot) + iprot.readMessageEnd() + result = rename_partition_result() + try: + self._handler.rename_partition(args.dbname, args.name, args.part_vals, args.new_part) + except InvalidOperationException, o1: + result.o1 = o1 + except InvalidObjectException, o2: + result.o2 = o2 + except AlreadyExistsException, o3: + result.o3 = o3 + except MetaException, o4: + result.o4 = o4 + oprot.writeMessageBegin("rename_partition", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_add_partition(self, seqid, iprot, oprot): args = add_partition_args() args.read(iprot) @@ -6642,6 +6715,209 @@ def __ne__(self, other): return not (self == other) +class rename_partition_args: + """ + Attributes: + - dbname + - name + - part_vals + - new_part + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'dbname', None, None, ), # 1 + (2, TType.STRING, 'name', None, None, ), # 2 + (3, TType.LIST, 'part_vals', (TType.STRING,None), None, ), # 3 + (4, TType.STRUCT, 'new_part', (Partition, Partition.thrift_spec), None, ), # 4 + ) + + def __init__(self, dbname=None, name=None, part_vals=None, new_part=None,): + self.dbname = dbname + self.name = name + self.part_vals = part_vals + self.new_part = new_part + + 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.name = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.part_vals = [] + (_etype242, _size239) = iprot.readListBegin() + for _i243 in xrange(_size239): + _elem244 = iprot.readString(); + self.part_vals.append(_elem244) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRUCT: + self.new_part = Partition() + self.new_part.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('rename_partition_args') + if self.dbname != None: + oprot.writeFieldBegin('dbname', TType.STRING, 1) + oprot.writeString(self.dbname) + oprot.writeFieldEnd() + if self.name != None: + oprot.writeFieldBegin('name', TType.STRING, 2) + oprot.writeString(self.name) + oprot.writeFieldEnd() + if self.part_vals != None: + oprot.writeFieldBegin('part_vals', TType.LIST, 3) + oprot.writeListBegin(TType.STRING, len(self.part_vals)) + for iter245 in self.part_vals: + oprot.writeString(iter245) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.new_part != None: + oprot.writeFieldBegin('new_part', TType.STRUCT, 4) + self.new_part.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 rename_partition_result: + """ + Attributes: + - o1 + - o2 + - o3 + - o4 + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'o1', (InvalidOperationException, InvalidOperationException.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'o2', (InvalidObjectException, InvalidObjectException.thrift_spec), None, ), # 2 + (3, TType.STRUCT, 'o3', (AlreadyExistsException, AlreadyExistsException.thrift_spec), None, ), # 3 + (4, TType.STRUCT, 'o4', (MetaException, MetaException.thrift_spec), None, ), # 4 + ) + + def __init__(self, o1=None, o2=None, o3=None, o4=None,): + self.o1 = o1 + self.o2 = o2 + self.o3 = o3 + self.o4 = o4 + + 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 = InvalidOperationException() + self.o1.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.o2 = InvalidObjectException() + self.o2.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.o3 = AlreadyExistsException() + self.o3.read(iprot) + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRUCT: + self.o4 = MetaException() + self.o4.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('rename_partition_result') + if self.o1 != None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) + oprot.writeFieldEnd() + if self.o2 != None: + oprot.writeFieldBegin('o2', TType.STRUCT, 2) + self.o2.write(oprot) + oprot.writeFieldEnd() + if self.o3 != None: + oprot.writeFieldBegin('o3', TType.STRUCT, 3) + self.o3.write(oprot) + oprot.writeFieldEnd() + if self.o4 != None: + oprot.writeFieldBegin('o4', TType.STRUCT, 4) + self.o4.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 add_partition_args: """ Attributes: @@ -6842,10 +7118,10 @@ elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype242, _size239) = iprot.readListBegin() - for _i243 in xrange(_size239): - _elem244 = iprot.readString(); - self.part_vals.append(_elem244) + (_etype249, _size246) = iprot.readListBegin() + for _i250 in xrange(_size246): + _elem251 = iprot.readString(); + self.part_vals.append(_elem251) iprot.readListEnd() else: iprot.skip(ftype) @@ -6870,8 +7146,8 @@ if self.part_vals != None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter245 in self.part_vals: - oprot.writeString(iter245) + for iter252 in self.part_vals: + oprot.writeString(iter252) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -7215,10 +7491,10 @@ elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype249, _size246) = iprot.readListBegin() - for _i250 in xrange(_size246): - _elem251 = iprot.readString(); - self.part_vals.append(_elem251) + (_etype256, _size253) = iprot.readListBegin() + for _i257 in xrange(_size253): + _elem258 = iprot.readString(); + self.part_vals.append(_elem258) iprot.readListEnd() else: iprot.skip(ftype) @@ -7248,8 +7524,8 @@ if self.part_vals != None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter252 in self.part_vals: - oprot.writeString(iter252) + for iter259 in self.part_vals: + oprot.writeString(iter259) oprot.writeListEnd() oprot.writeFieldEnd() if self.deleteData != None: @@ -7578,10 +7854,10 @@ elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype256, _size253) = iprot.readListBegin() - for _i257 in xrange(_size253): - _elem258 = iprot.readString(); - self.part_vals.append(_elem258) + (_etype263, _size260) = iprot.readListBegin() + for _i264 in xrange(_size260): + _elem265 = iprot.readString(); + self.part_vals.append(_elem265) iprot.readListEnd() else: iprot.skip(ftype) @@ -7606,8 +7882,8 @@ if self.part_vals != None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter259 in self.part_vals: - oprot.writeString(iter259) + for iter266 in self.part_vals: + oprot.writeString(iter266) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -7760,10 +8036,10 @@ elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype263, _size260) = iprot.readListBegin() - for _i264 in xrange(_size260): - _elem265 = iprot.readString(); - self.part_vals.append(_elem265) + (_etype270, _size267) = iprot.readListBegin() + for _i271 in xrange(_size267): + _elem272 = iprot.readString(); + self.part_vals.append(_elem272) iprot.readListEnd() else: iprot.skip(ftype) @@ -7775,10 +8051,10 @@ elif fid == 5: if ftype == TType.LIST: self.group_names = [] - (_etype269, _size266) = iprot.readListBegin() - for _i270 in xrange(_size266): - _elem271 = iprot.readString(); - self.group_names.append(_elem271) + (_etype276, _size273) = iprot.readListBegin() + for _i277 in xrange(_size273): + _elem278 = iprot.readString(); + self.group_names.append(_elem278) iprot.readListEnd() else: iprot.skip(ftype) @@ -7803,8 +8079,8 @@ if self.part_vals != None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter272 in self.part_vals: - oprot.writeString(iter272) + for iter279 in self.part_vals: + oprot.writeString(iter279) oprot.writeListEnd() oprot.writeFieldEnd() if self.user_name != None: @@ -7814,8 +8090,8 @@ if self.group_names != None: oprot.writeFieldBegin('group_names', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.group_names)) - for iter273 in self.group_names: - oprot.writeString(iter273) + for iter280 in self.group_names: + oprot.writeString(iter280) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -8202,11 +8478,11 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype277, _size274) = iprot.readListBegin() - for _i278 in xrange(_size274): - _elem279 = Partition() - _elem279.read(iprot) - self.success.append(_elem279) + (_etype284, _size281) = iprot.readListBegin() + for _i285 in xrange(_size281): + _elem286 = Partition() + _elem286.read(iprot) + self.success.append(_elem286) iprot.readListEnd() else: iprot.skip(ftype) @@ -8235,8 +8511,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter280 in self.success: - iter280.write(oprot) + for iter287 in self.success: + iter287.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -8322,10 +8598,10 @@ elif fid == 5: if ftype == TType.LIST: self.group_names = [] - (_etype284, _size281) = iprot.readListBegin() - for _i285 in xrange(_size281): - _elem286 = iprot.readString(); - self.group_names.append(_elem286) + (_etype291, _size288) = iprot.readListBegin() + for _i292 in xrange(_size288): + _elem293 = iprot.readString(); + self.group_names.append(_elem293) iprot.readListEnd() else: iprot.skip(ftype) @@ -8358,8 +8634,8 @@ if self.group_names != None: oprot.writeFieldBegin('group_names', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.group_names)) - for iter287 in self.group_names: - oprot.writeString(iter287) + for iter294 in self.group_names: + oprot.writeString(iter294) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -8410,11 +8686,11 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype291, _size288) = iprot.readListBegin() - for _i292 in xrange(_size288): - _elem293 = Partition() - _elem293.read(iprot) - self.success.append(_elem293) + (_etype298, _size295) = iprot.readListBegin() + for _i299 in xrange(_size295): + _elem300 = Partition() + _elem300.read(iprot) + self.success.append(_elem300) iprot.readListEnd() else: iprot.skip(ftype) @@ -8443,8 +8719,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter294 in self.success: - iter294.write(oprot) + for iter301 in self.success: + iter301.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -8583,10 +8859,10 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype298, _size295) = iprot.readListBegin() - for _i299 in xrange(_size295): - _elem300 = iprot.readString(); - self.success.append(_elem300) + (_etype305, _size302) = iprot.readListBegin() + for _i306 in xrange(_size302): + _elem307 = iprot.readString(); + self.success.append(_elem307) iprot.readListEnd() else: iprot.skip(ftype) @@ -8609,8 +8885,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter301 in self.success: - oprot.writeString(iter301) + for iter308 in self.success: + oprot.writeString(iter308) oprot.writeListEnd() oprot.writeFieldEnd() if self.o2 != None: @@ -8679,10 +8955,10 @@ elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype305, _size302) = iprot.readListBegin() - for _i306 in xrange(_size302): - _elem307 = iprot.readString(); - self.part_vals.append(_elem307) + (_etype312, _size309) = iprot.readListBegin() + for _i313 in xrange(_size309): + _elem314 = iprot.readString(); + self.part_vals.append(_elem314) iprot.readListEnd() else: iprot.skip(ftype) @@ -8712,8 +8988,8 @@ if self.part_vals != None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter308 in self.part_vals: - oprot.writeString(iter308) + for iter315 in self.part_vals: + oprot.writeString(iter315) oprot.writeListEnd() oprot.writeFieldEnd() if self.max_parts != None: @@ -8765,11 +9041,11 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype312, _size309) = iprot.readListBegin() - for _i313 in xrange(_size309): - _elem314 = Partition() - _elem314.read(iprot) - self.success.append(_elem314) + (_etype319, _size316) = iprot.readListBegin() + for _i320 in xrange(_size316): + _elem321 = Partition() + _elem321.read(iprot) + self.success.append(_elem321) iprot.readListEnd() else: iprot.skip(ftype) @@ -8792,8 +9068,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter315 in self.success: - iter315.write(oprot) + for iter322 in self.success: + iter322.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -8868,10 +9144,10 @@ elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype319, _size316) = iprot.readListBegin() - for _i320 in xrange(_size316): - _elem321 = iprot.readString(); - self.part_vals.append(_elem321) + (_etype326, _size323) = iprot.readListBegin() + for _i327 in xrange(_size323): + _elem328 = iprot.readString(); + self.part_vals.append(_elem328) iprot.readListEnd() else: iprot.skip(ftype) @@ -8888,10 +9164,10 @@ elif fid == 6: if ftype == TType.LIST: self.group_names = [] - (_etype325, _size322) = iprot.readListBegin() - for _i326 in xrange(_size322): - _elem327 = iprot.readString(); - self.group_names.append(_elem327) + (_etype332, _size329) = iprot.readListBegin() + for _i333 in xrange(_size329): + _elem334 = iprot.readString(); + self.group_names.append(_elem334) iprot.readListEnd() else: iprot.skip(ftype) @@ -8916,8 +9192,8 @@ if self.part_vals != None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter328 in self.part_vals: - oprot.writeString(iter328) + for iter335 in self.part_vals: + oprot.writeString(iter335) oprot.writeListEnd() oprot.writeFieldEnd() if self.max_parts != None: @@ -8931,8 +9207,8 @@ if self.group_names != None: oprot.writeFieldBegin('group_names', TType.LIST, 6) oprot.writeListBegin(TType.STRING, len(self.group_names)) - for iter329 in self.group_names: - oprot.writeString(iter329) + for iter336 in self.group_names: + oprot.writeString(iter336) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -8983,11 +9259,11 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype333, _size330) = iprot.readListBegin() - for _i334 in xrange(_size330): - _elem335 = Partition() - _elem335.read(iprot) - self.success.append(_elem335) + (_etype340, _size337) = iprot.readListBegin() + for _i341 in xrange(_size337): + _elem342 = Partition() + _elem342.read(iprot) + self.success.append(_elem342) iprot.readListEnd() else: iprot.skip(ftype) @@ -9016,8 +9292,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter336 in self.success: - iter336.write(oprot) + for iter343 in self.success: + iter343.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -9090,10 +9366,10 @@ elif fid == 3: if ftype == TType.LIST: self.part_vals = [] - (_etype340, _size337) = iprot.readListBegin() - for _i341 in xrange(_size337): - _elem342 = iprot.readString(); - self.part_vals.append(_elem342) + (_etype347, _size344) = iprot.readListBegin() + for _i348 in xrange(_size344): + _elem349 = iprot.readString(); + self.part_vals.append(_elem349) iprot.readListEnd() else: iprot.skip(ftype) @@ -9123,8 +9399,8 @@ if self.part_vals != None: oprot.writeFieldBegin('part_vals', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.part_vals)) - for iter343 in self.part_vals: - oprot.writeString(iter343) + for iter350 in self.part_vals: + oprot.writeString(iter350) oprot.writeListEnd() oprot.writeFieldEnd() if self.max_parts != None: @@ -9176,10 +9452,10 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype347, _size344) = iprot.readListBegin() - for _i348 in xrange(_size344): - _elem349 = iprot.readString(); - self.success.append(_elem349) + (_etype354, _size351) = iprot.readListBegin() + for _i355 in xrange(_size351): + _elem356 = iprot.readString(); + self.success.append(_elem356) iprot.readListEnd() else: iprot.skip(ftype) @@ -9202,8 +9478,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter350 in self.success: - oprot.writeString(iter350) + for iter357 in self.success: + oprot.writeString(iter357) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -9353,11 +9629,11 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype354, _size351) = iprot.readListBegin() - for _i355 in xrange(_size351): - _elem356 = Partition() - _elem356.read(iprot) - self.success.append(_elem356) + (_etype361, _size358) = iprot.readListBegin() + for _i362 in xrange(_size358): + _elem363 = Partition() + _elem363.read(iprot) + self.success.append(_elem363) iprot.readListEnd() else: iprot.skip(ftype) @@ -9386,8 +9662,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter357 in self.success: - iter357.write(oprot) + for iter364 in self.success: + iter364.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -9457,10 +9733,10 @@ elif fid == 3: if ftype == TType.LIST: self.names = [] - (_etype361, _size358) = iprot.readListBegin() - for _i362 in xrange(_size358): - _elem363 = iprot.readString(); - self.names.append(_elem363) + (_etype368, _size365) = iprot.readListBegin() + for _i369 in xrange(_size365): + _elem370 = iprot.readString(); + self.names.append(_elem370) iprot.readListEnd() else: iprot.skip(ftype) @@ -9485,8 +9761,8 @@ if self.names != None: oprot.writeFieldBegin('names', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.names)) - for iter364 in self.names: - oprot.writeString(iter364) + for iter371 in self.names: + oprot.writeString(iter371) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -9537,11 +9813,11 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype368, _size365) = iprot.readListBegin() - for _i369 in xrange(_size365): - _elem370 = Partition() - _elem370.read(iprot) - self.success.append(_elem370) + (_etype375, _size372) = iprot.readListBegin() + for _i376 in xrange(_size372): + _elem377 = Partition() + _elem377.read(iprot) + self.success.append(_elem377) iprot.readListEnd() else: iprot.skip(ftype) @@ -9570,8 +9846,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter371 in self.success: - iter371.write(oprot) + for iter378 in self.success: + iter378.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -9985,10 +10261,10 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype375, _size372) = iprot.readListBegin() - for _i376 in xrange(_size372): - _elem377 = iprot.readString(); - self.success.append(_elem377) + (_etype382, _size379) = iprot.readListBegin() + for _i383 in xrange(_size379): + _elem384 = iprot.readString(); + self.success.append(_elem384) iprot.readListEnd() else: iprot.skip(ftype) @@ -10011,8 +10287,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter378 in self.success: - oprot.writeString(iter378) + for iter385 in self.success: + oprot.writeString(iter385) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -10123,11 +10399,11 @@ if fid == 0: if ftype == TType.MAP: self.success = {} - (_ktype380, _vtype381, _size379 ) = iprot.readMapBegin() - for _i383 in xrange(_size379): - _key384 = iprot.readString(); - _val385 = iprot.readString(); - self.success[_key384] = _val385 + (_ktype387, _vtype388, _size386 ) = iprot.readMapBegin() + for _i390 in xrange(_size386): + _key391 = iprot.readString(); + _val392 = iprot.readString(); + self.success[_key391] = _val392 iprot.readMapEnd() else: iprot.skip(ftype) @@ -10150,9 +10426,9 @@ if self.success != None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success)) - for kiter386,viter387 in self.success.items(): - oprot.writeString(kiter386) - oprot.writeString(viter387) + for kiter393,viter394 in self.success.items(): + oprot.writeString(kiter393) + oprot.writeString(viter394) oprot.writeMapEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -10221,11 +10497,11 @@ elif fid == 3: if ftype == TType.MAP: self.part_vals = {} - (_ktype389, _vtype390, _size388 ) = iprot.readMapBegin() - for _i392 in xrange(_size388): - _key393 = iprot.readString(); - _val394 = iprot.readString(); - self.part_vals[_key393] = _val394 + (_ktype396, _vtype397, _size395 ) = iprot.readMapBegin() + for _i399 in xrange(_size395): + _key400 = iprot.readString(); + _val401 = iprot.readString(); + self.part_vals[_key400] = _val401 iprot.readMapEnd() else: iprot.skip(ftype) @@ -10255,9 +10531,9 @@ if self.part_vals != None: oprot.writeFieldBegin('part_vals', TType.MAP, 3) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.part_vals)) - for kiter395,viter396 in self.part_vals.items(): - oprot.writeString(kiter395) - oprot.writeString(viter396) + for kiter402,viter403 in self.part_vals.items(): + oprot.writeString(kiter402) + oprot.writeString(viter403) oprot.writeMapEnd() oprot.writeFieldEnd() if self.eventType != None: @@ -10451,11 +10727,11 @@ elif fid == 3: if ftype == TType.MAP: self.part_vals = {} - (_ktype398, _vtype399, _size397 ) = iprot.readMapBegin() - for _i401 in xrange(_size397): - _key402 = iprot.readString(); - _val403 = iprot.readString(); - self.part_vals[_key402] = _val403 + (_ktype405, _vtype406, _size404 ) = iprot.readMapBegin() + for _i408 in xrange(_size404): + _key409 = iprot.readString(); + _val410 = iprot.readString(); + self.part_vals[_key409] = _val410 iprot.readMapEnd() else: iprot.skip(ftype) @@ -10485,9 +10761,9 @@ if self.part_vals != None: oprot.writeFieldBegin('part_vals', TType.MAP, 3) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.part_vals)) - for kiter404,viter405 in self.part_vals.items(): - oprot.writeString(kiter404) - oprot.writeString(viter405) + for kiter411,viter412 in self.part_vals.items(): + oprot.writeString(kiter411) + oprot.writeString(viter412) oprot.writeMapEnd() oprot.writeFieldEnd() if self.eventType != None: @@ -11448,11 +11724,11 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype409, _size406) = iprot.readListBegin() - for _i410 in xrange(_size406): - _elem411 = Index() - _elem411.read(iprot) - self.success.append(_elem411) + (_etype416, _size413) = iprot.readListBegin() + for _i417 in xrange(_size413): + _elem418 = Index() + _elem418.read(iprot) + self.success.append(_elem418) iprot.readListEnd() else: iprot.skip(ftype) @@ -11481,8 +11757,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter412 in self.success: - iter412.write(oprot) + for iter419 in self.success: + iter419.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -11621,10 +11897,10 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype416, _size413) = iprot.readListBegin() - for _i417 in xrange(_size413): - _elem418 = iprot.readString(); - self.success.append(_elem418) + (_etype423, _size420) = iprot.readListBegin() + for _i424 in xrange(_size420): + _elem425 = iprot.readString(); + self.success.append(_elem425) iprot.readListEnd() else: iprot.skip(ftype) @@ -11647,8 +11923,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter419 in self.success: - oprot.writeString(iter419) + for iter426 in self.success: + oprot.writeString(iter426) oprot.writeListEnd() oprot.writeFieldEnd() if self.o2 != None: @@ -12002,10 +12278,10 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype423, _size420) = iprot.readListBegin() - for _i424 in xrange(_size420): - _elem425 = iprot.readString(); - self.success.append(_elem425) + (_etype430, _size427) = iprot.readListBegin() + for _i431 in xrange(_size427): + _elem432 = iprot.readString(); + self.success.append(_elem432) iprot.readListEnd() else: iprot.skip(ftype) @@ -12028,8 +12304,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter426 in self.success: - oprot.writeString(iter426) + for iter433 in self.success: + oprot.writeString(iter433) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -12496,11 +12772,11 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype430, _size427) = iprot.readListBegin() - for _i431 in xrange(_size427): - _elem432 = Role() - _elem432.read(iprot) - self.success.append(_elem432) + (_etype437, _size434) = iprot.readListBegin() + for _i438 in xrange(_size434): + _elem439 = Role() + _elem439.read(iprot) + self.success.append(_elem439) iprot.readListEnd() else: iprot.skip(ftype) @@ -12523,8 +12799,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter433 in self.success: - iter433.write(oprot) + for iter440 in self.success: + iter440.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -12591,10 +12867,10 @@ elif fid == 3: if ftype == TType.LIST: self.group_names = [] - (_etype437, _size434) = iprot.readListBegin() - for _i438 in xrange(_size434): - _elem439 = iprot.readString(); - self.group_names.append(_elem439) + (_etype444, _size441) = iprot.readListBegin() + for _i445 in xrange(_size441): + _elem446 = iprot.readString(); + self.group_names.append(_elem446) iprot.readListEnd() else: iprot.skip(ftype) @@ -12619,8 +12895,8 @@ if self.group_names != None: oprot.writeFieldBegin('group_names', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.group_names)) - for iter440 in self.group_names: - oprot.writeString(iter440) + for iter447 in self.group_names: + oprot.writeString(iter447) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -12824,11 +13100,11 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype444, _size441) = iprot.readListBegin() - for _i445 in xrange(_size441): - _elem446 = HiveObjectPrivilege() - _elem446.read(iprot) - self.success.append(_elem446) + (_etype451, _size448) = iprot.readListBegin() + for _i452 in xrange(_size448): + _elem453 = HiveObjectPrivilege() + _elem453.read(iprot) + self.success.append(_elem453) iprot.readListEnd() else: iprot.skip(ftype) @@ -12851,8 +13127,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter447 in self.success: - iter447.write(oprot) + for iter454 in self.success: + iter454.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: Index: metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote =================================================================== --- metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote (revision 1145366) +++ metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote (working copy) @@ -40,6 +40,7 @@ print ' Table get_table(string dbname, string tbl_name)' print ' get_table_objects_by_name(string dbname, tbl_names)' print ' void alter_table(string dbname, string tbl_name, Table new_tbl)' + print ' void rename_partition(string dbname, string name, part_vals, Partition new_part)' print ' Partition add_partition(Partition new_part)' print ' Partition append_partition(string db_name, string tbl_name, part_vals)' print ' Partition append_partition_by_name(string db_name, string tbl_name, string part_name)' @@ -245,6 +246,12 @@ sys.exit(1) pp.pprint(client.alter_table(args[0],args[1],eval(args[2]),)) +elif cmd == 'rename_partition': + if len(args) != 4: + print 'rename_partition requires 4 args' + sys.exit(1) + pp.pprint(client.rename_partition(args[0],args[1],eval(args[2]),eval(args[3]),)) + elif cmd == 'add_partition': if len(args) != 1: print 'add_partition requires 1 args' Index: metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp =================================================================== --- metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp (revision 1145366) +++ metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp (working copy) @@ -4154,6 +4154,294 @@ return xfer; } +uint32_t ThriftHiveMetastore_rename_partition_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + this->__isset.dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->part_vals.clear(); + uint32_t _size254; + ::apache::thrift::protocol::TType _etype257; + iprot->readListBegin(_etype257, _size254); + this->part_vals.resize(_size254); + uint32_t _i258; + for (_i258 = 0; _i258 < _size254; ++_i258) + { + xfer += iprot->readString(this->part_vals[_i258]); + } + iprot->readListEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->new_part.read(iprot); + this->__isset.new_part = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_rename_partition_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_rename_partition_args"); + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->part_vals.size()); + std::vector ::const_iterator _iter259; + for (_iter259 = this->part_vals.begin(); _iter259 != this->part_vals.end(); ++_iter259) + { + xfer += oprot->writeString((*_iter259)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("new_part", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->new_part.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_rename_partition_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_rename_partition_pargs"); + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->dbname))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->name))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, (*(this->part_vals)).size()); + std::vector ::const_iterator _iter260; + for (_iter260 = (*(this->part_vals)).begin(); _iter260 != (*(this->part_vals)).end(); ++_iter260) + { + xfer += oprot->writeString((*_iter260)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("new_part", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += (*(this->new_part)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_rename_partition_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 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_rename_partition_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_rename_partition_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_rename_partition_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 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + uint32_t ThriftHiveMetastore_add_partition_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; @@ -4412,14 +4700,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->part_vals.clear(); - uint32_t _size254; - ::apache::thrift::protocol::TType _etype257; - iprot->readListBegin(_etype257, _size254); - this->part_vals.resize(_size254); - uint32_t _i258; - for (_i258 = 0; _i258 < _size254; ++_i258) + uint32_t _size261; + ::apache::thrift::protocol::TType _etype264; + iprot->readListBegin(_etype264, _size261); + this->part_vals.resize(_size261); + uint32_t _i265; + for (_i265 = 0; _i265 < _size261; ++_i265) { - xfer += iprot->readString(this->part_vals[_i258]); + xfer += iprot->readString(this->part_vals[_i265]); } iprot->readListEnd(); } @@ -4452,10 +4740,10 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->part_vals.size()); - std::vector ::const_iterator _iter259; - for (_iter259 = this->part_vals.begin(); _iter259 != this->part_vals.end(); ++_iter259) + std::vector ::const_iterator _iter266; + for (_iter266 = this->part_vals.begin(); _iter266 != this->part_vals.end(); ++_iter266) { - xfer += oprot->writeString((*_iter259)); + xfer += oprot->writeString((*_iter266)); } xfer += oprot->writeListEnd(); } @@ -4477,10 +4765,10 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, (*(this->part_vals)).size()); - std::vector ::const_iterator _iter260; - for (_iter260 = (*(this->part_vals)).begin(); _iter260 != (*(this->part_vals)).end(); ++_iter260) + std::vector ::const_iterator _iter267; + for (_iter267 = (*(this->part_vals)).begin(); _iter267 != (*(this->part_vals)).end(); ++_iter267) { - xfer += oprot->writeString((*_iter260)); + xfer += oprot->writeString((*_iter267)); } xfer += oprot->writeListEnd(); } @@ -4932,14 +5220,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->part_vals.clear(); - uint32_t _size261; - ::apache::thrift::protocol::TType _etype264; - iprot->readListBegin(_etype264, _size261); - this->part_vals.resize(_size261); - uint32_t _i265; - for (_i265 = 0; _i265 < _size261; ++_i265) + uint32_t _size268; + ::apache::thrift::protocol::TType _etype271; + iprot->readListBegin(_etype271, _size268); + this->part_vals.resize(_size268); + uint32_t _i272; + for (_i272 = 0; _i272 < _size268; ++_i272) { - xfer += iprot->readString(this->part_vals[_i265]); + xfer += iprot->readString(this->part_vals[_i272]); } iprot->readListEnd(); } @@ -4980,10 +5268,10 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->part_vals.size()); - std::vector ::const_iterator _iter266; - for (_iter266 = this->part_vals.begin(); _iter266 != this->part_vals.end(); ++_iter266) + std::vector ::const_iterator _iter273; + for (_iter273 = this->part_vals.begin(); _iter273 != this->part_vals.end(); ++_iter273) { - xfer += oprot->writeString((*_iter266)); + xfer += oprot->writeString((*_iter273)); } xfer += oprot->writeListEnd(); } @@ -5008,10 +5296,10 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, (*(this->part_vals)).size()); - std::vector ::const_iterator _iter267; - for (_iter267 = (*(this->part_vals)).begin(); _iter267 != (*(this->part_vals)).end(); ++_iter267) + std::vector ::const_iterator _iter274; + for (_iter274 = (*(this->part_vals)).begin(); _iter274 != (*(this->part_vals)).end(); ++_iter274) { - xfer += oprot->writeString((*_iter267)); + xfer += oprot->writeString((*_iter274)); } xfer += oprot->writeListEnd(); } @@ -5440,14 +5728,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->part_vals.clear(); - uint32_t _size268; - ::apache::thrift::protocol::TType _etype271; - iprot->readListBegin(_etype271, _size268); - this->part_vals.resize(_size268); - uint32_t _i272; - for (_i272 = 0; _i272 < _size268; ++_i272) + uint32_t _size275; + ::apache::thrift::protocol::TType _etype278; + iprot->readListBegin(_etype278, _size275); + this->part_vals.resize(_size275); + uint32_t _i279; + for (_i279 = 0; _i279 < _size275; ++_i279) { - xfer += iprot->readString(this->part_vals[_i272]); + xfer += iprot->readString(this->part_vals[_i279]); } iprot->readListEnd(); } @@ -5480,10 +5768,10 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->part_vals.size()); - std::vector ::const_iterator _iter273; - for (_iter273 = this->part_vals.begin(); _iter273 != this->part_vals.end(); ++_iter273) + std::vector ::const_iterator _iter280; + for (_iter280 = this->part_vals.begin(); _iter280 != this->part_vals.end(); ++_iter280) { - xfer += oprot->writeString((*_iter273)); + xfer += oprot->writeString((*_iter280)); } xfer += oprot->writeListEnd(); } @@ -5505,10 +5793,10 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, (*(this->part_vals)).size()); - std::vector ::const_iterator _iter274; - for (_iter274 = (*(this->part_vals)).begin(); _iter274 != (*(this->part_vals)).end(); ++_iter274) + std::vector ::const_iterator _iter281; + for (_iter281 = (*(this->part_vals)).begin(); _iter281 != (*(this->part_vals)).end(); ++_iter281) { - xfer += oprot->writeString((*_iter274)); + xfer += oprot->writeString((*_iter281)); } xfer += oprot->writeListEnd(); } @@ -5694,14 +5982,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->part_vals.clear(); - uint32_t _size275; - ::apache::thrift::protocol::TType _etype278; - iprot->readListBegin(_etype278, _size275); - this->part_vals.resize(_size275); - uint32_t _i279; - for (_i279 = 0; _i279 < _size275; ++_i279) + uint32_t _size282; + ::apache::thrift::protocol::TType _etype285; + iprot->readListBegin(_etype285, _size282); + this->part_vals.resize(_size282); + uint32_t _i286; + for (_i286 = 0; _i286 < _size282; ++_i286) { - xfer += iprot->readString(this->part_vals[_i279]); + xfer += iprot->readString(this->part_vals[_i286]); } iprot->readListEnd(); } @@ -5722,14 +6010,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->group_names.clear(); - uint32_t _size280; - ::apache::thrift::protocol::TType _etype283; - iprot->readListBegin(_etype283, _size280); - this->group_names.resize(_size280); - uint32_t _i284; - for (_i284 = 0; _i284 < _size280; ++_i284) + uint32_t _size287; + ::apache::thrift::protocol::TType _etype290; + iprot->readListBegin(_etype290, _size287); + this->group_names.resize(_size287); + uint32_t _i291; + for (_i291 = 0; _i291 < _size287; ++_i291) { - xfer += iprot->readString(this->group_names[_i284]); + xfer += iprot->readString(this->group_names[_i291]); } iprot->readListEnd(); } @@ -5762,10 +6050,10 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->part_vals.size()); - std::vector ::const_iterator _iter285; - for (_iter285 = this->part_vals.begin(); _iter285 != this->part_vals.end(); ++_iter285) + std::vector ::const_iterator _iter292; + for (_iter292 = this->part_vals.begin(); _iter292 != this->part_vals.end(); ++_iter292) { - xfer += oprot->writeString((*_iter285)); + xfer += oprot->writeString((*_iter292)); } xfer += oprot->writeListEnd(); } @@ -5776,10 +6064,10 @@ xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 5); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->group_names.size()); - std::vector ::const_iterator _iter286; - for (_iter286 = this->group_names.begin(); _iter286 != this->group_names.end(); ++_iter286) + std::vector ::const_iterator _iter293; + for (_iter293 = this->group_names.begin(); _iter293 != this->group_names.end(); ++_iter293) { - xfer += oprot->writeString((*_iter286)); + xfer += oprot->writeString((*_iter293)); } xfer += oprot->writeListEnd(); } @@ -5801,10 +6089,10 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, (*(this->part_vals)).size()); - std::vector ::const_iterator _iter287; - for (_iter287 = (*(this->part_vals)).begin(); _iter287 != (*(this->part_vals)).end(); ++_iter287) + std::vector ::const_iterator _iter294; + for (_iter294 = (*(this->part_vals)).begin(); _iter294 != (*(this->part_vals)).end(); ++_iter294) { - xfer += oprot->writeString((*_iter287)); + xfer += oprot->writeString((*_iter294)); } xfer += oprot->writeListEnd(); } @@ -5815,10 +6103,10 @@ xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 5); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, (*(this->group_names)).size()); - std::vector ::const_iterator _iter288; - for (_iter288 = (*(this->group_names)).begin(); _iter288 != (*(this->group_names)).end(); ++_iter288) + std::vector ::const_iterator _iter295; + for (_iter295 = (*(this->group_names)).begin(); _iter295 != (*(this->group_names)).end(); ++_iter295) { - xfer += oprot->writeString((*_iter288)); + xfer += oprot->writeString((*_iter295)); } xfer += oprot->writeListEnd(); } @@ -6304,14 +6592,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size289; - ::apache::thrift::protocol::TType _etype292; - iprot->readListBegin(_etype292, _size289); - this->success.resize(_size289); - uint32_t _i293; - for (_i293 = 0; _i293 < _size289; ++_i293) + uint32_t _size296; + ::apache::thrift::protocol::TType _etype299; + iprot->readListBegin(_etype299, _size296); + this->success.resize(_size296); + uint32_t _i300; + for (_i300 = 0; _i300 < _size296; ++_i300) { - xfer += this->success[_i293].read(iprot); + xfer += this->success[_i300].read(iprot); } iprot->readListEnd(); } @@ -6358,10 +6646,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter294; - for (_iter294 = this->success.begin(); _iter294 != this->success.end(); ++_iter294) + std::vector ::const_iterator _iter301; + for (_iter301 = this->success.begin(); _iter301 != this->success.end(); ++_iter301) { - xfer += (*_iter294).write(oprot); + xfer += (*_iter301).write(oprot); } xfer += oprot->writeListEnd(); } @@ -6404,14 +6692,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size295; - ::apache::thrift::protocol::TType _etype298; - iprot->readListBegin(_etype298, _size295); - (*(this->success)).resize(_size295); - uint32_t _i299; - for (_i299 = 0; _i299 < _size295; ++_i299) + uint32_t _size302; + ::apache::thrift::protocol::TType _etype305; + iprot->readListBegin(_etype305, _size302); + (*(this->success)).resize(_size302); + uint32_t _i306; + for (_i306 = 0; _i306 < _size302; ++_i306) { - xfer += (*(this->success))[_i299].read(iprot); + xfer += (*(this->success))[_i306].read(iprot); } iprot->readListEnd(); } @@ -6504,14 +6792,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->group_names.clear(); - uint32_t _size300; - ::apache::thrift::protocol::TType _etype303; - iprot->readListBegin(_etype303, _size300); - this->group_names.resize(_size300); - uint32_t _i304; - for (_i304 = 0; _i304 < _size300; ++_i304) + uint32_t _size307; + ::apache::thrift::protocol::TType _etype310; + iprot->readListBegin(_etype310, _size307); + this->group_names.resize(_size307); + uint32_t _i311; + for (_i311 = 0; _i311 < _size307; ++_i311) { - xfer += iprot->readString(this->group_names[_i304]); + xfer += iprot->readString(this->group_names[_i311]); } iprot->readListEnd(); } @@ -6550,10 +6838,10 @@ xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 5); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->group_names.size()); - std::vector ::const_iterator _iter305; - for (_iter305 = this->group_names.begin(); _iter305 != this->group_names.end(); ++_iter305) + std::vector ::const_iterator _iter312; + for (_iter312 = this->group_names.begin(); _iter312 != this->group_names.end(); ++_iter312) { - xfer += oprot->writeString((*_iter305)); + xfer += oprot->writeString((*_iter312)); } xfer += oprot->writeListEnd(); } @@ -6581,10 +6869,10 @@ xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 5); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, (*(this->group_names)).size()); - std::vector ::const_iterator _iter306; - for (_iter306 = (*(this->group_names)).begin(); _iter306 != (*(this->group_names)).end(); ++_iter306) + std::vector ::const_iterator _iter313; + for (_iter313 = (*(this->group_names)).begin(); _iter313 != (*(this->group_names)).end(); ++_iter313) { - xfer += oprot->writeString((*_iter306)); + xfer += oprot->writeString((*_iter313)); } xfer += oprot->writeListEnd(); } @@ -6618,14 +6906,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size307; - ::apache::thrift::protocol::TType _etype310; - iprot->readListBegin(_etype310, _size307); - this->success.resize(_size307); - uint32_t _i311; - for (_i311 = 0; _i311 < _size307; ++_i311) + uint32_t _size314; + ::apache::thrift::protocol::TType _etype317; + iprot->readListBegin(_etype317, _size314); + this->success.resize(_size314); + uint32_t _i318; + for (_i318 = 0; _i318 < _size314; ++_i318) { - xfer += this->success[_i311].read(iprot); + xfer += this->success[_i318].read(iprot); } iprot->readListEnd(); } @@ -6672,10 +6960,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter312; - for (_iter312 = this->success.begin(); _iter312 != this->success.end(); ++_iter312) + std::vector ::const_iterator _iter319; + for (_iter319 = this->success.begin(); _iter319 != this->success.end(); ++_iter319) { - xfer += (*_iter312).write(oprot); + xfer += (*_iter319).write(oprot); } xfer += oprot->writeListEnd(); } @@ -6718,14 +7006,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size313; - ::apache::thrift::protocol::TType _etype316; - iprot->readListBegin(_etype316, _size313); - (*(this->success)).resize(_size313); - uint32_t _i317; - for (_i317 = 0; _i317 < _size313; ++_i317) + uint32_t _size320; + ::apache::thrift::protocol::TType _etype323; + iprot->readListBegin(_etype323, _size320); + (*(this->success)).resize(_size320); + uint32_t _i324; + for (_i324 = 0; _i324 < _size320; ++_i324) { - xfer += (*(this->success))[_i317].read(iprot); + xfer += (*(this->success))[_i324].read(iprot); } iprot->readListEnd(); } @@ -6876,14 +7164,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size318; - ::apache::thrift::protocol::TType _etype321; - iprot->readListBegin(_etype321, _size318); - this->success.resize(_size318); - uint32_t _i322; - for (_i322 = 0; _i322 < _size318; ++_i322) + uint32_t _size325; + ::apache::thrift::protocol::TType _etype328; + iprot->readListBegin(_etype328, _size325); + this->success.resize(_size325); + uint32_t _i329; + for (_i329 = 0; _i329 < _size325; ++_i329) { - xfer += iprot->readString(this->success[_i322]); + xfer += iprot->readString(this->success[_i329]); } iprot->readListEnd(); } @@ -6922,10 +7210,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->success.size()); - std::vector ::const_iterator _iter323; - for (_iter323 = this->success.begin(); _iter323 != this->success.end(); ++_iter323) + std::vector ::const_iterator _iter330; + for (_iter330 = this->success.begin(); _iter330 != this->success.end(); ++_iter330) { - xfer += oprot->writeString((*_iter323)); + xfer += oprot->writeString((*_iter330)); } xfer += oprot->writeListEnd(); } @@ -6964,14 +7252,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size324; - ::apache::thrift::protocol::TType _etype327; - iprot->readListBegin(_etype327, _size324); - (*(this->success)).resize(_size324); - uint32_t _i328; - for (_i328 = 0; _i328 < _size324; ++_i328) + uint32_t _size331; + ::apache::thrift::protocol::TType _etype334; + iprot->readListBegin(_etype334, _size331); + (*(this->success)).resize(_size331); + uint32_t _i335; + for (_i335 = 0; _i335 < _size331; ++_i335) { - xfer += iprot->readString((*(this->success))[_i328]); + xfer += iprot->readString((*(this->success))[_i335]); } iprot->readListEnd(); } @@ -7040,14 +7328,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->part_vals.clear(); - uint32_t _size329; - ::apache::thrift::protocol::TType _etype332; - iprot->readListBegin(_etype332, _size329); - this->part_vals.resize(_size329); - uint32_t _i333; - for (_i333 = 0; _i333 < _size329; ++_i333) + uint32_t _size336; + ::apache::thrift::protocol::TType _etype339; + iprot->readListBegin(_etype339, _size336); + this->part_vals.resize(_size336); + uint32_t _i340; + for (_i340 = 0; _i340 < _size336; ++_i340) { - xfer += iprot->readString(this->part_vals[_i333]); + xfer += iprot->readString(this->part_vals[_i340]); } iprot->readListEnd(); } @@ -7088,10 +7376,10 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->part_vals.size()); - std::vector ::const_iterator _iter334; - for (_iter334 = this->part_vals.begin(); _iter334 != this->part_vals.end(); ++_iter334) + std::vector ::const_iterator _iter341; + for (_iter341 = this->part_vals.begin(); _iter341 != this->part_vals.end(); ++_iter341) { - xfer += oprot->writeString((*_iter334)); + xfer += oprot->writeString((*_iter341)); } xfer += oprot->writeListEnd(); } @@ -7116,10 +7404,10 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, (*(this->part_vals)).size()); - std::vector ::const_iterator _iter335; - for (_iter335 = (*(this->part_vals)).begin(); _iter335 != (*(this->part_vals)).end(); ++_iter335) + std::vector ::const_iterator _iter342; + for (_iter342 = (*(this->part_vals)).begin(); _iter342 != (*(this->part_vals)).end(); ++_iter342) { - xfer += oprot->writeString((*_iter335)); + xfer += oprot->writeString((*_iter342)); } xfer += oprot->writeListEnd(); } @@ -7156,14 +7444,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size336; - ::apache::thrift::protocol::TType _etype339; - iprot->readListBegin(_etype339, _size336); - this->success.resize(_size336); - uint32_t _i340; - for (_i340 = 0; _i340 < _size336; ++_i340) + uint32_t _size343; + ::apache::thrift::protocol::TType _etype346; + iprot->readListBegin(_etype346, _size343); + this->success.resize(_size343); + uint32_t _i347; + for (_i347 = 0; _i347 < _size343; ++_i347) { - xfer += this->success[_i340].read(iprot); + xfer += this->success[_i347].read(iprot); } iprot->readListEnd(); } @@ -7202,10 +7490,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter341; - for (_iter341 = this->success.begin(); _iter341 != this->success.end(); ++_iter341) + std::vector ::const_iterator _iter348; + for (_iter348 = this->success.begin(); _iter348 != this->success.end(); ++_iter348) { - xfer += (*_iter341).write(oprot); + xfer += (*_iter348).write(oprot); } xfer += oprot->writeListEnd(); } @@ -7244,14 +7532,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size342; - ::apache::thrift::protocol::TType _etype345; - iprot->readListBegin(_etype345, _size342); - (*(this->success)).resize(_size342); - uint32_t _i346; - for (_i346 = 0; _i346 < _size342; ++_i346) + uint32_t _size349; + ::apache::thrift::protocol::TType _etype352; + iprot->readListBegin(_etype352, _size349); + (*(this->success)).resize(_size349); + uint32_t _i353; + for (_i353 = 0; _i353 < _size349; ++_i353) { - xfer += (*(this->success))[_i346].read(iprot); + xfer += (*(this->success))[_i353].read(iprot); } iprot->readListEnd(); } @@ -7320,14 +7608,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->part_vals.clear(); - uint32_t _size347; - ::apache::thrift::protocol::TType _etype350; - iprot->readListBegin(_etype350, _size347); - this->part_vals.resize(_size347); - uint32_t _i351; - for (_i351 = 0; _i351 < _size347; ++_i351) + uint32_t _size354; + ::apache::thrift::protocol::TType _etype357; + iprot->readListBegin(_etype357, _size354); + this->part_vals.resize(_size354); + uint32_t _i358; + for (_i358 = 0; _i358 < _size354; ++_i358) { - xfer += iprot->readString(this->part_vals[_i351]); + xfer += iprot->readString(this->part_vals[_i358]); } iprot->readListEnd(); } @@ -7356,14 +7644,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->group_names.clear(); - uint32_t _size352; - ::apache::thrift::protocol::TType _etype355; - iprot->readListBegin(_etype355, _size352); - this->group_names.resize(_size352); - uint32_t _i356; - for (_i356 = 0; _i356 < _size352; ++_i356) + uint32_t _size359; + ::apache::thrift::protocol::TType _etype362; + iprot->readListBegin(_etype362, _size359); + this->group_names.resize(_size359); + uint32_t _i363; + for (_i363 = 0; _i363 < _size359; ++_i363) { - xfer += iprot->readString(this->group_names[_i356]); + xfer += iprot->readString(this->group_names[_i363]); } iprot->readListEnd(); } @@ -7396,10 +7684,10 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->part_vals.size()); - std::vector ::const_iterator _iter357; - for (_iter357 = this->part_vals.begin(); _iter357 != this->part_vals.end(); ++_iter357) + std::vector ::const_iterator _iter364; + for (_iter364 = this->part_vals.begin(); _iter364 != this->part_vals.end(); ++_iter364) { - xfer += oprot->writeString((*_iter357)); + xfer += oprot->writeString((*_iter364)); } xfer += oprot->writeListEnd(); } @@ -7413,10 +7701,10 @@ xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 6); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->group_names.size()); - std::vector ::const_iterator _iter358; - for (_iter358 = this->group_names.begin(); _iter358 != this->group_names.end(); ++_iter358) + std::vector ::const_iterator _iter365; + for (_iter365 = this->group_names.begin(); _iter365 != this->group_names.end(); ++_iter365) { - xfer += oprot->writeString((*_iter358)); + xfer += oprot->writeString((*_iter365)); } xfer += oprot->writeListEnd(); } @@ -7438,10 +7726,10 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, (*(this->part_vals)).size()); - std::vector ::const_iterator _iter359; - for (_iter359 = (*(this->part_vals)).begin(); _iter359 != (*(this->part_vals)).end(); ++_iter359) + std::vector ::const_iterator _iter366; + for (_iter366 = (*(this->part_vals)).begin(); _iter366 != (*(this->part_vals)).end(); ++_iter366) { - xfer += oprot->writeString((*_iter359)); + xfer += oprot->writeString((*_iter366)); } xfer += oprot->writeListEnd(); } @@ -7455,10 +7743,10 @@ xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 6); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, (*(this->group_names)).size()); - std::vector ::const_iterator _iter360; - for (_iter360 = (*(this->group_names)).begin(); _iter360 != (*(this->group_names)).end(); ++_iter360) + std::vector ::const_iterator _iter367; + for (_iter367 = (*(this->group_names)).begin(); _iter367 != (*(this->group_names)).end(); ++_iter367) { - xfer += oprot->writeString((*_iter360)); + xfer += oprot->writeString((*_iter367)); } xfer += oprot->writeListEnd(); } @@ -7492,14 +7780,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size361; - ::apache::thrift::protocol::TType _etype364; - iprot->readListBegin(_etype364, _size361); - this->success.resize(_size361); - uint32_t _i365; - for (_i365 = 0; _i365 < _size361; ++_i365) + uint32_t _size368; + ::apache::thrift::protocol::TType _etype371; + iprot->readListBegin(_etype371, _size368); + this->success.resize(_size368); + uint32_t _i372; + for (_i372 = 0; _i372 < _size368; ++_i372) { - xfer += this->success[_i365].read(iprot); + xfer += this->success[_i372].read(iprot); } iprot->readListEnd(); } @@ -7546,10 +7834,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter366; - for (_iter366 = this->success.begin(); _iter366 != this->success.end(); ++_iter366) + std::vector ::const_iterator _iter373; + for (_iter373 = this->success.begin(); _iter373 != this->success.end(); ++_iter373) { - xfer += (*_iter366).write(oprot); + xfer += (*_iter373).write(oprot); } xfer += oprot->writeListEnd(); } @@ -7592,14 +7880,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size367; - ::apache::thrift::protocol::TType _etype370; - iprot->readListBegin(_etype370, _size367); - (*(this->success)).resize(_size367); - uint32_t _i371; - for (_i371 = 0; _i371 < _size367; ++_i371) + uint32_t _size374; + ::apache::thrift::protocol::TType _etype377; + iprot->readListBegin(_etype377, _size374); + (*(this->success)).resize(_size374); + uint32_t _i378; + for (_i378 = 0; _i378 < _size374; ++_i378) { - xfer += (*(this->success))[_i371].read(iprot); + xfer += (*(this->success))[_i378].read(iprot); } iprot->readListEnd(); } @@ -7676,14 +7964,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->part_vals.clear(); - uint32_t _size372; - ::apache::thrift::protocol::TType _etype375; - iprot->readListBegin(_etype375, _size372); - this->part_vals.resize(_size372); - uint32_t _i376; - for (_i376 = 0; _i376 < _size372; ++_i376) + uint32_t _size379; + ::apache::thrift::protocol::TType _etype382; + iprot->readListBegin(_etype382, _size379); + this->part_vals.resize(_size379); + uint32_t _i383; + for (_i383 = 0; _i383 < _size379; ++_i383) { - xfer += iprot->readString(this->part_vals[_i376]); + xfer += iprot->readString(this->part_vals[_i383]); } iprot->readListEnd(); } @@ -7724,10 +8012,10 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->part_vals.size()); - std::vector ::const_iterator _iter377; - for (_iter377 = this->part_vals.begin(); _iter377 != this->part_vals.end(); ++_iter377) + std::vector ::const_iterator _iter384; + for (_iter384 = this->part_vals.begin(); _iter384 != this->part_vals.end(); ++_iter384) { - xfer += oprot->writeString((*_iter377)); + xfer += oprot->writeString((*_iter384)); } xfer += oprot->writeListEnd(); } @@ -7752,10 +8040,10 @@ xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, (*(this->part_vals)).size()); - std::vector ::const_iterator _iter378; - for (_iter378 = (*(this->part_vals)).begin(); _iter378 != (*(this->part_vals)).end(); ++_iter378) + std::vector ::const_iterator _iter385; + for (_iter385 = (*(this->part_vals)).begin(); _iter385 != (*(this->part_vals)).end(); ++_iter385) { - xfer += oprot->writeString((*_iter378)); + xfer += oprot->writeString((*_iter385)); } xfer += oprot->writeListEnd(); } @@ -7792,14 +8080,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size379; - ::apache::thrift::protocol::TType _etype382; - iprot->readListBegin(_etype382, _size379); - this->success.resize(_size379); - uint32_t _i383; - for (_i383 = 0; _i383 < _size379; ++_i383) + uint32_t _size386; + ::apache::thrift::protocol::TType _etype389; + iprot->readListBegin(_etype389, _size386); + this->success.resize(_size386); + uint32_t _i390; + for (_i390 = 0; _i390 < _size386; ++_i390) { - xfer += iprot->readString(this->success[_i383]); + xfer += iprot->readString(this->success[_i390]); } iprot->readListEnd(); } @@ -7838,10 +8126,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->success.size()); - std::vector ::const_iterator _iter384; - for (_iter384 = this->success.begin(); _iter384 != this->success.end(); ++_iter384) + std::vector ::const_iterator _iter391; + for (_iter391 = this->success.begin(); _iter391 != this->success.end(); ++_iter391) { - xfer += oprot->writeString((*_iter384)); + xfer += oprot->writeString((*_iter391)); } xfer += oprot->writeListEnd(); } @@ -7880,14 +8168,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size385; - ::apache::thrift::protocol::TType _etype388; - iprot->readListBegin(_etype388, _size385); - (*(this->success)).resize(_size385); - uint32_t _i389; - for (_i389 = 0; _i389 < _size385; ++_i389) + uint32_t _size392; + ::apache::thrift::protocol::TType _etype395; + iprot->readListBegin(_etype395, _size392); + (*(this->success)).resize(_size392); + uint32_t _i396; + for (_i396 = 0; _i396 < _size392; ++_i396) { - xfer += iprot->readString((*(this->success))[_i389]); + xfer += iprot->readString((*(this->success))[_i396]); } iprot->readListEnd(); } @@ -8044,14 +8332,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size390; - ::apache::thrift::protocol::TType _etype393; - iprot->readListBegin(_etype393, _size390); - this->success.resize(_size390); - uint32_t _i394; - for (_i394 = 0; _i394 < _size390; ++_i394) + uint32_t _size397; + ::apache::thrift::protocol::TType _etype400; + iprot->readListBegin(_etype400, _size397); + this->success.resize(_size397); + uint32_t _i401; + for (_i401 = 0; _i401 < _size397; ++_i401) { - xfer += this->success[_i394].read(iprot); + xfer += this->success[_i401].read(iprot); } iprot->readListEnd(); } @@ -8098,10 +8386,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter395; - for (_iter395 = this->success.begin(); _iter395 != this->success.end(); ++_iter395) + std::vector ::const_iterator _iter402; + for (_iter402 = this->success.begin(); _iter402 != this->success.end(); ++_iter402) { - xfer += (*_iter395).write(oprot); + xfer += (*_iter402).write(oprot); } xfer += oprot->writeListEnd(); } @@ -8144,14 +8432,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size396; - ::apache::thrift::protocol::TType _etype399; - iprot->readListBegin(_etype399, _size396); - (*(this->success)).resize(_size396); - uint32_t _i400; - for (_i400 = 0; _i400 < _size396; ++_i400) + uint32_t _size403; + ::apache::thrift::protocol::TType _etype406; + iprot->readListBegin(_etype406, _size403); + (*(this->success)).resize(_size403); + uint32_t _i407; + for (_i407 = 0; _i407 < _size403; ++_i407) { - xfer += (*(this->success))[_i400].read(iprot); + xfer += (*(this->success))[_i407].read(iprot); } iprot->readListEnd(); } @@ -8228,14 +8516,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->names.clear(); - uint32_t _size401; - ::apache::thrift::protocol::TType _etype404; - iprot->readListBegin(_etype404, _size401); - this->names.resize(_size401); - uint32_t _i405; - for (_i405 = 0; _i405 < _size401; ++_i405) + uint32_t _size408; + ::apache::thrift::protocol::TType _etype411; + iprot->readListBegin(_etype411, _size408); + this->names.resize(_size408); + uint32_t _i412; + for (_i412 = 0; _i412 < _size408; ++_i412) { - xfer += iprot->readString(this->names[_i405]); + xfer += iprot->readString(this->names[_i412]); } iprot->readListEnd(); } @@ -8268,10 +8556,10 @@ xfer += oprot->writeFieldBegin("names", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->names.size()); - std::vector ::const_iterator _iter406; - for (_iter406 = this->names.begin(); _iter406 != this->names.end(); ++_iter406) + std::vector ::const_iterator _iter413; + for (_iter413 = this->names.begin(); _iter413 != this->names.end(); ++_iter413) { - xfer += oprot->writeString((*_iter406)); + xfer += oprot->writeString((*_iter413)); } xfer += oprot->writeListEnd(); } @@ -8293,10 +8581,10 @@ xfer += oprot->writeFieldBegin("names", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, (*(this->names)).size()); - std::vector ::const_iterator _iter407; - for (_iter407 = (*(this->names)).begin(); _iter407 != (*(this->names)).end(); ++_iter407) + std::vector ::const_iterator _iter414; + for (_iter414 = (*(this->names)).begin(); _iter414 != (*(this->names)).end(); ++_iter414) { - xfer += oprot->writeString((*_iter407)); + xfer += oprot->writeString((*_iter414)); } xfer += oprot->writeListEnd(); } @@ -8330,14 +8618,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size408; - ::apache::thrift::protocol::TType _etype411; - iprot->readListBegin(_etype411, _size408); - this->success.resize(_size408); - uint32_t _i412; - for (_i412 = 0; _i412 < _size408; ++_i412) + uint32_t _size415; + ::apache::thrift::protocol::TType _etype418; + iprot->readListBegin(_etype418, _size415); + this->success.resize(_size415); + uint32_t _i419; + for (_i419 = 0; _i419 < _size415; ++_i419) { - xfer += this->success[_i412].read(iprot); + xfer += this->success[_i419].read(iprot); } iprot->readListEnd(); } @@ -8384,10 +8672,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter413; - for (_iter413 = this->success.begin(); _iter413 != this->success.end(); ++_iter413) + std::vector ::const_iterator _iter420; + for (_iter420 = this->success.begin(); _iter420 != this->success.end(); ++_iter420) { - xfer += (*_iter413).write(oprot); + xfer += (*_iter420).write(oprot); } xfer += oprot->writeListEnd(); } @@ -8430,14 +8718,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size414; - ::apache::thrift::protocol::TType _etype417; - iprot->readListBegin(_etype417, _size414); - (*(this->success)).resize(_size414); - uint32_t _i418; - for (_i418 = 0; _i418 < _size414; ++_i418) + uint32_t _size421; + ::apache::thrift::protocol::TType _etype424; + iprot->readListBegin(_etype424, _size421); + (*(this->success)).resize(_size421); + uint32_t _i425; + for (_i425 = 0; _i425 < _size421; ++_i425) { - xfer += (*(this->success))[_i418].read(iprot); + xfer += (*(this->success))[_i425].read(iprot); } iprot->readListEnd(); } @@ -8958,14 +9246,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size419; - ::apache::thrift::protocol::TType _etype422; - iprot->readListBegin(_etype422, _size419); - this->success.resize(_size419); - uint32_t _i423; - for (_i423 = 0; _i423 < _size419; ++_i423) + uint32_t _size426; + ::apache::thrift::protocol::TType _etype429; + iprot->readListBegin(_etype429, _size426); + this->success.resize(_size426); + uint32_t _i430; + for (_i430 = 0; _i430 < _size426; ++_i430) { - xfer += iprot->readString(this->success[_i423]); + xfer += iprot->readString(this->success[_i430]); } iprot->readListEnd(); } @@ -9004,10 +9292,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->success.size()); - std::vector ::const_iterator _iter424; - for (_iter424 = this->success.begin(); _iter424 != this->success.end(); ++_iter424) + std::vector ::const_iterator _iter431; + for (_iter431 = this->success.begin(); _iter431 != this->success.end(); ++_iter431) { - xfer += oprot->writeString((*_iter424)); + xfer += oprot->writeString((*_iter431)); } xfer += oprot->writeListEnd(); } @@ -9046,14 +9334,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size425; - ::apache::thrift::protocol::TType _etype428; - iprot->readListBegin(_etype428, _size425); - (*(this->success)).resize(_size425); - uint32_t _i429; - for (_i429 = 0; _i429 < _size425; ++_i429) + uint32_t _size432; + ::apache::thrift::protocol::TType _etype435; + iprot->readListBegin(_etype435, _size432); + (*(this->success)).resize(_size432); + uint32_t _i436; + for (_i436 = 0; _i436 < _size432; ++_i436) { - xfer += iprot->readString((*(this->success))[_i429]); + xfer += iprot->readString((*(this->success))[_i436]); } iprot->readListEnd(); } @@ -9168,17 +9456,17 @@ if (ftype == ::apache::thrift::protocol::T_MAP) { { this->success.clear(); - uint32_t _size430; - ::apache::thrift::protocol::TType _ktype431; - ::apache::thrift::protocol::TType _vtype432; - iprot->readMapBegin(_ktype431, _vtype432, _size430); - uint32_t _i434; - for (_i434 = 0; _i434 < _size430; ++_i434) + uint32_t _size437; + ::apache::thrift::protocol::TType _ktype438; + ::apache::thrift::protocol::TType _vtype439; + iprot->readMapBegin(_ktype438, _vtype439, _size437); + uint32_t _i441; + for (_i441 = 0; _i441 < _size437; ++_i441) { - std::string _key435; - xfer += iprot->readString(_key435); - std::string& _val436 = this->success[_key435]; - xfer += iprot->readString(_val436); + std::string _key442; + xfer += iprot->readString(_key442); + std::string& _val443 = this->success[_key442]; + xfer += iprot->readString(_val443); } iprot->readMapEnd(); } @@ -9217,11 +9505,11 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0); { xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, this->success.size()); - std::map ::const_iterator _iter437; - for (_iter437 = this->success.begin(); _iter437 != this->success.end(); ++_iter437) + std::map ::const_iterator _iter444; + for (_iter444 = this->success.begin(); _iter444 != this->success.end(); ++_iter444) { - xfer += oprot->writeString(_iter437->first); - xfer += oprot->writeString(_iter437->second); + xfer += oprot->writeString(_iter444->first); + xfer += oprot->writeString(_iter444->second); } xfer += oprot->writeMapEnd(); } @@ -9260,17 +9548,17 @@ if (ftype == ::apache::thrift::protocol::T_MAP) { { (*(this->success)).clear(); - uint32_t _size438; - ::apache::thrift::protocol::TType _ktype439; - ::apache::thrift::protocol::TType _vtype440; - iprot->readMapBegin(_ktype439, _vtype440, _size438); - uint32_t _i442; - for (_i442 = 0; _i442 < _size438; ++_i442) + uint32_t _size445; + ::apache::thrift::protocol::TType _ktype446; + ::apache::thrift::protocol::TType _vtype447; + iprot->readMapBegin(_ktype446, _vtype447, _size445); + uint32_t _i449; + for (_i449 = 0; _i449 < _size445; ++_i449) { - std::string _key443; - xfer += iprot->readString(_key443); - std::string& _val444 = (*(this->success))[_key443]; - xfer += iprot->readString(_val444); + std::string _key450; + xfer += iprot->readString(_key450); + std::string& _val451 = (*(this->success))[_key450]; + xfer += iprot->readString(_val451); } iprot->readMapEnd(); } @@ -9339,17 +9627,17 @@ if (ftype == ::apache::thrift::protocol::T_MAP) { { this->part_vals.clear(); - uint32_t _size445; - ::apache::thrift::protocol::TType _ktype446; - ::apache::thrift::protocol::TType _vtype447; - iprot->readMapBegin(_ktype446, _vtype447, _size445); - uint32_t _i449; - for (_i449 = 0; _i449 < _size445; ++_i449) + uint32_t _size452; + ::apache::thrift::protocol::TType _ktype453; + ::apache::thrift::protocol::TType _vtype454; + iprot->readMapBegin(_ktype453, _vtype454, _size452); + uint32_t _i456; + for (_i456 = 0; _i456 < _size452; ++_i456) { - std::string _key450; - xfer += iprot->readString(_key450); - std::string& _val451 = this->part_vals[_key450]; - xfer += iprot->readString(_val451); + std::string _key457; + xfer += iprot->readString(_key457); + std::string& _val458 = this->part_vals[_key457]; + xfer += iprot->readString(_val458); } iprot->readMapEnd(); } @@ -9360,9 +9648,9 @@ break; case 4: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast452; - xfer += iprot->readI32(ecast452); - this->eventType = (PartitionEventType::type)ecast452; + int32_t ecast459; + xfer += iprot->readI32(ecast459); + this->eventType = (PartitionEventType::type)ecast459; this->__isset.eventType = true; } else { xfer += iprot->skip(ftype); @@ -9392,11 +9680,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, this->part_vals.size()); - std::map ::const_iterator _iter453; - for (_iter453 = this->part_vals.begin(); _iter453 != this->part_vals.end(); ++_iter453) + std::map ::const_iterator _iter460; + for (_iter460 = this->part_vals.begin(); _iter460 != this->part_vals.end(); ++_iter460) { - xfer += oprot->writeString(_iter453->first); - xfer += oprot->writeString(_iter453->second); + xfer += oprot->writeString(_iter460->first); + xfer += oprot->writeString(_iter460->second); } xfer += oprot->writeMapEnd(); } @@ -9421,11 +9709,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, (*(this->part_vals)).size()); - std::map ::const_iterator _iter454; - for (_iter454 = (*(this->part_vals)).begin(); _iter454 != (*(this->part_vals)).end(); ++_iter454) + std::map ::const_iterator _iter461; + for (_iter461 = (*(this->part_vals)).begin(); _iter461 != (*(this->part_vals)).end(); ++_iter461) { - xfer += oprot->writeString(_iter454->first); - xfer += oprot->writeString(_iter454->second); + xfer += oprot->writeString(_iter461->first); + xfer += oprot->writeString(_iter461->second); } xfer += oprot->writeMapEnd(); } @@ -9674,17 +9962,17 @@ if (ftype == ::apache::thrift::protocol::T_MAP) { { this->part_vals.clear(); - uint32_t _size455; - ::apache::thrift::protocol::TType _ktype456; - ::apache::thrift::protocol::TType _vtype457; - iprot->readMapBegin(_ktype456, _vtype457, _size455); - uint32_t _i459; - for (_i459 = 0; _i459 < _size455; ++_i459) + uint32_t _size462; + ::apache::thrift::protocol::TType _ktype463; + ::apache::thrift::protocol::TType _vtype464; + iprot->readMapBegin(_ktype463, _vtype464, _size462); + uint32_t _i466; + for (_i466 = 0; _i466 < _size462; ++_i466) { - std::string _key460; - xfer += iprot->readString(_key460); - std::string& _val461 = this->part_vals[_key460]; - xfer += iprot->readString(_val461); + std::string _key467; + xfer += iprot->readString(_key467); + std::string& _val468 = this->part_vals[_key467]; + xfer += iprot->readString(_val468); } iprot->readMapEnd(); } @@ -9695,9 +9983,9 @@ break; case 4: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast462; - xfer += iprot->readI32(ecast462); - this->eventType = (PartitionEventType::type)ecast462; + int32_t ecast469; + xfer += iprot->readI32(ecast469); + this->eventType = (PartitionEventType::type)ecast469; this->__isset.eventType = true; } else { xfer += iprot->skip(ftype); @@ -9727,11 +10015,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, this->part_vals.size()); - std::map ::const_iterator _iter463; - for (_iter463 = this->part_vals.begin(); _iter463 != this->part_vals.end(); ++_iter463) + std::map ::const_iterator _iter470; + for (_iter470 = this->part_vals.begin(); _iter470 != this->part_vals.end(); ++_iter470) { - xfer += oprot->writeString(_iter463->first); - xfer += oprot->writeString(_iter463->second); + xfer += oprot->writeString(_iter470->first); + xfer += oprot->writeString(_iter470->second); } xfer += oprot->writeMapEnd(); } @@ -9756,11 +10044,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, (*(this->part_vals)).size()); - std::map ::const_iterator _iter464; - for (_iter464 = (*(this->part_vals)).begin(); _iter464 != (*(this->part_vals)).end(); ++_iter464) + std::map ::const_iterator _iter471; + for (_iter471 = (*(this->part_vals)).begin(); _iter471 != (*(this->part_vals)).end(); ++_iter471) { - xfer += oprot->writeString(_iter464->first); - xfer += oprot->writeString(_iter464->second); + xfer += oprot->writeString(_iter471->first); + xfer += oprot->writeString(_iter471->second); } xfer += oprot->writeMapEnd(); } @@ -11021,14 +11309,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size465; - ::apache::thrift::protocol::TType _etype468; - iprot->readListBegin(_etype468, _size465); - this->success.resize(_size465); - uint32_t _i469; - for (_i469 = 0; _i469 < _size465; ++_i469) + uint32_t _size472; + ::apache::thrift::protocol::TType _etype475; + iprot->readListBegin(_etype475, _size472); + this->success.resize(_size472); + uint32_t _i476; + for (_i476 = 0; _i476 < _size472; ++_i476) { - xfer += this->success[_i469].read(iprot); + xfer += this->success[_i476].read(iprot); } iprot->readListEnd(); } @@ -11075,10 +11363,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter470; - for (_iter470 = this->success.begin(); _iter470 != this->success.end(); ++_iter470) + std::vector ::const_iterator _iter477; + for (_iter477 = this->success.begin(); _iter477 != this->success.end(); ++_iter477) { - xfer += (*_iter470).write(oprot); + xfer += (*_iter477).write(oprot); } xfer += oprot->writeListEnd(); } @@ -11121,14 +11409,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size471; - ::apache::thrift::protocol::TType _etype474; - iprot->readListBegin(_etype474, _size471); - (*(this->success)).resize(_size471); - uint32_t _i475; - for (_i475 = 0; _i475 < _size471; ++_i475) + uint32_t _size478; + ::apache::thrift::protocol::TType _etype481; + iprot->readListBegin(_etype481, _size478); + (*(this->success)).resize(_size478); + uint32_t _i482; + for (_i482 = 0; _i482 < _size478; ++_i482) { - xfer += (*(this->success))[_i475].read(iprot); + xfer += (*(this->success))[_i482].read(iprot); } iprot->readListEnd(); } @@ -11279,14 +11567,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size476; - ::apache::thrift::protocol::TType _etype479; - iprot->readListBegin(_etype479, _size476); - this->success.resize(_size476); - uint32_t _i480; - for (_i480 = 0; _i480 < _size476; ++_i480) + uint32_t _size483; + ::apache::thrift::protocol::TType _etype486; + iprot->readListBegin(_etype486, _size483); + this->success.resize(_size483); + uint32_t _i487; + for (_i487 = 0; _i487 < _size483; ++_i487) { - xfer += iprot->readString(this->success[_i480]); + xfer += iprot->readString(this->success[_i487]); } iprot->readListEnd(); } @@ -11325,10 +11613,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->success.size()); - std::vector ::const_iterator _iter481; - for (_iter481 = this->success.begin(); _iter481 != this->success.end(); ++_iter481) + std::vector ::const_iterator _iter488; + for (_iter488 = this->success.begin(); _iter488 != this->success.end(); ++_iter488) { - xfer += oprot->writeString((*_iter481)); + xfer += oprot->writeString((*_iter488)); } xfer += oprot->writeListEnd(); } @@ -11367,14 +11655,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size482; - ::apache::thrift::protocol::TType _etype485; - iprot->readListBegin(_etype485, _size482); - (*(this->success)).resize(_size482); - uint32_t _i486; - for (_i486 = 0; _i486 < _size482; ++_i486) + uint32_t _size489; + ::apache::thrift::protocol::TType _etype492; + iprot->readListBegin(_etype492, _size489); + (*(this->success)).resize(_size489); + uint32_t _i493; + for (_i493 = 0; _i493 < _size489; ++_i493) { - xfer += iprot->readString((*(this->success))[_i486]); + xfer += iprot->readString((*(this->success))[_i493]); } iprot->readListEnd(); } @@ -11831,14 +12119,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size487; - ::apache::thrift::protocol::TType _etype490; - iprot->readListBegin(_etype490, _size487); - this->success.resize(_size487); - uint32_t _i491; - for (_i491 = 0; _i491 < _size487; ++_i491) + uint32_t _size494; + ::apache::thrift::protocol::TType _etype497; + iprot->readListBegin(_etype497, _size494); + this->success.resize(_size494); + uint32_t _i498; + for (_i498 = 0; _i498 < _size494; ++_i498) { - xfer += iprot->readString(this->success[_i491]); + xfer += iprot->readString(this->success[_i498]); } iprot->readListEnd(); } @@ -11877,10 +12165,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->success.size()); - std::vector ::const_iterator _iter492; - for (_iter492 = this->success.begin(); _iter492 != this->success.end(); ++_iter492) + std::vector ::const_iterator _iter499; + for (_iter499 = this->success.begin(); _iter499 != this->success.end(); ++_iter499) { - xfer += oprot->writeString((*_iter492)); + xfer += oprot->writeString((*_iter499)); } xfer += oprot->writeListEnd(); } @@ -11919,14 +12207,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size493; - ::apache::thrift::protocol::TType _etype496; - iprot->readListBegin(_etype496, _size493); - (*(this->success)).resize(_size493); - uint32_t _i497; - for (_i497 = 0; _i497 < _size493; ++_i497) + uint32_t _size500; + ::apache::thrift::protocol::TType _etype503; + iprot->readListBegin(_etype503, _size500); + (*(this->success)).resize(_size500); + uint32_t _i504; + for (_i504 = 0; _i504 < _size500; ++_i504) { - xfer += iprot->readString((*(this->success))[_i497]); + xfer += iprot->readString((*(this->success))[_i504]); } iprot->readListEnd(); } @@ -11993,9 +12281,9 @@ break; case 3: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast498; - xfer += iprot->readI32(ecast498); - this->principal_type = (PrincipalType::type)ecast498; + int32_t ecast505; + xfer += iprot->readI32(ecast505); + this->principal_type = (PrincipalType::type)ecast505; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -12011,9 +12299,9 @@ break; case 5: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast499; - xfer += iprot->readI32(ecast499); - this->grantorType = (PrincipalType::type)ecast499; + int32_t ecast506; + xfer += iprot->readI32(ecast506); + this->grantorType = (PrincipalType::type)ecast506; this->__isset.grantorType = true; } else { xfer += iprot->skip(ftype); @@ -12245,9 +12533,9 @@ break; case 3: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast500; - xfer += iprot->readI32(ecast500); - this->principal_type = (PrincipalType::type)ecast500; + int32_t ecast507; + xfer += iprot->readI32(ecast507); + this->principal_type = (PrincipalType::type)ecast507; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -12445,9 +12733,9 @@ break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast501; - xfer += iprot->readI32(ecast501); - this->principal_type = (PrincipalType::type)ecast501; + int32_t ecast508; + xfer += iprot->readI32(ecast508); + this->principal_type = (PrincipalType::type)ecast508; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -12517,14 +12805,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size502; - ::apache::thrift::protocol::TType _etype505; - iprot->readListBegin(_etype505, _size502); - this->success.resize(_size502); - uint32_t _i506; - for (_i506 = 0; _i506 < _size502; ++_i506) + uint32_t _size509; + ::apache::thrift::protocol::TType _etype512; + iprot->readListBegin(_etype512, _size509); + this->success.resize(_size509); + uint32_t _i513; + for (_i513 = 0; _i513 < _size509; ++_i513) { - xfer += this->success[_i506].read(iprot); + xfer += this->success[_i513].read(iprot); } iprot->readListEnd(); } @@ -12563,10 +12851,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter507; - for (_iter507 = this->success.begin(); _iter507 != this->success.end(); ++_iter507) + std::vector ::const_iterator _iter514; + for (_iter514 = this->success.begin(); _iter514 != this->success.end(); ++_iter514) { - xfer += (*_iter507).write(oprot); + xfer += (*_iter514).write(oprot); } xfer += oprot->writeListEnd(); } @@ -12605,14 +12893,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size508; - ::apache::thrift::protocol::TType _etype511; - iprot->readListBegin(_etype511, _size508); - (*(this->success)).resize(_size508); - uint32_t _i512; - for (_i512 = 0; _i512 < _size508; ++_i512) + uint32_t _size515; + ::apache::thrift::protocol::TType _etype518; + iprot->readListBegin(_etype518, _size515); + (*(this->success)).resize(_size515); + uint32_t _i519; + for (_i519 = 0; _i519 < _size515; ++_i519) { - xfer += (*(this->success))[_i512].read(iprot); + xfer += (*(this->success))[_i519].read(iprot); } iprot->readListEnd(); } @@ -12681,14 +12969,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->group_names.clear(); - uint32_t _size513; - ::apache::thrift::protocol::TType _etype516; - iprot->readListBegin(_etype516, _size513); - this->group_names.resize(_size513); - uint32_t _i517; - for (_i517 = 0; _i517 < _size513; ++_i517) + uint32_t _size520; + ::apache::thrift::protocol::TType _etype523; + iprot->readListBegin(_etype523, _size520); + this->group_names.resize(_size520); + uint32_t _i524; + for (_i524 = 0; _i524 < _size520; ++_i524) { - xfer += iprot->readString(this->group_names[_i517]); + xfer += iprot->readString(this->group_names[_i524]); } iprot->readListEnd(); } @@ -12721,10 +13009,10 @@ xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->group_names.size()); - std::vector ::const_iterator _iter518; - for (_iter518 = this->group_names.begin(); _iter518 != this->group_names.end(); ++_iter518) + std::vector ::const_iterator _iter525; + for (_iter525 = this->group_names.begin(); _iter525 != this->group_names.end(); ++_iter525) { - xfer += oprot->writeString((*_iter518)); + xfer += oprot->writeString((*_iter525)); } xfer += oprot->writeListEnd(); } @@ -12746,10 +13034,10 @@ xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, (*(this->group_names)).size()); - std::vector ::const_iterator _iter519; - for (_iter519 = (*(this->group_names)).begin(); _iter519 != (*(this->group_names)).end(); ++_iter519) + std::vector ::const_iterator _iter526; + for (_iter526 = (*(this->group_names)).begin(); _iter526 != (*(this->group_names)).end(); ++_iter526) { - xfer += oprot->writeString((*_iter519)); + xfer += oprot->writeString((*_iter526)); } xfer += oprot->writeListEnd(); } @@ -12905,9 +13193,9 @@ break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast520; - xfer += iprot->readI32(ecast520); - this->principal_type = (PrincipalType::type)ecast520; + int32_t ecast527; + xfer += iprot->readI32(ecast527); + this->principal_type = (PrincipalType::type)ecast527; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -12991,14 +13279,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size521; - ::apache::thrift::protocol::TType _etype524; - iprot->readListBegin(_etype524, _size521); - this->success.resize(_size521); - uint32_t _i525; - for (_i525 = 0; _i525 < _size521; ++_i525) + uint32_t _size528; + ::apache::thrift::protocol::TType _etype531; + iprot->readListBegin(_etype531, _size528); + this->success.resize(_size528); + uint32_t _i532; + for (_i532 = 0; _i532 < _size528; ++_i532) { - xfer += this->success[_i525].read(iprot); + xfer += this->success[_i532].read(iprot); } iprot->readListEnd(); } @@ -13037,10 +13325,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter526; - for (_iter526 = this->success.begin(); _iter526 != this->success.end(); ++_iter526) + std::vector ::const_iterator _iter533; + for (_iter533 = this->success.begin(); _iter533 != this->success.end(); ++_iter533) { - xfer += (*_iter526).write(oprot); + xfer += (*_iter533).write(oprot); } xfer += oprot->writeListEnd(); } @@ -13079,14 +13367,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size527; - ::apache::thrift::protocol::TType _etype530; - iprot->readListBegin(_etype530, _size527); - (*(this->success)).resize(_size527); - uint32_t _i531; - for (_i531 = 0; _i531 < _size527; ++_i531) + uint32_t _size534; + ::apache::thrift::protocol::TType _etype537; + iprot->readListBegin(_etype537, _size534); + (*(this->success)).resize(_size534); + uint32_t _i538; + for (_i538 = 0; _i538 < _size534; ++_i538) { - xfer += (*(this->success))[_i531].read(iprot); + xfer += (*(this->success))[_i538].read(iprot); } iprot->readListEnd(); } @@ -15243,6 +15531,76 @@ return; } +void ThriftHiveMetastoreClient::rename_partition(const std::string& dbname, const std::string& name, const std::vector & part_vals, const Partition& new_part) +{ + send_rename_partition(dbname, name, part_vals, new_part); + recv_rename_partition(); +} + +void ThriftHiveMetastoreClient::send_rename_partition(const std::string& dbname, const std::string& name, const std::vector & part_vals, const Partition& new_part) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("rename_partition", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_rename_partition_pargs args; + args.dbname = &dbname; + args.name = &name; + args.part_vals = &part_vals; + args.new_part = &new_part; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->flush(); + oprot_->getTransport()->writeEnd(); +} + +void ThriftHiveMetastoreClient::recv_rename_partition() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); + } + if (fname.compare("rename_partition") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); + } + ThriftHiveMetastore_rename_partition_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + return; +} + void ThriftHiveMetastoreClient::add_partition(Partition& _return, const Partition& new_part) { send_add_partition(new_part); @@ -18666,6 +19024,45 @@ oprot->getTransport()->writeEnd(); } +void ThriftHiveMetastoreProcessor::process_rename_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +{ + ThriftHiveMetastore_rename_partition_args args; + args.read(iprot); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + + ThriftHiveMetastore_rename_partition_result result; + try { + iface_->rename_partition(args.dbname, args.name, args.part_vals, args.new_part); + } catch (InvalidOperationException &o1) { + result.o1 = o1; + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = o2; + result.__isset.o2 = true; + } catch (AlreadyExistsException &o3) { + result.o3 = o3; + result.__isset.o3 = true; + } catch (MetaException &o4) { + result.o4 = o4; + result.__isset.o4 = true; + } catch (const std::exception& e) { + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("rename_partition", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); + return; + } + + oprot->writeMessageBegin("rename_partition", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); +} + void ThriftHiveMetastoreProcessor::process_add_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) { ThriftHiveMetastore_add_partition_args args; Index: metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h =================================================================== --- metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h (revision 1145366) +++ metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h (working copy) @@ -34,6 +34,7 @@ virtual void get_table(Table& _return, const std::string& dbname, const std::string& tbl_name) = 0; virtual void get_table_objects_by_name(std::vector & _return, const std::string& dbname, const std::vector & tbl_names) = 0; virtual void alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl) = 0; + virtual void rename_partition(const std::string& dbname, const std::string& name, const std::vector & part_vals, const Partition& new_part) = 0; virtual void add_partition(Partition& _return, const Partition& new_part) = 0; virtual void append_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) = 0; virtual void append_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) = 0; @@ -139,6 +140,9 @@ void alter_table(const std::string& /* dbname */, const std::string& /* tbl_name */, const Table& /* new_tbl */) { return; } + void rename_partition(const std::string& /* dbname */, const std::string& /* name */, const std::vector & /* part_vals */, const Partition& /* new_part */) { + return; + } void add_partition(Partition& /* _return */, const Partition& /* new_part */) { return; } @@ -2435,6 +2439,139 @@ }; +typedef struct _ThriftHiveMetastore_rename_partition_args__isset { + _ThriftHiveMetastore_rename_partition_args__isset() : dbname(false), name(false), part_vals(false), new_part(false) {} + bool dbname; + bool name; + bool part_vals; + bool new_part; +} _ThriftHiveMetastore_rename_partition_args__isset; + +class ThriftHiveMetastore_rename_partition_args { + public: + + ThriftHiveMetastore_rename_partition_args() : dbname(""), name("") { + } + + virtual ~ThriftHiveMetastore_rename_partition_args() throw() {} + + std::string dbname; + std::string name; + std::vector part_vals; + Partition new_part; + + _ThriftHiveMetastore_rename_partition_args__isset __isset; + + bool operator == (const ThriftHiveMetastore_rename_partition_args & rhs) const + { + if (!(dbname == rhs.dbname)) + return false; + if (!(name == rhs.name)) + return false; + if (!(part_vals == rhs.part_vals)) + return false; + if (!(new_part == rhs.new_part)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_rename_partition_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_rename_partition_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_rename_partition_pargs { + public: + + + virtual ~ThriftHiveMetastore_rename_partition_pargs() throw() {} + + const std::string* dbname; + const std::string* name; + const std::vector * part_vals; + const Partition* new_part; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_rename_partition_result__isset { + _ThriftHiveMetastore_rename_partition_result__isset() : o1(false), o2(false), o3(false), o4(false) {} + bool o1; + bool o2; + bool o3; + bool o4; +} _ThriftHiveMetastore_rename_partition_result__isset; + +class ThriftHiveMetastore_rename_partition_result { + public: + + ThriftHiveMetastore_rename_partition_result() { + } + + virtual ~ThriftHiveMetastore_rename_partition_result() throw() {} + + InvalidOperationException o1; + InvalidObjectException o2; + AlreadyExistsException o3; + MetaException o4; + + _ThriftHiveMetastore_rename_partition_result__isset __isset; + + bool operator == (const ThriftHiveMetastore_rename_partition_result & rhs) const + { + if (!(o1 == rhs.o1)) + return false; + if (!(o2 == rhs.o2)) + return false; + if (!(o3 == rhs.o3)) + return false; + if (!(o4 == rhs.o4)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_rename_partition_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_rename_partition_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_rename_partition_presult__isset { + _ThriftHiveMetastore_rename_partition_presult__isset() : o1(false), o2(false), o3(false), o4(false) {} + bool o1; + bool o2; + bool o3; + bool o4; +} _ThriftHiveMetastore_rename_partition_presult__isset; + +class ThriftHiveMetastore_rename_partition_presult { + public: + + + virtual ~ThriftHiveMetastore_rename_partition_presult() throw() {} + + InvalidOperationException o1; + InvalidObjectException o2; + AlreadyExistsException o3; + MetaException o4; + + _ThriftHiveMetastore_rename_partition_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + typedef struct _ThriftHiveMetastore_add_partition_args__isset { _ThriftHiveMetastore_add_partition_args__isset() : new_part(false) {} bool new_part; @@ -7399,6 +7536,9 @@ void alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl); void send_alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl); void recv_alter_table(); + void rename_partition(const std::string& dbname, const std::string& name, const std::vector & part_vals, const Partition& new_part); + void send_rename_partition(const std::string& dbname, const std::string& name, const std::vector & part_vals, const Partition& new_part); + void recv_rename_partition(); void add_partition(Partition& _return, const Partition& new_part); void send_add_partition(const Partition& new_part); void recv_add_partition(Partition& _return); @@ -7549,6 +7689,7 @@ void process_get_table(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_get_table_objects_by_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_alter_table(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); + void process_rename_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_add_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_append_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_append_partition_by_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); @@ -7613,6 +7754,7 @@ processMap_["get_table"] = &ThriftHiveMetastoreProcessor::process_get_table; processMap_["get_table_objects_by_name"] = &ThriftHiveMetastoreProcessor::process_get_table_objects_by_name; processMap_["alter_table"] = &ThriftHiveMetastoreProcessor::process_alter_table; + processMap_["rename_partition"] = &ThriftHiveMetastoreProcessor::process_rename_partition; processMap_["add_partition"] = &ThriftHiveMetastoreProcessor::process_add_partition; processMap_["append_partition"] = &ThriftHiveMetastoreProcessor::process_append_partition; processMap_["append_partition_by_name"] = &ThriftHiveMetastoreProcessor::process_append_partition_by_name; @@ -7873,6 +8015,13 @@ } } + void rename_partition(const std::string& dbname, const std::string& name, const std::vector & part_vals, const Partition& new_part) { + uint32_t sz = ifaces_.size(); + for (uint32_t i = 0; i < sz; ++i) { + ifaces_[i]->rename_partition(dbname, name, part_vals, new_part); + } + } + void add_partition(Partition& _return, const Partition& new_part) { uint32_t sz = ifaces_.size(); for (uint32_t i = 0; i < sz; ++i) { Index: metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp =================================================================== --- metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp (revision 1145366) +++ metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp (working copy) @@ -117,6 +117,11 @@ printf("alter_table\n"); } + void rename_partition(const std::string& dbname, const std::string& name, const std::vector & part_vals, const Partition& new_part) { + // Your implementation goes here + printf("rename_partition\n"); + } + void add_partition(Partition& _return, const Partition& new_part) { // Your implementation goes here printf("add_partition\n"); Index: metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb =================================================================== --- metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb (revision 1145366) +++ metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb (working copy) @@ -332,6 +332,24 @@ return end + def rename_partition(dbname, name, part_vals, new_part) + send_rename_partition(dbname, name, part_vals, new_part) + recv_rename_partition() + end + + def send_rename_partition(dbname, name, part_vals, new_part) + send_message('rename_partition', Rename_partition_args, :dbname => dbname, :name => name, :part_vals => part_vals, :new_part => new_part) + end + + def recv_rename_partition() + result = receive_message(Rename_partition_result) + raise result.o1 unless result.o1.nil? + raise result.o2 unless result.o2.nil? + raise result.o3 unless result.o3.nil? + raise result.o4 unless result.o4.nil? + return + end + def add_partition(new_part) send_add_partition(new_part) return recv_add_partition() @@ -1275,6 +1293,23 @@ write_result(result, oprot, 'alter_table', seqid) end + def process_rename_partition(seqid, iprot, oprot) + args = read_args(iprot, Rename_partition_args) + result = Rename_partition_result.new() + begin + @handler.rename_partition(args.dbname, args.name, args.part_vals, args.new_part) + rescue InvalidOperationException => o1 + result.o1 = o1 + rescue InvalidObjectException => o2 + result.o2 = o2 + rescue AlreadyExistsException => o3 + result.o3 = o3 + rescue MetaException => o4 + result.o4 = o4 + end + write_result(result, oprot, 'rename_partition', seqid) + end + def process_add_partition(seqid, iprot, oprot) args = read_args(iprot, Add_partition_args) result = Add_partition_result.new() @@ -2497,6 +2532,50 @@ ::Thrift::Struct.generate_accessors self end + class Rename_partition_args + include ::Thrift::Struct, ::Thrift::Struct_Union + DBNAME = 1 + NAME = 2 + PART_VALS = 3 + NEW_PART = 4 + + FIELDS = { + DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbname'}, + NAME => {:type => ::Thrift::Types::STRING, :name => 'name'}, + PART_VALS => {:type => ::Thrift::Types::LIST, :name => 'part_vals', :element => {:type => ::Thrift::Types::STRING}}, + NEW_PART => {:type => ::Thrift::Types::STRUCT, :name => 'new_part', :class => Partition} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Rename_partition_result + include ::Thrift::Struct, ::Thrift::Struct_Union + O1 = 1 + O2 = 2 + O3 = 3 + O4 = 4 + + FIELDS = { + O1 => {:type => ::Thrift::Types::STRUCT, :name => 'o1', :class => InvalidOperationException}, + O2 => {:type => ::Thrift::Types::STRUCT, :name => 'o2', :class => InvalidObjectException}, + O3 => {:type => ::Thrift::Types::STRUCT, :name => 'o3', :class => AlreadyExistsException}, + O4 => {:type => ::Thrift::Types::STRUCT, :name => 'o4', :class => MetaException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + class Add_partition_args include ::Thrift::Struct, ::Thrift::Struct_Union NEW_PART = 1 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 1145366) +++ metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java (working copy) @@ -71,6 +71,8 @@ public void alter_table(String dbname, String tbl_name, Table new_tbl) throws InvalidOperationException, MetaException, TException; + public void rename_partition(String dbname, String name, List part_vals, Partition new_part) throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException, TException; + public Partition add_partition(Partition new_part) throws InvalidObjectException, AlreadyExistsException, MetaException, TException; public Partition append_partition(String db_name, String tbl_name, List part_vals) throws InvalidObjectException, AlreadyExistsException, MetaException, TException; @@ -195,6 +197,8 @@ public void alter_table(String dbname, String tbl_name, Table new_tbl, AsyncMethodCallback resultHandler) throws TException; + public void rename_partition(String dbname, String name, List part_vals, Partition new_part, AsyncMethodCallback resultHandler) throws TException; + public void add_partition(Partition new_part, AsyncMethodCallback resultHandler) throws TException; public void append_partition(String db_name, String tbl_name, List part_vals, AsyncMethodCallback resultHandler) throws TException; @@ -1100,6 +1104,54 @@ return; } + public void rename_partition(String dbname, String name, List part_vals, Partition new_part) throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException, TException + { + send_rename_partition(dbname, name, part_vals, new_part); + recv_rename_partition(); + } + + public void send_rename_partition(String dbname, String name, List part_vals, Partition new_part) throws TException + { + oprot_.writeMessageBegin(new TMessage("rename_partition", TMessageType.CALL, ++seqid_)); + rename_partition_args args = new rename_partition_args(); + args.setDbname(dbname); + args.setName(name); + args.setPart_vals(part_vals); + args.setNew_part(new_part); + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public void recv_rename_partition() throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "rename_partition failed: out of sequence response"); + } + rename_partition_result result = new rename_partition_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.o1 != null) { + throw result.o1; + } + if (result.o2 != null) { + throw result.o2; + } + if (result.o3 != null) { + throw result.o3; + } + if (result.o4 != null) { + throw result.o4; + } + return; + } + public Partition add_partition(Partition new_part) throws InvalidObjectException, AlreadyExistsException, MetaException, TException { send_add_partition(new_part); @@ -3502,6 +3554,46 @@ } } + public void rename_partition(String dbname, String name, List part_vals, Partition new_part, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + rename_partition_call method_call = new rename_partition_call(dbname, name, part_vals, new_part, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class rename_partition_call extends TAsyncMethodCall { + private String dbname; + private String name; + private List part_vals; + private Partition new_part; + public rename_partition_call(String dbname, String name, List part_vals, Partition new_part, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.dbname = dbname; + this.name = name; + this.part_vals = part_vals; + this.new_part = new_part; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("rename_partition", TMessageType.CALL, 0)); + rename_partition_args args = new rename_partition_args(); + args.setDbname(dbname); + args.setName(name); + args.setPart_vals(part_vals); + args.setNew_part(new_part); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_rename_partition(); + } + } + public void add_partition(Partition new_part, AsyncMethodCallback resultHandler) throws TException { checkReady(); add_partition_call method_call = new add_partition_call(new_part, resultHandler, this, protocolFactory, transport); @@ -5028,6 +5120,7 @@ processMap_.put("get_table", new get_table()); processMap_.put("get_table_objects_by_name", new get_table_objects_by_name()); processMap_.put("alter_table", new alter_table()); + processMap_.put("rename_partition", new rename_partition()); processMap_.put("add_partition", new add_partition()); processMap_.put("append_partition", new append_partition()); processMap_.put("append_partition_by_name", new append_partition_by_name()); @@ -5859,6 +5952,50 @@ } + private class rename_partition implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + rename_partition_args args = new rename_partition_args(); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("rename_partition", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + iprot.readMessageEnd(); + rename_partition_result result = new rename_partition_result(); + try { + iface_.rename_partition(args.dbname, args.name, args.part_vals, args.new_part); + } catch (InvalidOperationException o1) { + result.o1 = o1; + } catch (InvalidObjectException o2) { + result.o2 = o2; + } catch (AlreadyExistsException o3) { + result.o3 = o3; + } catch (MetaException o4) { + result.o4 = o4; + } catch (Throwable th) { + LOGGER.error("Internal error processing rename_partition", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing rename_partition"); + oprot.writeMessageBegin(new TMessage("rename_partition", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("rename_partition", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + private class add_partition implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { @@ -22433,6 +22570,1128 @@ } + public static class rename_partition_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("rename_partition_args"); + + private static final TField DBNAME_FIELD_DESC = new TField("dbname", TType.STRING, (short)1); + private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)2); + private static final TField PART_VALS_FIELD_DESC = new TField("part_vals", TType.LIST, (short)3); + private static final TField NEW_PART_FIELD_DESC = new TField("new_part", TType.STRUCT, (short)4); + + private String dbname; + private String name; + private List part_vals; + private Partition new_part; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + DBNAME((short)1, "dbname"), + NAME((short)2, "name"), + PART_VALS((short)3, "part_vals"), + NEW_PART((short)4, "new_part"); + + 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: // DBNAME + return DBNAME; + case 2: // NAME + return NAME; + case 3: // PART_VALS + return PART_VALS; + case 4: // NEW_PART + return NEW_PART; + 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 + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.DBNAME, new FieldMetaData("dbname", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.PART_VALS, new FieldMetaData("part_vals", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); + tmpMap.put(_Fields.NEW_PART, new FieldMetaData("new_part", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Partition.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(rename_partition_args.class, metaDataMap); + } + + public rename_partition_args() { + } + + public rename_partition_args( + String dbname, + String name, + List part_vals, + Partition new_part) + { + this(); + this.dbname = dbname; + this.name = name; + this.part_vals = part_vals; + this.new_part = new_part; + } + + /** + * Performs a deep copy on other. + */ + public rename_partition_args(rename_partition_args other) { + if (other.isSetDbname()) { + this.dbname = other.dbname; + } + if (other.isSetName()) { + this.name = other.name; + } + 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; + } + if (other.isSetNew_part()) { + this.new_part = new Partition(other.new_part); + } + } + + public rename_partition_args deepCopy() { + return new rename_partition_args(this); + } + + @Override + public void clear() { + this.dbname = null; + this.name = null; + this.part_vals = null; + this.new_part = null; + } + + public String getDbname() { + return this.dbname; + } + + public void setDbname(String dbname) { + this.dbname = dbname; + } + + public void unsetDbname() { + this.dbname = null; + } + + /** Returns true if field dbname is set (has been asigned a value) and false otherwise */ + public boolean isSetDbname() { + return this.dbname != null; + } + + public void setDbnameIsSet(boolean value) { + if (!value) { + this.dbname = null; + } + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public void unsetName() { + this.name = null; + } + + /** Returns true if field name is set (has been asigned a value) and false otherwise */ + public boolean isSetName() { + return this.name != null; + } + + public void setNameIsSet(boolean value) { + if (!value) { + this.name = null; + } + } + + 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 asigned 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 Partition getNew_part() { + return this.new_part; + } + + public void setNew_part(Partition new_part) { + this.new_part = new_part; + } + + public void unsetNew_part() { + this.new_part = null; + } + + /** Returns true if field new_part is set (has been asigned a value) and false otherwise */ + public boolean isSetNew_part() { + return this.new_part != null; + } + + public void setNew_partIsSet(boolean value) { + if (!value) { + this.new_part = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case DBNAME: + if (value == null) { + unsetDbname(); + } else { + setDbname((String)value); + } + break; + + case NAME: + if (value == null) { + unsetName(); + } else { + setName((String)value); + } + break; + + case PART_VALS: + if (value == null) { + unsetPart_vals(); + } else { + setPart_vals((List)value); + } + break; + + case NEW_PART: + if (value == null) { + unsetNew_part(); + } else { + setNew_part((Partition)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case DBNAME: + return getDbname(); + + case NAME: + return getName(); + + case PART_VALS: + return getPart_vals(); + + case NEW_PART: + return getNew_part(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case DBNAME: + return isSetDbname(); + case NAME: + return isSetName(); + case PART_VALS: + return isSetPart_vals(); + case NEW_PART: + return isSetNew_part(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof rename_partition_args) + return this.equals((rename_partition_args)that); + return false; + } + + public boolean equals(rename_partition_args that) { + if (that == null) + return false; + + boolean this_present_dbname = true && this.isSetDbname(); + boolean that_present_dbname = true && that.isSetDbname(); + if (this_present_dbname || that_present_dbname) { + if (!(this_present_dbname && that_present_dbname)) + return false; + if (!this.dbname.equals(that.dbname)) + return false; + } + + boolean this_present_name = true && this.isSetName(); + boolean that_present_name = true && that.isSetName(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + boolean this_present_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_new_part = true && this.isSetNew_part(); + boolean that_present_new_part = true && that.isSetNew_part(); + if (this_present_new_part || that_present_new_part) { + if (!(this_present_new_part && that_present_new_part)) + return false; + if (!this.new_part.equals(that.new_part)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(rename_partition_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + rename_partition_args typedOther = (rename_partition_args)other; + + lastComparison = Boolean.valueOf(isSetDbname()).compareTo(typedOther.isSetDbname()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDbname()) { + lastComparison = TBaseHelper.compareTo(this.dbname, typedOther.dbname); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetName()) { + lastComparison = TBaseHelper.compareTo(this.name, typedOther.name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPart_vals()).compareTo(typedOther.isSetPart_vals()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPart_vals()) { + lastComparison = TBaseHelper.compareTo(this.part_vals, typedOther.part_vals); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNew_part()).compareTo(typedOther.isSetNew_part()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNew_part()) { + lastComparison = TBaseHelper.compareTo(this.new_part, typedOther.new_part); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 1: // DBNAME + if (field.type == TType.STRING) { + this.dbname = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // NAME + if (field.type == TType.STRING) { + this.name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // PART_VALS + if (field.type == TType.LIST) { + { + TList _list135 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list135.size); + for (int _i136 = 0; _i136 < _list135.size; ++_i136) + { + String _elem137; + _elem137 = iprot.readString(); + this.part_vals.add(_elem137); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // NEW_PART + if (field.type == TType.STRUCT) { + this.new_part = new Partition(); + this.new_part.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.dbname != null) { + oprot.writeFieldBegin(DBNAME_FIELD_DESC); + oprot.writeString(this.dbname); + oprot.writeFieldEnd(); + } + if (this.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(this.name); + oprot.writeFieldEnd(); + } + if (this.part_vals != null) { + oprot.writeFieldBegin(PART_VALS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); + for (String _iter138 : this.part_vals) + { + oprot.writeString(_iter138); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (this.new_part != null) { + oprot.writeFieldBegin(NEW_PART_FIELD_DESC); + this.new_part.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("rename_partition_args("); + boolean first = true; + + sb.append("dbname:"); + if (this.dbname == null) { + sb.append("null"); + } else { + sb.append(this.dbname); + } + first = false; + if (!first) sb.append(", "); + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + if (!first) sb.append(", "); + sb.append("part_vals:"); + if (this.part_vals == null) { + sb.append("null"); + } else { + sb.append(this.part_vals); + } + first = false; + if (!first) sb.append(", "); + sb.append("new_part:"); + if (this.new_part == null) { + sb.append("null"); + } else { + sb.append(this.new_part); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + + public static class rename_partition_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("rename_partition_result"); + + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); + private static final TField O4_FIELD_DESC = new TField("o4", TType.STRUCT, (short)4); + + private InvalidOperationException o1; + private InvalidObjectException o2; + private AlreadyExistsException o3; + private MetaException o4; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + O1((short)1, "o1"), + O2((short)2, "o2"), + O3((short)3, "o3"), + O4((short)4, "o4"); + + 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: // O1 + return O1; + case 2: // O2 + return O2; + case 3: // O3 + return O3; + case 4: // O4 + return O4; + 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 + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + tmpMap.put(_Fields.O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + tmpMap.put(_Fields.O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + tmpMap.put(_Fields.O4, new FieldMetaData("o4", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(rename_partition_result.class, metaDataMap); + } + + public rename_partition_result() { + } + + public rename_partition_result( + InvalidOperationException o1, + InvalidObjectException o2, + AlreadyExistsException o3, + MetaException o4) + { + this(); + this.o1 = o1; + this.o2 = o2; + this.o3 = o3; + this.o4 = o4; + } + + /** + * Performs a deep copy on other. + */ + public rename_partition_result(rename_partition_result other) { + if (other.isSetO1()) { + this.o1 = new InvalidOperationException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new InvalidObjectException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new AlreadyExistsException(other.o3); + } + if (other.isSetO4()) { + this.o4 = new MetaException(other.o4); + } + } + + public rename_partition_result deepCopy() { + return new rename_partition_result(this); + } + + @Override + public void clear() { + this.o1 = null; + this.o2 = null; + this.o3 = null; + this.o4 = null; + } + + public InvalidOperationException getO1() { + return this.o1; + } + + public void setO1(InvalidOperationException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + /** Returns true if field o1 is set (has been asigned a value) and false otherwise */ + public boolean isSetO1() { + return this.o1 != null; + } + + public void setO1IsSet(boolean value) { + if (!value) { + this.o1 = null; + } + } + + public InvalidObjectException getO2() { + return this.o2; + } + + public void setO2(InvalidObjectException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + /** Returns true if field o2 is set (has been asigned a value) and false otherwise */ + public boolean isSetO2() { + return this.o2 != null; + } + + public void setO2IsSet(boolean value) { + if (!value) { + this.o2 = null; + } + } + + public AlreadyExistsException getO3() { + return this.o3; + } + + public void setO3(AlreadyExistsException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + /** Returns true if field o3 is set (has been asigned a value) and false otherwise */ + public boolean isSetO3() { + return this.o3 != null; + } + + public void setO3IsSet(boolean value) { + if (!value) { + this.o3 = null; + } + } + + public MetaException getO4() { + return this.o4; + } + + public void setO4(MetaException o4) { + this.o4 = o4; + } + + public void unsetO4() { + this.o4 = null; + } + + /** Returns true if field o4 is set (has been asigned a value) and false otherwise */ + public boolean isSetO4() { + return this.o4 != null; + } + + public void setO4IsSet(boolean value) { + if (!value) { + this.o4 = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((InvalidOperationException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((InvalidObjectException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((AlreadyExistsException)value); + } + break; + + case O4: + if (value == null) { + unsetO4(); + } else { + setO4((MetaException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case O1: + return getO1(); + + case O2: + return getO2(); + + case O3: + return getO3(); + + case O4: + return getO4(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case O1: + return isSetO1(); + case O2: + return isSetO2(); + case O3: + return isSetO3(); + case O4: + return isSetO4(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof rename_partition_result) + return this.equals((rename_partition_result)that); + return false; + } + + public boolean equals(rename_partition_result that) { + if (that == null) + return false; + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + boolean this_present_o3 = true && this.isSetO3(); + boolean that_present_o3 = true && that.isSetO3(); + if (this_present_o3 || that_present_o3) { + if (!(this_present_o3 && that_present_o3)) + return false; + if (!this.o3.equals(that.o3)) + return false; + } + + boolean this_present_o4 = true && this.isSetO4(); + boolean that_present_o4 = true && that.isSetO4(); + if (this_present_o4 || that_present_o4) { + if (!(this_present_o4 && that_present_o4)) + return false; + if (!this.o4.equals(that.o4)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(rename_partition_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + rename_partition_result typedOther = (rename_partition_result)other; + + lastComparison = Boolean.valueOf(isSetO1()).compareTo(typedOther.isSetO1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO1()) { + lastComparison = TBaseHelper.compareTo(this.o1, typedOther.o1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO2()).compareTo(typedOther.isSetO2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO2()) { + lastComparison = TBaseHelper.compareTo(this.o2, typedOther.o2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO3()).compareTo(typedOther.isSetO3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO3()) { + lastComparison = TBaseHelper.compareTo(this.o3, typedOther.o3); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO4()).compareTo(typedOther.isSetO4()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO4()) { + lastComparison = TBaseHelper.compareTo(this.o4, typedOther.o4); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 1: // O1 + if (field.type == TType.STRUCT) { + this.o1 = new InvalidOperationException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // O2 + if (field.type == TType.STRUCT) { + this.o2 = new InvalidObjectException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // O3 + if (field.type == TType.STRUCT) { + this.o3 = new AlreadyExistsException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // O4 + if (field.type == TType.STRUCT) { + this.o4 = new MetaException(); + this.o4.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO4()) { + oprot.writeFieldBegin(O4_FIELD_DESC); + this.o4.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("rename_partition_result("); + boolean first = true; + + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; + if (!first) sb.append(", "); + sb.append("o3:"); + if (this.o3 == null) { + sb.append("null"); + } else { + sb.append(this.o3); + } + first = false; + if (!first) sb.append(", "); + sb.append("o4:"); + if (this.o4 == null) { + sb.append("null"); + } else { + sb.append(this.o4); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + public static class add_partition_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("add_partition_args"); @@ -23654,13 +24913,13 @@ case 3: // PART_VALS if (field.type == TType.LIST) { { - TList _list135 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list135.size); - for (int _i136 = 0; _i136 < _list135.size; ++_i136) + TList _list139 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list139.size); + for (int _i140 = 0; _i140 < _list139.size; ++_i140) { - String _elem137; - _elem137 = iprot.readString(); - this.part_vals.add(_elem137); + String _elem141; + _elem141 = iprot.readString(); + this.part_vals.add(_elem141); } iprot.readListEnd(); } @@ -23695,9 +24954,9 @@ oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter138 : this.part_vals) + for (String _iter142 : this.part_vals) { - oprot.writeString(_iter138); + oprot.writeString(_iter142); } oprot.writeListEnd(); } @@ -25754,13 +27013,13 @@ case 3: // PART_VALS if (field.type == TType.LIST) { { - TList _list139 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list139.size); - for (int _i140 = 0; _i140 < _list139.size; ++_i140) + TList _list143 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list143.size); + for (int _i144 = 0; _i144 < _list143.size; ++_i144) { - String _elem141; - _elem141 = iprot.readString(); - this.part_vals.add(_elem141); + String _elem145; + _elem145 = iprot.readString(); + this.part_vals.add(_elem145); } iprot.readListEnd(); } @@ -25803,9 +27062,9 @@ oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter142 : this.part_vals) + for (String _iter146 : this.part_vals) { - oprot.writeString(_iter142); + oprot.writeString(_iter146); } oprot.writeListEnd(); } @@ -27706,13 +28965,13 @@ case 3: // PART_VALS if (field.type == TType.LIST) { { - TList _list143 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list143.size); - for (int _i144 = 0; _i144 < _list143.size; ++_i144) + TList _list147 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list147.size); + for (int _i148 = 0; _i148 < _list147.size; ++_i148) { - String _elem145; - _elem145 = iprot.readString(); - this.part_vals.add(_elem145); + String _elem149; + _elem149 = iprot.readString(); + this.part_vals.add(_elem149); } iprot.readListEnd(); } @@ -27747,9 +29006,9 @@ oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter146 : this.part_vals) + for (String _iter150 : this.part_vals) { - oprot.writeString(_iter146); + oprot.writeString(_iter150); } oprot.writeListEnd(); } @@ -28807,13 +30066,13 @@ case 3: // PART_VALS if (field.type == TType.LIST) { { - TList _list147 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list147.size); - for (int _i148 = 0; _i148 < _list147.size; ++_i148) + TList _list151 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list151.size); + for (int _i152 = 0; _i152 < _list151.size; ++_i152) { - String _elem149; - _elem149 = iprot.readString(); - this.part_vals.add(_elem149); + String _elem153; + _elem153 = iprot.readString(); + this.part_vals.add(_elem153); } iprot.readListEnd(); } @@ -28831,13 +30090,13 @@ case 5: // GROUP_NAMES if (field.type == TType.LIST) { { - TList _list150 = iprot.readListBegin(); - this.group_names = new ArrayList(_list150.size); - for (int _i151 = 0; _i151 < _list150.size; ++_i151) + TList _list154 = iprot.readListBegin(); + this.group_names = new ArrayList(_list154.size); + for (int _i155 = 0; _i155 < _list154.size; ++_i155) { - String _elem152; - _elem152 = iprot.readString(); - this.group_names.add(_elem152); + String _elem156; + _elem156 = iprot.readString(); + this.group_names.add(_elem156); } iprot.readListEnd(); } @@ -28872,9 +30131,9 @@ oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter153 : this.part_vals) + for (String _iter157 : this.part_vals) { - oprot.writeString(_iter153); + oprot.writeString(_iter157); } oprot.writeListEnd(); } @@ -28889,9 +30148,9 @@ oprot.writeFieldBegin(GROUP_NAMES_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.group_names.size())); - for (String _iter154 : this.group_names) + for (String _iter158 : this.group_names) { - oprot.writeString(_iter154); + oprot.writeString(_iter158); } oprot.writeListEnd(); } @@ -31157,14 +32416,14 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list155 = iprot.readListBegin(); - this.success = new ArrayList(_list155.size); - for (int _i156 = 0; _i156 < _list155.size; ++_i156) + TList _list159 = iprot.readListBegin(); + this.success = new ArrayList(_list159.size); + for (int _i160 = 0; _i160 < _list159.size; ++_i160) { - Partition _elem157; - _elem157 = new Partition(); - _elem157.read(iprot); - this.success.add(_elem157); + Partition _elem161; + _elem161 = new Partition(); + _elem161.read(iprot); + this.success.add(_elem161); } iprot.readListEnd(); } @@ -31204,9 +32463,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter158 : this.success) + for (Partition _iter162 : this.success) { - _iter158.write(oprot); + _iter162.write(oprot); } oprot.writeListEnd(); } @@ -31818,13 +33077,13 @@ case 5: // GROUP_NAMES if (field.type == TType.LIST) { { - TList _list159 = iprot.readListBegin(); - this.group_names = new ArrayList(_list159.size); - for (int _i160 = 0; _i160 < _list159.size; ++_i160) + TList _list163 = iprot.readListBegin(); + this.group_names = new ArrayList(_list163.size); + for (int _i164 = 0; _i164 < _list163.size; ++_i164) { - String _elem161; - _elem161 = iprot.readString(); - this.group_names.add(_elem161); + String _elem165; + _elem165 = iprot.readString(); + this.group_names.add(_elem165); } iprot.readListEnd(); } @@ -31867,9 +33126,9 @@ oprot.writeFieldBegin(GROUP_NAMES_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.group_names.size())); - for (String _iter162 : this.group_names) + for (String _iter166 : this.group_names) { - oprot.writeString(_iter162); + oprot.writeString(_iter166); } oprot.writeListEnd(); } @@ -32315,14 +33574,14 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list163 = iprot.readListBegin(); - this.success = new ArrayList(_list163.size); - for (int _i164 = 0; _i164 < _list163.size; ++_i164) + TList _list167 = iprot.readListBegin(); + this.success = new ArrayList(_list167.size); + for (int _i168 = 0; _i168 < _list167.size; ++_i168) { - Partition _elem165; - _elem165 = new Partition(); - _elem165.read(iprot); - this.success.add(_elem165); + Partition _elem169; + _elem169 = new Partition(); + _elem169.read(iprot); + this.success.add(_elem169); } iprot.readListEnd(); } @@ -32362,9 +33621,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter166 : this.success) + for (Partition _iter170 : this.success) { - _iter166.write(oprot); + _iter170.write(oprot); } oprot.writeListEnd(); } @@ -33192,13 +34451,13 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list167 = iprot.readListBegin(); - this.success = new ArrayList(_list167.size); - for (int _i168 = 0; _i168 < _list167.size; ++_i168) + TList _list171 = iprot.readListBegin(); + this.success = new ArrayList(_list171.size); + for (int _i172 = 0; _i172 < _list171.size; ++_i172) { - String _elem169; - _elem169 = iprot.readString(); - this.success.add(_elem169); + String _elem173; + _elem173 = iprot.readString(); + this.success.add(_elem173); } iprot.readListEnd(); } @@ -33230,9 +34489,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter170 : this.success) + for (String _iter174 : this.success) { - oprot.writeString(_iter170); + oprot.writeString(_iter174); } oprot.writeListEnd(); } @@ -33749,13 +35008,13 @@ case 3: // PART_VALS if (field.type == TType.LIST) { { - TList _list171 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list171.size); - for (int _i172 = 0; _i172 < _list171.size; ++_i172) + TList _list175 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list175.size); + for (int _i176 = 0; _i176 < _list175.size; ++_i176) { - String _elem173; - _elem173 = iprot.readString(); - this.part_vals.add(_elem173); + String _elem177; + _elem177 = iprot.readString(); + this.part_vals.add(_elem177); } iprot.readListEnd(); } @@ -33798,9 +35057,9 @@ oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter174 : this.part_vals) + for (String _iter178 : this.part_vals) { - oprot.writeString(_iter174); + oprot.writeString(_iter178); } oprot.writeListEnd(); } @@ -34173,14 +35432,14 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list175 = iprot.readListBegin(); - this.success = new ArrayList(_list175.size); - for (int _i176 = 0; _i176 < _list175.size; ++_i176) + TList _list179 = iprot.readListBegin(); + this.success = new ArrayList(_list179.size); + for (int _i180 = 0; _i180 < _list179.size; ++_i180) { - Partition _elem177; - _elem177 = new Partition(); - _elem177.read(iprot); - this.success.add(_elem177); + Partition _elem181; + _elem181 = new Partition(); + _elem181.read(iprot); + this.success.add(_elem181); } iprot.readListEnd(); } @@ -34212,9 +35471,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter178 : this.success) + for (Partition _iter182 : this.success) { - _iter178.write(oprot); + _iter182.write(oprot); } oprot.writeListEnd(); } @@ -34887,13 +36146,13 @@ case 3: // PART_VALS if (field.type == TType.LIST) { { - TList _list179 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list179.size); - for (int _i180 = 0; _i180 < _list179.size; ++_i180) + TList _list183 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list183.size); + for (int _i184 = 0; _i184 < _list183.size; ++_i184) { - String _elem181; - _elem181 = iprot.readString(); - this.part_vals.add(_elem181); + String _elem185; + _elem185 = iprot.readString(); + this.part_vals.add(_elem185); } iprot.readListEnd(); } @@ -34919,13 +36178,13 @@ case 6: // GROUP_NAMES if (field.type == TType.LIST) { { - TList _list182 = iprot.readListBegin(); - this.group_names = new ArrayList(_list182.size); - for (int _i183 = 0; _i183 < _list182.size; ++_i183) + TList _list186 = iprot.readListBegin(); + this.group_names = new ArrayList(_list186.size); + for (int _i187 = 0; _i187 < _list186.size; ++_i187) { - String _elem184; - _elem184 = iprot.readString(); - this.group_names.add(_elem184); + String _elem188; + _elem188 = iprot.readString(); + this.group_names.add(_elem188); } iprot.readListEnd(); } @@ -34960,9 +36219,9 @@ oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter185 : this.part_vals) + for (String _iter189 : this.part_vals) { - oprot.writeString(_iter185); + oprot.writeString(_iter189); } oprot.writeListEnd(); } @@ -34980,9 +36239,9 @@ oprot.writeFieldBegin(GROUP_NAMES_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.group_names.size())); - for (String _iter186 : this.group_names) + for (String _iter190 : this.group_names) { - oprot.writeString(_iter186); + oprot.writeString(_iter190); } oprot.writeListEnd(); } @@ -35436,14 +36695,14 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list187 = iprot.readListBegin(); - this.success = new ArrayList(_list187.size); - for (int _i188 = 0; _i188 < _list187.size; ++_i188) + TList _list191 = iprot.readListBegin(); + this.success = new ArrayList(_list191.size); + for (int _i192 = 0; _i192 < _list191.size; ++_i192) { - Partition _elem189; - _elem189 = new Partition(); - _elem189.read(iprot); - this.success.add(_elem189); + Partition _elem193; + _elem193 = new Partition(); + _elem193.read(iprot); + this.success.add(_elem193); } iprot.readListEnd(); } @@ -35483,9 +36742,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter190 : this.success) + for (Partition _iter194 : this.success) { - _iter190.write(oprot); + _iter194.write(oprot); } oprot.writeListEnd(); } @@ -36014,13 +37273,13 @@ case 3: // PART_VALS if (field.type == TType.LIST) { { - TList _list191 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list191.size); - for (int _i192 = 0; _i192 < _list191.size; ++_i192) + TList _list195 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list195.size); + for (int _i196 = 0; _i196 < _list195.size; ++_i196) { - String _elem193; - _elem193 = iprot.readString(); - this.part_vals.add(_elem193); + String _elem197; + _elem197 = iprot.readString(); + this.part_vals.add(_elem197); } iprot.readListEnd(); } @@ -36063,9 +37322,9 @@ oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter194 : this.part_vals) + for (String _iter198 : this.part_vals) { - oprot.writeString(_iter194); + oprot.writeString(_iter198); } oprot.writeListEnd(); } @@ -36438,13 +37697,13 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list195 = iprot.readListBegin(); - this.success = new ArrayList(_list195.size); - for (int _i196 = 0; _i196 < _list195.size; ++_i196) + TList _list199 = iprot.readListBegin(); + this.success = new ArrayList(_list199.size); + for (int _i200 = 0; _i200 < _list199.size; ++_i200) { - String _elem197; - _elem197 = iprot.readString(); - this.success.add(_elem197); + String _elem201; + _elem201 = iprot.readString(); + this.success.add(_elem201); } iprot.readListEnd(); } @@ -36476,9 +37735,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter198 : this.success) + for (String _iter202 : this.success) { - oprot.writeString(_iter198); + oprot.writeString(_iter202); } oprot.writeListEnd(); } @@ -37450,14 +38709,14 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list199 = iprot.readListBegin(); - this.success = new ArrayList(_list199.size); - for (int _i200 = 0; _i200 < _list199.size; ++_i200) + TList _list203 = iprot.readListBegin(); + this.success = new ArrayList(_list203.size); + for (int _i204 = 0; _i204 < _list203.size; ++_i204) { - Partition _elem201; - _elem201 = new Partition(); - _elem201.read(iprot); - this.success.add(_elem201); + Partition _elem205; + _elem205 = new Partition(); + _elem205.read(iprot); + this.success.add(_elem205); } iprot.readListEnd(); } @@ -37497,9 +38756,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter202 : this.success) + for (Partition _iter206 : this.success) { - _iter202.write(oprot); + _iter206.write(oprot); } oprot.writeListEnd(); } @@ -37955,13 +39214,13 @@ case 3: // NAMES if (field.type == TType.LIST) { { - TList _list203 = iprot.readListBegin(); - this.names = new ArrayList(_list203.size); - for (int _i204 = 0; _i204 < _list203.size; ++_i204) + TList _list207 = iprot.readListBegin(); + this.names = new ArrayList(_list207.size); + for (int _i208 = 0; _i208 < _list207.size; ++_i208) { - String _elem205; - _elem205 = iprot.readString(); - this.names.add(_elem205); + String _elem209; + _elem209 = iprot.readString(); + this.names.add(_elem209); } iprot.readListEnd(); } @@ -37996,9 +39255,9 @@ oprot.writeFieldBegin(NAMES_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.names.size())); - for (String _iter206 : this.names) + for (String _iter210 : this.names) { - oprot.writeString(_iter206); + oprot.writeString(_iter210); } oprot.writeListEnd(); } @@ -38432,14 +39691,14 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list207 = iprot.readListBegin(); - this.success = new ArrayList(_list207.size); - for (int _i208 = 0; _i208 < _list207.size; ++_i208) + TList _list211 = iprot.readListBegin(); + this.success = new ArrayList(_list211.size); + for (int _i212 = 0; _i212 < _list211.size; ++_i212) { - Partition _elem209; - _elem209 = new Partition(); - _elem209.read(iprot); - this.success.add(_elem209); + Partition _elem213; + _elem213 = new Partition(); + _elem213.read(iprot); + this.success.add(_elem213); } iprot.readListEnd(); } @@ -38479,9 +39738,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter210 : this.success) + for (Partition _iter214 : this.success) { - _iter210.write(oprot); + _iter214.write(oprot); } oprot.writeListEnd(); } @@ -40685,13 +41944,13 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list211 = iprot.readListBegin(); - this.success = new ArrayList(_list211.size); - for (int _i212 = 0; _i212 < _list211.size; ++_i212) + TList _list215 = iprot.readListBegin(); + this.success = new ArrayList(_list215.size); + for (int _i216 = 0; _i216 < _list215.size; ++_i216) { - String _elem213; - _elem213 = iprot.readString(); - this.success.add(_elem213); + String _elem217; + _elem217 = iprot.readString(); + this.success.add(_elem217); } iprot.readListEnd(); } @@ -40723,9 +41982,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter214 : this.success) + for (String _iter218 : this.success) { - oprot.writeString(_iter214); + oprot.writeString(_iter218); } oprot.writeListEnd(); } @@ -41370,15 +42629,15 @@ case 0: // SUCCESS if (field.type == TType.MAP) { { - TMap _map215 = iprot.readMapBegin(); - this.success = new HashMap(2*_map215.size); - for (int _i216 = 0; _i216 < _map215.size; ++_i216) + TMap _map219 = iprot.readMapBegin(); + this.success = new HashMap(2*_map219.size); + for (int _i220 = 0; _i220 < _map219.size; ++_i220) { - String _key217; - String _val218; - _key217 = iprot.readString(); - _val218 = iprot.readString(); - this.success.put(_key217, _val218); + String _key221; + String _val222; + _key221 = iprot.readString(); + _val222 = iprot.readString(); + this.success.put(_key221, _val222); } iprot.readMapEnd(); } @@ -41410,10 +42669,10 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.success.size())); - for (Map.Entry _iter219 : this.success.entrySet()) + for (Map.Entry _iter223 : this.success.entrySet()) { - oprot.writeString(_iter219.getKey()); - oprot.writeString(_iter219.getValue()); + oprot.writeString(_iter223.getKey()); + oprot.writeString(_iter223.getValue()); } oprot.writeMapEnd(); } @@ -41942,15 +43201,15 @@ case 3: // PART_VALS if (field.type == TType.MAP) { { - TMap _map220 = iprot.readMapBegin(); - this.part_vals = new HashMap(2*_map220.size); - for (int _i221 = 0; _i221 < _map220.size; ++_i221) + TMap _map224 = iprot.readMapBegin(); + this.part_vals = new HashMap(2*_map224.size); + for (int _i225 = 0; _i225 < _map224.size; ++_i225) { - String _key222; - String _val223; - _key222 = iprot.readString(); - _val223 = iprot.readString(); - this.part_vals.put(_key222, _val223); + String _key226; + String _val227; + _key226 = iprot.readString(); + _val227 = iprot.readString(); + this.part_vals.put(_key226, _val227); } iprot.readMapEnd(); } @@ -41992,10 +43251,10 @@ oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.part_vals.size())); - for (Map.Entry _iter224 : this.part_vals.entrySet()) + for (Map.Entry _iter228 : this.part_vals.entrySet()) { - oprot.writeString(_iter224.getKey()); - oprot.writeString(_iter224.getValue()); + oprot.writeString(_iter228.getKey()); + oprot.writeString(_iter228.getValue()); } oprot.writeMapEnd(); } @@ -43259,15 +44518,15 @@ case 3: // PART_VALS if (field.type == TType.MAP) { { - TMap _map225 = iprot.readMapBegin(); - this.part_vals = new HashMap(2*_map225.size); - for (int _i226 = 0; _i226 < _map225.size; ++_i226) + TMap _map229 = iprot.readMapBegin(); + this.part_vals = new HashMap(2*_map229.size); + for (int _i230 = 0; _i230 < _map229.size; ++_i230) { - String _key227; - String _val228; - _key227 = iprot.readString(); - _val228 = iprot.readString(); - this.part_vals.put(_key227, _val228); + String _key231; + String _val232; + _key231 = iprot.readString(); + _val232 = iprot.readString(); + this.part_vals.put(_key231, _val232); } iprot.readMapEnd(); } @@ -43309,10 +44568,10 @@ oprot.writeFieldBegin(PART_VALS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.part_vals.size())); - for (Map.Entry _iter229 : this.part_vals.entrySet()) + for (Map.Entry _iter233 : this.part_vals.entrySet()) { - oprot.writeString(_iter229.getKey()); - oprot.writeString(_iter229.getValue()); + oprot.writeString(_iter233.getKey()); + oprot.writeString(_iter233.getValue()); } oprot.writeMapEnd(); } @@ -48738,14 +49997,14 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list230 = iprot.readListBegin(); - this.success = new ArrayList(_list230.size); - for (int _i231 = 0; _i231 < _list230.size; ++_i231) + TList _list234 = iprot.readListBegin(); + this.success = new ArrayList(_list234.size); + for (int _i235 = 0; _i235 < _list234.size; ++_i235) { - Index _elem232; - _elem232 = new Index(); - _elem232.read(iprot); - this.success.add(_elem232); + Index _elem236; + _elem236 = new Index(); + _elem236.read(iprot); + this.success.add(_elem236); } iprot.readListEnd(); } @@ -48785,9 +50044,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Index _iter233 : this.success) + for (Index _iter237 : this.success) { - _iter233.write(oprot); + _iter237.write(oprot); } oprot.writeListEnd(); } @@ -49615,13 +50874,13 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list234 = iprot.readListBegin(); - this.success = new ArrayList(_list234.size); - for (int _i235 = 0; _i235 < _list234.size; ++_i235) + TList _list238 = iprot.readListBegin(); + this.success = new ArrayList(_list238.size); + for (int _i239 = 0; _i239 < _list238.size; ++_i239) { - String _elem236; - _elem236 = iprot.readString(); - this.success.add(_elem236); + String _elem240; + _elem240 = iprot.readString(); + this.success.add(_elem240); } iprot.readListEnd(); } @@ -49653,9 +50912,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter237 : this.success) + for (String _iter241 : this.success) { - oprot.writeString(_iter237); + oprot.writeString(_iter241); } oprot.writeListEnd(); } @@ -51488,13 +52747,13 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list238 = iprot.readListBegin(); - this.success = new ArrayList(_list238.size); - for (int _i239 = 0; _i239 < _list238.size; ++_i239) + TList _list242 = iprot.readListBegin(); + this.success = new ArrayList(_list242.size); + for (int _i243 = 0; _i243 < _list242.size; ++_i243) { - String _elem240; - _elem240 = iprot.readString(); - this.success.add(_elem240); + String _elem244; + _elem244 = iprot.readString(); + this.success.add(_elem244); } iprot.readListEnd(); } @@ -51526,9 +52785,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter241 : this.success) + for (String _iter245 : this.success) { - oprot.writeString(_iter241); + oprot.writeString(_iter245); } oprot.writeListEnd(); } @@ -54204,14 +55463,14 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list242 = iprot.readListBegin(); - this.success = new ArrayList(_list242.size); - for (int _i243 = 0; _i243 < _list242.size; ++_i243) + TList _list246 = iprot.readListBegin(); + this.success = new ArrayList(_list246.size); + for (int _i247 = 0; _i247 < _list246.size; ++_i247) { - Role _elem244; - _elem244 = new Role(); - _elem244.read(iprot); - this.success.add(_elem244); + Role _elem248; + _elem248 = new Role(); + _elem248.read(iprot); + this.success.add(_elem248); } iprot.readListEnd(); } @@ -54243,9 +55502,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Role _iter245 : this.success) + for (Role _iter249 : this.success) { - _iter245.write(oprot); + _iter249.write(oprot); } oprot.writeListEnd(); } @@ -54690,13 +55949,13 @@ case 3: // GROUP_NAMES if (field.type == TType.LIST) { { - TList _list246 = iprot.readListBegin(); - this.group_names = new ArrayList(_list246.size); - for (int _i247 = 0; _i247 < _list246.size; ++_i247) + TList _list250 = iprot.readListBegin(); + this.group_names = new ArrayList(_list250.size); + for (int _i251 = 0; _i251 < _list250.size; ++_i251) { - String _elem248; - _elem248 = iprot.readString(); - this.group_names.add(_elem248); + String _elem252; + _elem252 = iprot.readString(); + this.group_names.add(_elem252); } iprot.readListEnd(); } @@ -54731,9 +55990,9 @@ oprot.writeFieldBegin(GROUP_NAMES_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.group_names.size())); - for (String _iter249 : this.group_names) + for (String _iter253 : this.group_names) { - oprot.writeString(_iter249); + oprot.writeString(_iter253); } oprot.writeListEnd(); } @@ -55932,14 +57191,14 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list250 = iprot.readListBegin(); - this.success = new ArrayList(_list250.size); - for (int _i251 = 0; _i251 < _list250.size; ++_i251) + TList _list254 = iprot.readListBegin(); + this.success = new ArrayList(_list254.size); + for (int _i255 = 0; _i255 < _list254.size; ++_i255) { - HiveObjectPrivilege _elem252; - _elem252 = new HiveObjectPrivilege(); - _elem252.read(iprot); - this.success.add(_elem252); + HiveObjectPrivilege _elem256; + _elem256 = new HiveObjectPrivilege(); + _elem256.read(iprot); + this.success.add(_elem256); } iprot.readListEnd(); } @@ -55971,9 +57230,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (HiveObjectPrivilege _iter253 : this.success) + for (HiveObjectPrivilege _iter257 : this.success) { - _iter253.write(oprot); + _iter257.write(oprot); } oprot.writeListEnd(); } Index: metastore/src/gen/thrift/gen-php/hive_metastore/ThriftHiveMetastore.php =================================================================== --- metastore/src/gen/thrift/gen-php/hive_metastore/ThriftHiveMetastore.php (revision 1145366) +++ metastore/src/gen/thrift/gen-php/hive_metastore/ThriftHiveMetastore.php (working copy) @@ -29,6 +29,7 @@ public function get_table($dbname, $tbl_name); public function get_table_objects_by_name($dbname, $tbl_names); public function alter_table($dbname, $tbl_name, $new_tbl); + public function rename_partition($dbname, $name, $part_vals, $new_part); public function add_partition($new_part); public function append_partition($db_name, $tbl_name, $part_vals); public function append_partition_by_name($db_name, $tbl_name, $part_name); @@ -1162,6 +1163,69 @@ return; } + public function rename_partition($dbname, $name, $part_vals, $new_part) + { + $this->send_rename_partition($dbname, $name, $part_vals, $new_part); + $this->recv_rename_partition(); + } + + public function send_rename_partition($dbname, $name, $part_vals, $new_part) + { + $args = new metastore_ThriftHiveMetastore_rename_partition_args(); + $args->dbname = $dbname; + $args->name = $name; + $args->part_vals = $part_vals; + $args->new_part = $new_part; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'rename_partition', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('rename_partition', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_rename_partition() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_rename_partition_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_rename_partition_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + if ($result->o3 !== null) { + throw $result->o3; + } + if ($result->o4 !== null) { + throw $result->o4; + } + return; + } + public function add_partition($new_part) { $this->send_add_partition($new_part); @@ -7569,6 +7633,309 @@ } +class metastore_ThriftHiveMetastore_rename_partition_args { + static $_TSPEC; + + public $dbname = null; + public $name = null; + public $part_vals = null; + public $new_part = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'dbname', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'part_vals', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 4 => array( + 'var' => 'new_part', + 'type' => TType::STRUCT, + 'class' => 'metastore_Partition', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['dbname'])) { + $this->dbname = $vals['dbname']; + } + if (isset($vals['name'])) { + $this->name = $vals['name']; + } + if (isset($vals['part_vals'])) { + $this->part_vals = $vals['part_vals']; + } + if (isset($vals['new_part'])) { + $this->new_part = $vals['new_part']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_rename_partition_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->dbname); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::LST) { + $this->part_vals = array(); + $_size239 = 0; + $_etype242 = 0; + $xfer += $input->readListBegin($_etype242, $_size239); + for ($_i243 = 0; $_i243 < $_size239; ++$_i243) + { + $elem244 = null; + $xfer += $input->readString($elem244); + $this->part_vals []= $elem244; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::STRUCT) { + $this->new_part = new metastore_Partition(); + $xfer += $this->new_part->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_rename_partition_args'); + if ($this->dbname !== null) { + $xfer += $output->writeFieldBegin('dbname', TType::STRING, 1); + $xfer += $output->writeString($this->dbname); + $xfer += $output->writeFieldEnd(); + } + if ($this->name !== null) { + $xfer += $output->writeFieldBegin('name', TType::STRING, 2); + $xfer += $output->writeString($this->name); + $xfer += $output->writeFieldEnd(); + } + if ($this->part_vals !== null) { + if (!is_array($this->part_vals)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('part_vals', TType::LST, 3); + { + $output->writeListBegin(TType::STRING, count($this->part_vals)); + { + foreach ($this->part_vals as $iter245) + { + $xfer += $output->writeString($iter245); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->new_part !== null) { + if (!is_object($this->new_part)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('new_part', TType::STRUCT, 4); + $xfer += $this->new_part->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_rename_partition_result { + static $_TSPEC; + + public $o1 = null; + public $o2 = null; + public $o3 = null; + public $o4 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_InvalidOperationException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_InvalidObjectException', + ), + 3 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, + 'class' => 'metastore_AlreadyExistsException', + ), + 4 => array( + 'var' => 'o4', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } + if (isset($vals['o4'])) { + $this->o4 = $vals['o4']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_rename_partition_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_InvalidOperationException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_InvalidObjectException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_AlreadyExistsException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::STRUCT) { + $this->o4 = new metastore_MetaException(); + $xfer += $this->o4->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_rename_partition_result'); + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o3 !== null) { + $xfer += $output->writeFieldBegin('o3', TType::STRUCT, 3); + $xfer += $this->o3->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o4 !== null) { + $xfer += $output->writeFieldBegin('o4', TType::STRUCT, 4); + $xfer += $this->o4->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + class metastore_ThriftHiveMetastore_add_partition_args { static $_TSPEC; @@ -7866,14 +8233,14 @@ case 3: if ($ftype == TType::LST) { $this->part_vals = array(); - $_size239 = 0; - $_etype242 = 0; - $xfer += $input->readListBegin($_etype242, $_size239); - for ($_i243 = 0; $_i243 < $_size239; ++$_i243) + $_size246 = 0; + $_etype249 = 0; + $xfer += $input->readListBegin($_etype249, $_size246); + for ($_i250 = 0; $_i250 < $_size246; ++$_i250) { - $elem244 = null; - $xfer += $input->readString($elem244); - $this->part_vals []= $elem244; + $elem251 = null; + $xfer += $input->readString($elem251); + $this->part_vals []= $elem251; } $xfer += $input->readListEnd(); } else { @@ -7911,9 +8278,9 @@ { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter245) + foreach ($this->part_vals as $iter252) { - $xfer += $output->writeString($iter245); + $xfer += $output->writeString($iter252); } } $output->writeListEnd(); @@ -8410,14 +8777,14 @@ case 3: if ($ftype == TType::LST) { $this->part_vals = array(); - $_size246 = 0; - $_etype249 = 0; - $xfer += $input->readListBegin($_etype249, $_size246); - for ($_i250 = 0; $_i250 < $_size246; ++$_i250) + $_size253 = 0; + $_etype256 = 0; + $xfer += $input->readListBegin($_etype256, $_size253); + for ($_i257 = 0; $_i257 < $_size253; ++$_i257) { - $elem251 = null; - $xfer += $input->readString($elem251); - $this->part_vals []= $elem251; + $elem258 = null; + $xfer += $input->readString($elem258); + $this->part_vals []= $elem258; } $xfer += $input->readListEnd(); } else { @@ -8462,9 +8829,9 @@ { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter252) + foreach ($this->part_vals as $iter259) { - $xfer += $output->writeString($iter252); + $xfer += $output->writeString($iter259); } } $output->writeListEnd(); @@ -8924,14 +9291,14 @@ case 3: if ($ftype == TType::LST) { $this->part_vals = array(); - $_size253 = 0; - $_etype256 = 0; - $xfer += $input->readListBegin($_etype256, $_size253); - for ($_i257 = 0; $_i257 < $_size253; ++$_i257) + $_size260 = 0; + $_etype263 = 0; + $xfer += $input->readListBegin($_etype263, $_size260); + for ($_i264 = 0; $_i264 < $_size260; ++$_i264) { - $elem258 = null; - $xfer += $input->readString($elem258); - $this->part_vals []= $elem258; + $elem265 = null; + $xfer += $input->readString($elem265); + $this->part_vals []= $elem265; } $xfer += $input->readListEnd(); } else { @@ -8969,9 +9336,9 @@ { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter259) + foreach ($this->part_vals as $iter266) { - $xfer += $output->writeString($iter259); + $xfer += $output->writeString($iter266); } } $output->writeListEnd(); @@ -9203,14 +9570,14 @@ case 3: if ($ftype == TType::LST) { $this->part_vals = array(); - $_size260 = 0; - $_etype263 = 0; - $xfer += $input->readListBegin($_etype263, $_size260); - for ($_i264 = 0; $_i264 < $_size260; ++$_i264) + $_size267 = 0; + $_etype270 = 0; + $xfer += $input->readListBegin($_etype270, $_size267); + for ($_i271 = 0; $_i271 < $_size267; ++$_i271) { - $elem265 = null; - $xfer += $input->readString($elem265); - $this->part_vals []= $elem265; + $elem272 = null; + $xfer += $input->readString($elem272); + $this->part_vals []= $elem272; } $xfer += $input->readListEnd(); } else { @@ -9227,14 +9594,14 @@ case 5: if ($ftype == TType::LST) { $this->group_names = array(); - $_size266 = 0; - $_etype269 = 0; - $xfer += $input->readListBegin($_etype269, $_size266); - for ($_i270 = 0; $_i270 < $_size266; ++$_i270) + $_size273 = 0; + $_etype276 = 0; + $xfer += $input->readListBegin($_etype276, $_size273); + for ($_i277 = 0; $_i277 < $_size273; ++$_i277) { - $elem271 = null; - $xfer += $input->readString($elem271); - $this->group_names []= $elem271; + $elem278 = null; + $xfer += $input->readString($elem278); + $this->group_names []= $elem278; } $xfer += $input->readListEnd(); } else { @@ -9272,9 +9639,9 @@ { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter272) + foreach ($this->part_vals as $iter279) { - $xfer += $output->writeString($iter272); + $xfer += $output->writeString($iter279); } } $output->writeListEnd(); @@ -9294,9 +9661,9 @@ { $output->writeListBegin(TType::STRING, count($this->group_names)); { - foreach ($this->group_names as $iter273) + foreach ($this->group_names as $iter280) { - $xfer += $output->writeString($iter273); + $xfer += $output->writeString($iter280); } } $output->writeListEnd(); @@ -9842,15 +10209,15 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size274 = 0; - $_etype277 = 0; - $xfer += $input->readListBegin($_etype277, $_size274); - for ($_i278 = 0; $_i278 < $_size274; ++$_i278) + $_size281 = 0; + $_etype284 = 0; + $xfer += $input->readListBegin($_etype284, $_size281); + for ($_i285 = 0; $_i285 < $_size281; ++$_i285) { - $elem279 = null; - $elem279 = new metastore_Partition(); - $xfer += $elem279->read($input); - $this->success []= $elem279; + $elem286 = null; + $elem286 = new metastore_Partition(); + $xfer += $elem286->read($input); + $this->success []= $elem286; } $xfer += $input->readListEnd(); } else { @@ -9894,9 +10261,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter280) + foreach ($this->success as $iter287) { - $xfer += $iter280->write($output); + $xfer += $iter287->write($output); } } $output->writeListEnd(); @@ -10027,14 +10394,14 @@ case 5: if ($ftype == TType::LST) { $this->group_names = array(); - $_size281 = 0; - $_etype284 = 0; - $xfer += $input->readListBegin($_etype284, $_size281); - for ($_i285 = 0; $_i285 < $_size281; ++$_i285) + $_size288 = 0; + $_etype291 = 0; + $xfer += $input->readListBegin($_etype291, $_size288); + for ($_i292 = 0; $_i292 < $_size288; ++$_i292) { - $elem286 = null; - $xfer += $input->readString($elem286); - $this->group_names []= $elem286; + $elem293 = null; + $xfer += $input->readString($elem293); + $this->group_names []= $elem293; } $xfer += $input->readListEnd(); } else { @@ -10082,9 +10449,9 @@ { $output->writeListBegin(TType::STRING, count($this->group_names)); { - foreach ($this->group_names as $iter287) + foreach ($this->group_names as $iter294) { - $xfer += $output->writeString($iter287); + $xfer += $output->writeString($iter294); } } $output->writeListEnd(); @@ -10164,15 +10531,15 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size288 = 0; - $_etype291 = 0; - $xfer += $input->readListBegin($_etype291, $_size288); - for ($_i292 = 0; $_i292 < $_size288; ++$_i292) + $_size295 = 0; + $_etype298 = 0; + $xfer += $input->readListBegin($_etype298, $_size295); + for ($_i299 = 0; $_i299 < $_size295; ++$_i299) { - $elem293 = null; - $elem293 = new metastore_Partition(); - $xfer += $elem293->read($input); - $this->success []= $elem293; + $elem300 = null; + $elem300 = new metastore_Partition(); + $xfer += $elem300->read($input); + $this->success []= $elem300; } $xfer += $input->readListEnd(); } else { @@ -10216,9 +10583,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter294) + foreach ($this->success as $iter301) { - $xfer += $iter294->write($output); + $xfer += $iter301->write($output); } } $output->writeListEnd(); @@ -10410,14 +10777,14 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size295 = 0; - $_etype298 = 0; - $xfer += $input->readListBegin($_etype298, $_size295); - for ($_i299 = 0; $_i299 < $_size295; ++$_i299) + $_size302 = 0; + $_etype305 = 0; + $xfer += $input->readListBegin($_etype305, $_size302); + for ($_i306 = 0; $_i306 < $_size302; ++$_i306) { - $elem300 = null; - $xfer += $input->readString($elem300); - $this->success []= $elem300; + $elem307 = null; + $xfer += $input->readString($elem307); + $this->success []= $elem307; } $xfer += $input->readListEnd(); } else { @@ -10453,9 +10820,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter301) + foreach ($this->success as $iter308) { - $xfer += $output->writeString($iter301); + $xfer += $output->writeString($iter308); } } $output->writeListEnd(); @@ -10559,14 +10926,14 @@ case 3: if ($ftype == TType::LST) { $this->part_vals = array(); - $_size302 = 0; - $_etype305 = 0; - $xfer += $input->readListBegin($_etype305, $_size302); - for ($_i306 = 0; $_i306 < $_size302; ++$_i306) + $_size309 = 0; + $_etype312 = 0; + $xfer += $input->readListBegin($_etype312, $_size309); + for ($_i313 = 0; $_i313 < $_size309; ++$_i313) { - $elem307 = null; - $xfer += $input->readString($elem307); - $this->part_vals []= $elem307; + $elem314 = null; + $xfer += $input->readString($elem314); + $this->part_vals []= $elem314; } $xfer += $input->readListEnd(); } else { @@ -10611,9 +10978,9 @@ { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter308) + foreach ($this->part_vals as $iter315) { - $xfer += $output->writeString($iter308); + $xfer += $output->writeString($iter315); } } $output->writeListEnd(); @@ -10689,15 +11056,15 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size309 = 0; - $_etype312 = 0; - $xfer += $input->readListBegin($_etype312, $_size309); - for ($_i313 = 0; $_i313 < $_size309; ++$_i313) + $_size316 = 0; + $_etype319 = 0; + $xfer += $input->readListBegin($_etype319, $_size316); + for ($_i320 = 0; $_i320 < $_size316; ++$_i320) { - $elem314 = null; - $elem314 = new metastore_Partition(); - $xfer += $elem314->read($input); - $this->success []= $elem314; + $elem321 = null; + $elem321 = new metastore_Partition(); + $xfer += $elem321->read($input); + $this->success []= $elem321; } $xfer += $input->readListEnd(); } else { @@ -10733,9 +11100,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter315) + foreach ($this->success as $iter322) { - $xfer += $iter315->write($output); + $xfer += $iter322->write($output); } } $output->writeListEnd(); @@ -10859,14 +11226,14 @@ case 3: if ($ftype == TType::LST) { $this->part_vals = array(); - $_size316 = 0; - $_etype319 = 0; - $xfer += $input->readListBegin($_etype319, $_size316); - for ($_i320 = 0; $_i320 < $_size316; ++$_i320) + $_size323 = 0; + $_etype326 = 0; + $xfer += $input->readListBegin($_etype326, $_size323); + for ($_i327 = 0; $_i327 < $_size323; ++$_i327) { - $elem321 = null; - $xfer += $input->readString($elem321); - $this->part_vals []= $elem321; + $elem328 = null; + $xfer += $input->readString($elem328); + $this->part_vals []= $elem328; } $xfer += $input->readListEnd(); } else { @@ -10890,14 +11257,14 @@ case 6: if ($ftype == TType::LST) { $this->group_names = array(); - $_size322 = 0; - $_etype325 = 0; - $xfer += $input->readListBegin($_etype325, $_size322); - for ($_i326 = 0; $_i326 < $_size322; ++$_i326) + $_size329 = 0; + $_etype332 = 0; + $xfer += $input->readListBegin($_etype332, $_size329); + for ($_i333 = 0; $_i333 < $_size329; ++$_i333) { - $elem327 = null; - $xfer += $input->readString($elem327); - $this->group_names []= $elem327; + $elem334 = null; + $xfer += $input->readString($elem334); + $this->group_names []= $elem334; } $xfer += $input->readListEnd(); } else { @@ -10935,9 +11302,9 @@ { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter328) + foreach ($this->part_vals as $iter335) { - $xfer += $output->writeString($iter328); + $xfer += $output->writeString($iter335); } } $output->writeListEnd(); @@ -10962,9 +11329,9 @@ { $output->writeListBegin(TType::STRING, count($this->group_names)); { - foreach ($this->group_names as $iter329) + foreach ($this->group_names as $iter336) { - $xfer += $output->writeString($iter329); + $xfer += $output->writeString($iter336); } } $output->writeListEnd(); @@ -11044,15 +11411,15 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size330 = 0; - $_etype333 = 0; - $xfer += $input->readListBegin($_etype333, $_size330); - for ($_i334 = 0; $_i334 < $_size330; ++$_i334) + $_size337 = 0; + $_etype340 = 0; + $xfer += $input->readListBegin($_etype340, $_size337); + for ($_i341 = 0; $_i341 < $_size337; ++$_i341) { - $elem335 = null; - $elem335 = new metastore_Partition(); - $xfer += $elem335->read($input); - $this->success []= $elem335; + $elem342 = null; + $elem342 = new metastore_Partition(); + $xfer += $elem342->read($input); + $this->success []= $elem342; } $xfer += $input->readListEnd(); } else { @@ -11096,9 +11463,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter336) + foreach ($this->success as $iter343) { - $xfer += $iter336->write($output); + $xfer += $iter343->write($output); } } $output->writeListEnd(); @@ -11207,14 +11574,14 @@ case 3: if ($ftype == TType::LST) { $this->part_vals = array(); - $_size337 = 0; - $_etype340 = 0; - $xfer += $input->readListBegin($_etype340, $_size337); - for ($_i341 = 0; $_i341 < $_size337; ++$_i341) + $_size344 = 0; + $_etype347 = 0; + $xfer += $input->readListBegin($_etype347, $_size344); + for ($_i348 = 0; $_i348 < $_size344; ++$_i348) { - $elem342 = null; - $xfer += $input->readString($elem342); - $this->part_vals []= $elem342; + $elem349 = null; + $xfer += $input->readString($elem349); + $this->part_vals []= $elem349; } $xfer += $input->readListEnd(); } else { @@ -11259,9 +11626,9 @@ { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter343) + foreach ($this->part_vals as $iter350) { - $xfer += $output->writeString($iter343); + $xfer += $output->writeString($iter350); } } $output->writeListEnd(); @@ -11336,14 +11703,14 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size344 = 0; - $_etype347 = 0; - $xfer += $input->readListBegin($_etype347, $_size344); - for ($_i348 = 0; $_i348 < $_size344; ++$_i348) + $_size351 = 0; + $_etype354 = 0; + $xfer += $input->readListBegin($_etype354, $_size351); + for ($_i355 = 0; $_i355 < $_size351; ++$_i355) { - $elem349 = null; - $xfer += $input->readString($elem349); - $this->success []= $elem349; + $elem356 = null; + $xfer += $input->readString($elem356); + $this->success []= $elem356; } $xfer += $input->readListEnd(); } else { @@ -11379,9 +11746,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter350) + foreach ($this->success as $iter357) { - $xfer += $output->writeString($iter350); + $xfer += $output->writeString($iter357); } } $output->writeListEnd(); @@ -11598,15 +11965,15 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size351 = 0; - $_etype354 = 0; - $xfer += $input->readListBegin($_etype354, $_size351); - for ($_i355 = 0; $_i355 < $_size351; ++$_i355) + $_size358 = 0; + $_etype361 = 0; + $xfer += $input->readListBegin($_etype361, $_size358); + for ($_i362 = 0; $_i362 < $_size358; ++$_i362) { - $elem356 = null; - $elem356 = new metastore_Partition(); - $xfer += $elem356->read($input); - $this->success []= $elem356; + $elem363 = null; + $elem363 = new metastore_Partition(); + $xfer += $elem363->read($input); + $this->success []= $elem363; } $xfer += $input->readListEnd(); } else { @@ -11650,9 +12017,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter357) + foreach ($this->success as $iter364) { - $xfer += $iter357->write($output); + $xfer += $iter364->write($output); } } $output->writeListEnd(); @@ -11753,14 +12120,14 @@ case 3: if ($ftype == TType::LST) { $this->names = array(); - $_size358 = 0; - $_etype361 = 0; - $xfer += $input->readListBegin($_etype361, $_size358); - for ($_i362 = 0; $_i362 < $_size358; ++$_i362) + $_size365 = 0; + $_etype368 = 0; + $xfer += $input->readListBegin($_etype368, $_size365); + for ($_i369 = 0; $_i369 < $_size365; ++$_i369) { - $elem363 = null; - $xfer += $input->readString($elem363); - $this->names []= $elem363; + $elem370 = null; + $xfer += $input->readString($elem370); + $this->names []= $elem370; } $xfer += $input->readListEnd(); } else { @@ -11798,9 +12165,9 @@ { $output->writeListBegin(TType::STRING, count($this->names)); { - foreach ($this->names as $iter364) + foreach ($this->names as $iter371) { - $xfer += $output->writeString($iter364); + $xfer += $output->writeString($iter371); } } $output->writeListEnd(); @@ -11880,15 +12247,15 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size365 = 0; - $_etype368 = 0; - $xfer += $input->readListBegin($_etype368, $_size365); - for ($_i369 = 0; $_i369 < $_size365; ++$_i369) + $_size372 = 0; + $_etype375 = 0; + $xfer += $input->readListBegin($_etype375, $_size372); + for ($_i376 = 0; $_i376 < $_size372; ++$_i376) { - $elem370 = null; - $elem370 = new metastore_Partition(); - $xfer += $elem370->read($input); - $this->success []= $elem370; + $elem377 = null; + $elem377 = new metastore_Partition(); + $xfer += $elem377->read($input); + $this->success []= $elem377; } $xfer += $input->readListEnd(); } else { @@ -11932,9 +12299,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter371) + foreach ($this->success as $iter378) { - $xfer += $iter371->write($output); + $xfer += $iter378->write($output); } } $output->writeListEnd(); @@ -12485,14 +12852,14 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size372 = 0; - $_etype375 = 0; - $xfer += $input->readListBegin($_etype375, $_size372); - for ($_i376 = 0; $_i376 < $_size372; ++$_i376) + $_size379 = 0; + $_etype382 = 0; + $xfer += $input->readListBegin($_etype382, $_size379); + for ($_i383 = 0; $_i383 < $_size379; ++$_i383) { - $elem377 = null; - $xfer += $input->readString($elem377); - $this->success []= $elem377; + $elem384 = null; + $xfer += $input->readString($elem384); + $this->success []= $elem384; } $xfer += $input->readListEnd(); } else { @@ -12528,9 +12895,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter378) + foreach ($this->success as $iter385) { - $xfer += $output->writeString($iter378); + $xfer += $output->writeString($iter385); } } $output->writeListEnd(); @@ -12681,17 +13048,17 @@ case 0: if ($ftype == TType::MAP) { $this->success = array(); - $_size379 = 0; - $_ktype380 = 0; - $_vtype381 = 0; - $xfer += $input->readMapBegin($_ktype380, $_vtype381, $_size379); - for ($_i383 = 0; $_i383 < $_size379; ++$_i383) + $_size386 = 0; + $_ktype387 = 0; + $_vtype388 = 0; + $xfer += $input->readMapBegin($_ktype387, $_vtype388, $_size386); + for ($_i390 = 0; $_i390 < $_size386; ++$_i390) { - $key384 = ''; - $val385 = ''; - $xfer += $input->readString($key384); - $xfer += $input->readString($val385); - $this->success[$key384] = $val385; + $key391 = ''; + $val392 = ''; + $xfer += $input->readString($key391); + $xfer += $input->readString($val392); + $this->success[$key391] = $val392; } $xfer += $input->readMapEnd(); } else { @@ -12727,10 +13094,10 @@ { $output->writeMapBegin(TType::STRING, TType::STRING, count($this->success)); { - foreach ($this->success as $kiter386 => $viter387) + foreach ($this->success as $kiter393 => $viter394) { - $xfer += $output->writeString($kiter386); - $xfer += $output->writeString($viter387); + $xfer += $output->writeString($kiter393); + $xfer += $output->writeString($viter394); } } $output->writeMapEnd(); @@ -12838,17 +13205,17 @@ case 3: if ($ftype == TType::MAP) { $this->part_vals = array(); - $_size388 = 0; - $_ktype389 = 0; - $_vtype390 = 0; - $xfer += $input->readMapBegin($_ktype389, $_vtype390, $_size388); - for ($_i392 = 0; $_i392 < $_size388; ++$_i392) + $_size395 = 0; + $_ktype396 = 0; + $_vtype397 = 0; + $xfer += $input->readMapBegin($_ktype396, $_vtype397, $_size395); + for ($_i399 = 0; $_i399 < $_size395; ++$_i399) { - $key393 = ''; - $val394 = ''; - $xfer += $input->readString($key393); - $xfer += $input->readString($val394); - $this->part_vals[$key393] = $val394; + $key400 = ''; + $val401 = ''; + $xfer += $input->readString($key400); + $xfer += $input->readString($val401); + $this->part_vals[$key400] = $val401; } $xfer += $input->readMapEnd(); } else { @@ -12893,10 +13260,10 @@ { $output->writeMapBegin(TType::STRING, TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $kiter395 => $viter396) + foreach ($this->part_vals as $kiter402 => $viter403) { - $xfer += $output->writeString($kiter395); - $xfer += $output->writeString($viter396); + $xfer += $output->writeString($kiter402); + $xfer += $output->writeString($viter403); } } $output->writeMapEnd(); @@ -13188,17 +13555,17 @@ case 3: if ($ftype == TType::MAP) { $this->part_vals = array(); - $_size397 = 0; - $_ktype398 = 0; - $_vtype399 = 0; - $xfer += $input->readMapBegin($_ktype398, $_vtype399, $_size397); - for ($_i401 = 0; $_i401 < $_size397; ++$_i401) + $_size404 = 0; + $_ktype405 = 0; + $_vtype406 = 0; + $xfer += $input->readMapBegin($_ktype405, $_vtype406, $_size404); + for ($_i408 = 0; $_i408 < $_size404; ++$_i408) { - $key402 = ''; - $val403 = ''; - $xfer += $input->readString($key402); - $xfer += $input->readString($val403); - $this->part_vals[$key402] = $val403; + $key409 = ''; + $val410 = ''; + $xfer += $input->readString($key409); + $xfer += $input->readString($val410); + $this->part_vals[$key409] = $val410; } $xfer += $input->readMapEnd(); } else { @@ -13243,10 +13610,10 @@ { $output->writeMapBegin(TType::STRING, TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $kiter404 => $viter405) + foreach ($this->part_vals as $kiter411 => $viter412) { - $xfer += $output->writeString($kiter404); - $xfer += $output->writeString($viter405); + $xfer += $output->writeString($kiter411); + $xfer += $output->writeString($viter412); } } $output->writeMapEnd(); @@ -14606,15 +14973,15 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size406 = 0; - $_etype409 = 0; - $xfer += $input->readListBegin($_etype409, $_size406); - for ($_i410 = 0; $_i410 < $_size406; ++$_i410) + $_size413 = 0; + $_etype416 = 0; + $xfer += $input->readListBegin($_etype416, $_size413); + for ($_i417 = 0; $_i417 < $_size413; ++$_i417) { - $elem411 = null; - $elem411 = new metastore_Index(); - $xfer += $elem411->read($input); - $this->success []= $elem411; + $elem418 = null; + $elem418 = new metastore_Index(); + $xfer += $elem418->read($input); + $this->success []= $elem418; } $xfer += $input->readListEnd(); } else { @@ -14658,9 +15025,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter412) + foreach ($this->success as $iter419) { - $xfer += $iter412->write($output); + $xfer += $iter419->write($output); } } $output->writeListEnd(); @@ -14852,14 +15219,14 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size413 = 0; - $_etype416 = 0; - $xfer += $input->readListBegin($_etype416, $_size413); - for ($_i417 = 0; $_i417 < $_size413; ++$_i417) + $_size420 = 0; + $_etype423 = 0; + $xfer += $input->readListBegin($_etype423, $_size420); + for ($_i424 = 0; $_i424 < $_size420; ++$_i424) { - $elem418 = null; - $xfer += $input->readString($elem418); - $this->success []= $elem418; + $elem425 = null; + $xfer += $input->readString($elem425); + $this->success []= $elem425; } $xfer += $input->readListEnd(); } else { @@ -14895,9 +15262,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter419) + foreach ($this->success as $iter426) { - $xfer += $output->writeString($iter419); + $xfer += $output->writeString($iter426); } } $output->writeListEnd(); @@ -15359,14 +15726,14 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size420 = 0; - $_etype423 = 0; - $xfer += $input->readListBegin($_etype423, $_size420); - for ($_i424 = 0; $_i424 < $_size420; ++$_i424) + $_size427 = 0; + $_etype430 = 0; + $xfer += $input->readListBegin($_etype430, $_size427); + for ($_i431 = 0; $_i431 < $_size427; ++$_i431) { - $elem425 = null; - $xfer += $input->readString($elem425); - $this->success []= $elem425; + $elem432 = null; + $xfer += $input->readString($elem432); + $this->success []= $elem432; } $xfer += $input->readListEnd(); } else { @@ -15402,9 +15769,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter426) + foreach ($this->success as $iter433) { - $xfer += $output->writeString($iter426); + $xfer += $output->writeString($iter433); } } $output->writeListEnd(); @@ -16044,15 +16411,15 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size427 = 0; - $_etype430 = 0; - $xfer += $input->readListBegin($_etype430, $_size427); - for ($_i431 = 0; $_i431 < $_size427; ++$_i431) + $_size434 = 0; + $_etype437 = 0; + $xfer += $input->readListBegin($_etype437, $_size434); + for ($_i438 = 0; $_i438 < $_size434; ++$_i438) { - $elem432 = null; - $elem432 = new metastore_Role(); - $xfer += $elem432->read($input); - $this->success []= $elem432; + $elem439 = null; + $elem439 = new metastore_Role(); + $xfer += $elem439->read($input); + $this->success []= $elem439; } $xfer += $input->readListEnd(); } else { @@ -16088,9 +16455,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter433) + foreach ($this->success as $iter440) { - $xfer += $iter433->write($output); + $xfer += $iter440->write($output); } } $output->writeListEnd(); @@ -16188,14 +16555,14 @@ case 3: if ($ftype == TType::LST) { $this->group_names = array(); - $_size434 = 0; - $_etype437 = 0; - $xfer += $input->readListBegin($_etype437, $_size434); - for ($_i438 = 0; $_i438 < $_size434; ++$_i438) + $_size441 = 0; + $_etype444 = 0; + $xfer += $input->readListBegin($_etype444, $_size441); + for ($_i445 = 0; $_i445 < $_size441; ++$_i445) { - $elem439 = null; - $xfer += $input->readString($elem439); - $this->group_names []= $elem439; + $elem446 = null; + $xfer += $input->readString($elem446); + $this->group_names []= $elem446; } $xfer += $input->readListEnd(); } else { @@ -16236,9 +16603,9 @@ { $output->writeListBegin(TType::STRING, count($this->group_names)); { - foreach ($this->group_names as $iter440) + foreach ($this->group_names as $iter447) { - $xfer += $output->writeString($iter440); + $xfer += $output->writeString($iter447); } } $output->writeListEnd(); @@ -16525,15 +16892,15 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size441 = 0; - $_etype444 = 0; - $xfer += $input->readListBegin($_etype444, $_size441); - for ($_i445 = 0; $_i445 < $_size441; ++$_i445) + $_size448 = 0; + $_etype451 = 0; + $xfer += $input->readListBegin($_etype451, $_size448); + for ($_i452 = 0; $_i452 < $_size448; ++$_i452) { - $elem446 = null; - $elem446 = new metastore_HiveObjectPrivilege(); - $xfer += $elem446->read($input); - $this->success []= $elem446; + $elem453 = null; + $elem453 = new metastore_HiveObjectPrivilege(); + $xfer += $elem453->read($input); + $this->success []= $elem453; } $xfer += $input->readListEnd(); } else { @@ -16569,9 +16936,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter447) + foreach ($this->success as $iter454) { - $xfer += $iter447->write($output); + $xfer += $iter454->write($output); } } $output->writeListEnd(); Index: metastore/if/hive_metastore.thrift =================================================================== --- metastore/if/hive_metastore.thrift (revision 1145366) +++ metastore/if/hive_metastore.thrift (working copy) @@ -268,6 +268,8 @@ // the following applies to only tables that have partitions // * See notes on DDL_TIME + void rename_partition(1:string dbname, 2:string name, 3:list part_vals, 4:Partition new_part) + throws (1:InvalidOperationException o1, 2:InvalidObjectException o2, 3:AlreadyExistsException o3, 4:MetaException o4) Partition add_partition(1:Partition new_part) throws(1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3) Partition append_partition(1:string db_name, 2:string tbl_name, 3:list part_vals) Index: ql/src/test/results/clientnegative/alter_rename_partition_failure3.q.out =================================================================== --- ql/src/test/results/clientnegative/alter_rename_partition_failure3.q.out (revision 0) +++ ql/src/test/results/clientnegative/alter_rename_partition_failure3.q.out (revision 0) @@ -0,0 +1,31 @@ +PREHOOK: query: create table alter_rename_partition_src ( col1 string ) stored as textfile +PREHOOK: type: CREATETABLE +POSTHOOK: query: create table alter_rename_partition_src ( col1 string ) stored as textfile +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: default@alter_rename_partition_src +PREHOOK: query: load data local inpath '../data/files/test.dat' overwrite into table alter_rename_partition_src +PREHOOK: type: LOAD +PREHOOK: Output: default@alter_rename_partition_src +POSTHOOK: query: load data local inpath '../data/files/test.dat' overwrite into table alter_rename_partition_src +POSTHOOK: type: LOAD +POSTHOOK: Output: default@alter_rename_partition_src +PREHOOK: query: create table alter_rename_partition ( col1 string ) partitioned by (pcol1 string , pcol2 string) stored as sequencefile +PREHOOK: type: CREATETABLE +POSTHOOK: query: create table alter_rename_partition ( col1 string ) partitioned by (pcol1 string , pcol2 string) stored as sequencefile +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: default@alter_rename_partition +PREHOOK: query: insert overwrite table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') select col1 from alter_rename_partition_src +PREHOOK: type: QUERY +PREHOOK: Input: default@alter_rename_partition_src +PREHOOK: Output: default@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: query: insert overwrite table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') select col1 from alter_rename_partition_src +POSTHOOK: type: QUERY +POSTHOOK: Input: default@alter_rename_partition_src +POSTHOOK: Output: default@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: alter table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') rename to partition (pCol1='old_part1:', pcol2='old_part2:', pcol3='old_part3:') +PREHOOK: type: ALTERTABLE_RENAMEPART +PREHOOK: Input: default@alter_rename_partition +PREHOOK: Output: default@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +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/alter_rename_partition_failure2.q.out =================================================================== --- ql/src/test/results/clientnegative/alter_rename_partition_failure2.q.out (revision 0) +++ ql/src/test/results/clientnegative/alter_rename_partition_failure2.q.out (revision 0) @@ -0,0 +1,31 @@ +PREHOOK: query: create table alter_rename_partition_src ( col1 string ) stored as textfile +PREHOOK: type: CREATETABLE +POSTHOOK: query: create table alter_rename_partition_src ( col1 string ) stored as textfile +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: default@alter_rename_partition_src +PREHOOK: query: load data local inpath '../data/files/test.dat' overwrite into table alter_rename_partition_src +PREHOOK: type: LOAD +PREHOOK: Output: default@alter_rename_partition_src +POSTHOOK: query: load data local inpath '../data/files/test.dat' overwrite into table alter_rename_partition_src +POSTHOOK: type: LOAD +POSTHOOK: Output: default@alter_rename_partition_src +PREHOOK: query: create table alter_rename_partition ( col1 string ) partitioned by (pcol1 string , pcol2 string) stored as sequencefile +PREHOOK: type: CREATETABLE +POSTHOOK: query: create table alter_rename_partition ( col1 string ) partitioned by (pcol1 string , pcol2 string) stored as sequencefile +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: default@alter_rename_partition +PREHOOK: query: insert overwrite table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') select col1 from alter_rename_partition_src +PREHOOK: type: QUERY +PREHOOK: Input: default@alter_rename_partition_src +PREHOOK: Output: default@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: query: insert overwrite table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') select col1 from alter_rename_partition_src +POSTHOOK: type: QUERY +POSTHOOK: Input: default@alter_rename_partition_src +POSTHOOK: Output: default@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: alter table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') rename to partition (pCol1='old_part1:', pcol2='old_part2:') +PREHOOK: type: ALTERTABLE_RENAMEPART +PREHOOK: Input: default@alter_rename_partition +PREHOOK: Output: default@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +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/alter_rename_partition_failure.q.out =================================================================== --- ql/src/test/results/clientnegative/alter_rename_partition_failure.q.out (revision 0) +++ ql/src/test/results/clientnegative/alter_rename_partition_failure.q.out (revision 0) @@ -0,0 +1,30 @@ +PREHOOK: query: create table alter_rename_partition_src ( col1 string ) stored as textfile +PREHOOK: type: CREATETABLE +POSTHOOK: query: create table alter_rename_partition_src ( col1 string ) stored as textfile +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: default@alter_rename_partition_src +PREHOOK: query: load data local inpath '../data/files/test.dat' overwrite into table alter_rename_partition_src +PREHOOK: type: LOAD +PREHOOK: Output: default@alter_rename_partition_src +POSTHOOK: query: load data local inpath '../data/files/test.dat' overwrite into table alter_rename_partition_src +POSTHOOK: type: LOAD +POSTHOOK: Output: default@alter_rename_partition_src +PREHOOK: query: create table alter_rename_partition ( col1 string ) partitioned by (pcol1 string , pcol2 string) stored as sequencefile +PREHOOK: type: CREATETABLE +POSTHOOK: query: create table alter_rename_partition ( col1 string ) partitioned by (pcol1 string , pcol2 string) stored as sequencefile +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: default@alter_rename_partition +PREHOOK: query: insert overwrite table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') select col1 from alter_rename_partition_src +PREHOOK: type: QUERY +PREHOOK: Input: default@alter_rename_partition_src +PREHOOK: Output: default@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: query: insert overwrite table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') select col1 from alter_rename_partition_src +POSTHOOK: type: QUERY +POSTHOOK: Input: default@alter_rename_partition_src +POSTHOOK: Output: default@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: alter table alter_rename_partition partition (pCol1='nonexist_part1:', pcol2='nonexist_part2:') rename to partition (pCol1='new_part1:', pcol2='new_part2:') +PREHOOK: type: ALTERTABLE_RENAMEPART +PREHOOK: Input: default@alter_rename_partition +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/clientpositive/alter_rename_partition.q.out =================================================================== --- ql/src/test/results/clientpositive/alter_rename_partition.q.out (revision 0) +++ ql/src/test/results/clientpositive/alter_rename_partition.q.out (revision 0) @@ -0,0 +1,217 @@ +PREHOOK: query: create table alter_rename_partition_src ( col1 string ) stored as textfile +PREHOOK: type: CREATETABLE +POSTHOOK: query: create table alter_rename_partition_src ( col1 string ) stored as textfile +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: default@alter_rename_partition_src +PREHOOK: query: load data local inpath '../data/files/test.dat' overwrite into table alter_rename_partition_src +PREHOOK: type: LOAD +PREHOOK: Output: default@alter_rename_partition_src +POSTHOOK: query: load data local inpath '../data/files/test.dat' overwrite into table alter_rename_partition_src +POSTHOOK: type: LOAD +POSTHOOK: Output: default@alter_rename_partition_src +PREHOOK: query: create table alter_rename_partition ( col1 string ) partitioned by (pcol1 string , pcol2 string) stored as sequencefile +PREHOOK: type: CREATETABLE +POSTHOOK: query: create table alter_rename_partition ( col1 string ) partitioned by (pcol1 string , pcol2 string) stored as sequencefile +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: default@alter_rename_partition +PREHOOK: query: insert overwrite table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') select col1 from alter_rename_partition_src +PREHOOK: type: QUERY +PREHOOK: Input: default@alter_rename_partition_src +PREHOOK: Output: default@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: query: insert overwrite table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') select col1 from alter_rename_partition_src +POSTHOOK: type: QUERY +POSTHOOK: Input: default@alter_rename_partition_src +POSTHOOK: Output: default@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: select * from alter_rename_partition where pcol1='old_part1:' and pcol2='old_part2:' +PREHOOK: type: QUERY +PREHOOK: Input: default@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +PREHOOK: Output: file:/tmp/weiyan/hive_2011-07-13_02-37-46_967_8628605602883556690/-mr-10000 +POSTHOOK: query: select * from alter_rename_partition where pcol1='old_part1:' and pcol2='old_part2:' +POSTHOOK: type: QUERY +POSTHOOK: Input: default@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: Output: file:/tmp/weiyan/hive_2011-07-13_02-37-46_967_8628605602883556690/-mr-10000 +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +1 old_part1: old_part2: +2 old_part1: old_part2: +3 old_part1: old_part2: +4 old_part1: old_part2: +5 old_part1: old_part2: +6 old_part1: old_part2: +PREHOOK: query: alter table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') rename to partition (pCol1='new_part1:', pcol2='new_part2:') +PREHOOK: type: ALTERTABLE_RENAMEPART +PREHOOK: Input: default@alter_rename_partition +PREHOOK: Output: default@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: query: alter table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') rename to partition (pCol1='new_part1:', pcol2='new_part2:') +POSTHOOK: type: ALTERTABLE_RENAMEPART +POSTHOOK: Input: default@alter_rename_partition +POSTHOOK: Output: default@alter_rename_partition@pcol1=new_part1%3A/pcol2=new_part2%3A +POSTHOOK: Output: default@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: SHOW PARTITIONS alter_rename_partition +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: SHOW PARTITIONS alter_rename_partition +POSTHOOK: type: SHOWPARTITIONS +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +pcol1=new_part1%3A/pcol2=new_part2%3A +PREHOOK: query: select * from alter_rename_partition where pcol1='old_part1:' and pcol2='old_part2:' +PREHOOK: type: QUERY +PREHOOK: Output: file:/tmp/weiyan/hive_2011-07-13_02-37-47_748_3041844871355302904/-mr-10000 +POSTHOOK: query: select * from alter_rename_partition where pcol1='old_part1:' and pcol2='old_part2:' +POSTHOOK: type: QUERY +POSTHOOK: Output: file:/tmp/weiyan/hive_2011-07-13_02-37-47_748_3041844871355302904/-mr-10000 +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: select * from alter_rename_partition where pcol1='new_part1:' and pcol2='new_part2:' +PREHOOK: type: QUERY +PREHOOK: Input: default@alter_rename_partition@pcol1=new_part1%3A/pcol2=new_part2%3A +PREHOOK: Output: file:/tmp/weiyan/hive_2011-07-13_02-37-47_802_4517474240335093117/-mr-10000 +POSTHOOK: query: select * from alter_rename_partition where pcol1='new_part1:' and pcol2='new_part2:' +POSTHOOK: type: QUERY +POSTHOOK: Input: default@alter_rename_partition@pcol1=new_part1%3A/pcol2=new_part2%3A +POSTHOOK: Output: file:/tmp/weiyan/hive_2011-07-13_02-37-47_802_4517474240335093117/-mr-10000 +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +1 new_part1: new_part2: +2 new_part1: new_part2: +3 new_part1: new_part2: +4 new_part1: new_part2: +5 new_part1: new_part2: +6 new_part1: new_part2: +PREHOOK: query: -- Cleanup +DROP TABLE alter_rename_partition_src +PREHOOK: type: DROPTABLE +PREHOOK: Input: default@alter_rename_partition_src +PREHOOK: Output: default@alter_rename_partition_src +POSTHOOK: query: -- Cleanup +DROP TABLE alter_rename_partition_src +POSTHOOK: type: DROPTABLE +POSTHOOK: Input: default@alter_rename_partition_src +POSTHOOK: Output: default@alter_rename_partition_src +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: DROP TABLE alter_rename_partition +PREHOOK: type: DROPTABLE +PREHOOK: Input: default@alter_rename_partition +PREHOOK: Output: default@alter_rename_partition +POSTHOOK: query: DROP TABLE alter_rename_partition +POSTHOOK: type: DROPTABLE +POSTHOOK: Input: default@alter_rename_partition +POSTHOOK: Output: default@alter_rename_partition +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +src +src1 +src_json +src_sequencefile +src_thrift +srcbucket +srcbucket2 +srcpart +PREHOOK: query: -- With non-default Database + +CREATE DATABASE alter_rename_partition_db +PREHOOK: type: CREATEDATABASE +POSTHOOK: query: -- With non-default Database + +CREATE DATABASE alter_rename_partition_db +POSTHOOK: type: CREATEDATABASE +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: USE alter_rename_partition_db +PREHOOK: type: SWITCHDATABASE +POSTHOOK: query: USE alter_rename_partition_db +POSTHOOK: type: SWITCHDATABASE +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: SHOW TABLES +PREHOOK: type: SHOWTABLES +POSTHOOK: query: SHOW TABLES +POSTHOOK: type: SHOWTABLES +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: CREATE TABLE alter_rename_partition_src (col1 STRING) STORED AS TEXTFILE +PREHOOK: type: CREATETABLE +POSTHOOK: query: CREATE TABLE alter_rename_partition_src (col1 STRING) STORED AS TEXTFILE +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: alter_rename_partition_db@alter_rename_partition_src +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: LOAD DATA LOCAL INPATH '../data/files/test.dat' OVERWRITE INTO TABLE alter_rename_partition_src +PREHOOK: type: LOAD +PREHOOK: Output: alter_rename_partition_db@alter_rename_partition_src +POSTHOOK: query: LOAD DATA LOCAL INPATH '../data/files/test.dat' OVERWRITE INTO TABLE alter_rename_partition_src +POSTHOOK: type: LOAD +POSTHOOK: Output: alter_rename_partition_db@alter_rename_partition_src +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: CREATE TABLE alter_rename_partition (col1 STRING) PARTITIONED BY (pcol1 STRING, pcol2 STRING) STORED AS SEQUENCEFILE +PREHOOK: type: CREATETABLE +POSTHOOK: query: CREATE TABLE alter_rename_partition (col1 STRING) PARTITIONED BY (pcol1 STRING, pcol2 STRING) STORED AS SEQUENCEFILE +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: alter_rename_partition_db@alter_rename_partition +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: INSERT OVERWRITE TABLE alter_rename_partition PARTITION (pCol1='old_part1:', pcol2='old_part2:') SELECT col1 FROM alter_rename_partition_src +PREHOOK: type: QUERY +PREHOOK: Input: alter_rename_partition_db@alter_rename_partition_src +PREHOOK: Output: alter_rename_partition_db@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: query: INSERT OVERWRITE TABLE alter_rename_partition PARTITION (pCol1='old_part1:', pcol2='old_part2:') SELECT col1 FROM alter_rename_partition_src +POSTHOOK: type: QUERY +POSTHOOK: Input: alter_rename_partition_db@alter_rename_partition_src +POSTHOOK: Output: alter_rename_partition_db@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: SELECT * FROM alter_rename_partition WHERE pcol1='old_part1:' AND pcol2='old_part2:' +PREHOOK: type: QUERY +PREHOOK: Input: alter_rename_partition_db@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +PREHOOK: Output: file:/tmp/weiyan/hive_2011-07-13_02-37-54_206_7241150207957282987/-mr-10000 +POSTHOOK: query: SELECT * FROM alter_rename_partition WHERE pcol1='old_part1:' AND pcol2='old_part2:' +POSTHOOK: type: QUERY +POSTHOOK: Input: alter_rename_partition_db@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: Output: file:/tmp/weiyan/hive_2011-07-13_02-37-54_206_7241150207957282987/-mr-10000 +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +1 old_part1: old_part2: +2 old_part1: old_part2: +3 old_part1: old_part2: +4 old_part1: old_part2: +5 old_part1: old_part2: +6 old_part1: old_part2: +PREHOOK: query: ALTER TABLE alter_rename_partition PARTITION (pCol1='old_part1:', pcol2='old_part2:') RENAME TO PARTITION (pCol1='new_part1:', pcol2='new_part2:') +PREHOOK: type: ALTERTABLE_RENAMEPART +PREHOOK: Input: alter_rename_partition_db@alter_rename_partition +PREHOOK: Output: alter_rename_partition_db@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: query: ALTER TABLE alter_rename_partition PARTITION (pCol1='old_part1:', pcol2='old_part2:') RENAME TO PARTITION (pCol1='new_part1:', pcol2='new_part2:') +POSTHOOK: type: ALTERTABLE_RENAMEPART +POSTHOOK: Input: alter_rename_partition_db@alter_rename_partition +POSTHOOK: Output: alter_rename_partition_db@alter_rename_partition@pcol1=new_part1%3A/pcol2=new_part2%3A +POSTHOOK: Output: alter_rename_partition_db@alter_rename_partition@pcol1=old_part1%3A/pcol2=old_part2%3A +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: SHOW PARTITIONS alter_rename_partition +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: SHOW PARTITIONS alter_rename_partition +POSTHOOK: type: SHOWPARTITIONS +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +pcol1=new_part1%3A/pcol2=new_part2%3A +PREHOOK: query: SELECT * FROM alter_rename_partition WHERE pcol1='old_part1:' and pcol2='old_part2:' +PREHOOK: type: QUERY +PREHOOK: Output: file:/tmp/weiyan/hive_2011-07-13_02-37-54_830_2911902738018739732/-mr-10000 +POSTHOOK: query: SELECT * FROM alter_rename_partition WHERE pcol1='old_part1:' and pcol2='old_part2:' +POSTHOOK: type: QUERY +POSTHOOK: Output: file:/tmp/weiyan/hive_2011-07-13_02-37-54_830_2911902738018739732/-mr-10000 +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +PREHOOK: query: SELECT * FROM alter_rename_partition WHERE pcol1='new_part1:' and pcol2='new_part2:' +PREHOOK: type: QUERY +PREHOOK: Input: alter_rename_partition_db@alter_rename_partition@pcol1=new_part1%3A/pcol2=new_part2%3A +PREHOOK: Output: file:/tmp/weiyan/hive_2011-07-13_02-37-54_879_7890476328744196425/-mr-10000 +POSTHOOK: query: SELECT * FROM alter_rename_partition WHERE pcol1='new_part1:' and pcol2='new_part2:' +POSTHOOK: type: QUERY +POSTHOOK: Input: alter_rename_partition_db@alter_rename_partition@pcol1=new_part1%3A/pcol2=new_part2%3A +POSTHOOK: Output: file:/tmp/weiyan/hive_2011-07-13_02-37-54_879_7890476328744196425/-mr-10000 +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +POSTHOOK: Lineage: alter_rename_partition PARTITION(pcol1=old_part1:,pcol2=old_part2:).col1 SIMPLE [(alter_rename_partition_src)alter_rename_partition_src.FieldSchema(name:col1, type:string, comment:null), ] +1 new_part1: new_part2: +2 new_part1: new_part2: +3 new_part1: new_part2: +4 new_part1: new_part2: +5 new_part1: new_part2: +6 new_part1: new_part2: Index: ql/src/test/queries/clientnegative/alter_rename_partition_failure2.q =================================================================== --- ql/src/test/queries/clientnegative/alter_rename_partition_failure2.q (revision 0) +++ ql/src/test/queries/clientnegative/alter_rename_partition_failure2.q (revision 0) @@ -0,0 +1,6 @@ +create table alter_rename_partition_src ( col1 string ) stored as textfile ; +load data local inpath '../data/files/test.dat' overwrite into table alter_rename_partition_src ; +create table alter_rename_partition ( col1 string ) partitioned by (pcol1 string , pcol2 string) stored as sequencefile; +insert overwrite table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') select col1 from alter_rename_partition_src ; + +alter table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') rename to partition (pCol1='old_part1:', pcol2='old_part2:'); Index: ql/src/test/queries/clientnegative/alter_rename_partition_failure3.q =================================================================== --- ql/src/test/queries/clientnegative/alter_rename_partition_failure3.q (revision 0) +++ ql/src/test/queries/clientnegative/alter_rename_partition_failure3.q (revision 0) @@ -0,0 +1,6 @@ +create table alter_rename_partition_src ( col1 string ) stored as textfile ; +load data local inpath '../data/files/test.dat' overwrite into table alter_rename_partition_src ; +create table alter_rename_partition ( col1 string ) partitioned by (pcol1 string , pcol2 string) stored as sequencefile; +insert overwrite table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') select col1 from alter_rename_partition_src ; + +alter table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') rename to partition (pCol1='old_part1:', pcol2='old_part2:', pcol3='old_part3:'); \ No newline at end of file Index: ql/src/test/queries/clientnegative/alter_rename_partition_failure.q =================================================================== --- ql/src/test/queries/clientnegative/alter_rename_partition_failure.q (revision 0) +++ ql/src/test/queries/clientnegative/alter_rename_partition_failure.q (revision 0) @@ -0,0 +1,6 @@ +create table alter_rename_partition_src ( col1 string ) stored as textfile ; +load data local inpath '../data/files/test.dat' overwrite into table alter_rename_partition_src ; +create table alter_rename_partition ( col1 string ) partitioned by (pcol1 string , pcol2 string) stored as sequencefile; +insert overwrite table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') select col1 from alter_rename_partition_src ; + +alter table alter_rename_partition partition (pCol1='nonexist_part1:', pcol2='nonexist_part2:') rename to partition (pCol1='new_part1:', pcol2='new_part2:'); Index: ql/src/test/queries/clientpositive/alter_rename_partition.q =================================================================== --- ql/src/test/queries/clientpositive/alter_rename_partition.q (revision 0) +++ ql/src/test/queries/clientpositive/alter_rename_partition.q (revision 0) @@ -0,0 +1,36 @@ +create table alter_rename_partition_src ( col1 string ) stored as textfile ; +load data local inpath '../data/files/test.dat' overwrite into table alter_rename_partition_src ; + +create table alter_rename_partition ( col1 string ) partitioned by (pcol1 string , pcol2 string) stored as sequencefile; + +insert overwrite table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') select col1 from alter_rename_partition_src ; +select * from alter_rename_partition where pcol1='old_part1:' and pcol2='old_part2:'; + +alter table alter_rename_partition partition (pCol1='old_part1:', pcol2='old_part2:') rename to partition (pCol1='new_part1:', pcol2='new_part2:'); +SHOW PARTITIONS alter_rename_partition; +select * from alter_rename_partition where pcol1='old_part1:' and pcol2='old_part2:'; +select * from alter_rename_partition where pcol1='new_part1:' and pcol2='new_part2:'; + +-- Cleanup +DROP TABLE alter_rename_partition_src; +DROP TABLE alter_rename_partition; +SHOW TABLES; + +-- With non-default Database + +CREATE DATABASE alter_rename_partition_db; +USE alter_rename_partition_db; +SHOW TABLES; + +CREATE TABLE alter_rename_partition_src (col1 STRING) STORED AS TEXTFILE ; +LOAD DATA LOCAL INPATH '../data/files/test.dat' OVERWRITE INTO TABLE alter_rename_partition_src ; + +CREATE TABLE alter_rename_partition (col1 STRING) PARTITIONED BY (pcol1 STRING, pcol2 STRING) STORED AS SEQUENCEFILE; + +INSERT OVERWRITE TABLE alter_rename_partition PARTITION (pCol1='old_part1:', pcol2='old_part2:') SELECT col1 FROM alter_rename_partition_src ; +SELECT * FROM alter_rename_partition WHERE pcol1='old_part1:' AND pcol2='old_part2:'; + +ALTER TABLE alter_rename_partition PARTITION (pCol1='old_part1:', pcol2='old_part2:') RENAME TO PARTITION (pCol1='new_part1:', pcol2='new_part2:'); +SHOW PARTITIONS alter_rename_partition; +SELECT * FROM alter_rename_partition WHERE pcol1='old_part1:' and pcol2='old_part2:'; +SELECT * FROM alter_rename_partition WHERE pcol1='new_part1:' and pcol2='new_part2:'; Index: ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java (revision 1145366) +++ ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java (working copy) @@ -61,6 +61,7 @@ import org.apache.hadoop.hive.metastore.api.HiveObjectRef; import org.apache.hadoop.hive.metastore.api.HiveObjectType; import org.apache.hadoop.hive.metastore.api.Index; +import org.apache.hadoop.hive.metastore.api.InvalidObjectException; import org.apache.hadoop.hive.metastore.api.InvalidOperationException; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; @@ -425,6 +426,62 @@ } } + /** + * Rename a old partition to new partition + * + * @param tbl + * existing table + * @param oldPartSpec + * spec of old partition + * @param newPart + * new partition + * @throws InvalidOperationException + * if the changes in metadata is not acceptable + * @throws TException + */ + public void renamePartition(Table tbl, Map oldPartSpec, Partition newPart) + throws HiveException { + try { + // Remove the DDL time so that it gets refreshed + if (newPart.getParameters() != null) { + newPart.getParameters().remove(Constants.DDL_TIME); + } + Map newPartSpec = newPart.getSpec(); + if (oldPartSpec.keySet().size() != tbl.getPartCols().size() + || newPartSpec.keySet().size() != tbl.getPartCols().size()) { + throw new HiveException("Unable to rename partition"); + } + if (!oldPartSpec.keySet().equals(newPartSpec.keySet())){ + throw new HiveException("Unable to rename partition"); + } + List pvals = new ArrayList(); + for (FieldSchema field : tbl.getPartCols()) { + String val = oldPartSpec.get(field.getName()); + // enable dynamic partitioning + if (val == null && !HiveConf.getBoolVar(conf, HiveConf.ConfVars.DYNAMICPARTITIONING) + || val.length() == 0) { + throw new HiveException("get partition: Value for key " + + field.getName() + " is null or empty"); + } else if (val != null){ + pvals.add(val); + } + } + getMSC().renamePartition(tbl.getDbName(), tbl.getTableName(), pvals, + newPart.getTPartition()); + + } catch (InvalidOperationException e){ + throw new HiveException("Unable to rename partition.", e); + } catch (InvalidObjectException e) { + throw new HiveException("Unable to rename partition.", e); + } catch (AlreadyExistsException e) { + throw new HiveException("Unable to rename partition.", e); + } catch (MetaException e) { + throw new HiveException("Unable to rename partition.", e); + } catch (TException e) { + throw new HiveException("Unable to rename partition.", e); + } + } + public void alterDatabase(String dbName, Database db) throws HiveException { try { Index: ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java (revision 1145366) +++ ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java (working copy) @@ -118,6 +118,7 @@ import org.apache.hadoop.hive.ql.plan.PrincipalDesc; import org.apache.hadoop.hive.ql.plan.PrivilegeDesc; import org.apache.hadoop.hive.ql.plan.PrivilegeObjectDesc; +import org.apache.hadoop.hive.ql.plan.RenamePartitionDesc; import org.apache.hadoop.hive.ql.plan.RevokeDesc; import org.apache.hadoop.hive.ql.plan.RoleDDLDesc; import org.apache.hadoop.hive.ql.plan.ShowDatabasesDesc; @@ -262,6 +263,11 @@ return addPartition(db, addPartitionDesc); } + RenamePartitionDesc renamePartitionDesc = work.getRenamePartitionDesc(); + if (renamePartitionDesc != null) { + return renamePartition(db, renamePartitionDesc); + } + AlterTableSimpleDesc simpleDesc = work.getAlterTblSimpleDesc(); if (simpleDesc != null) { if (simpleDesc.getType() == AlterTableTypes.TOUCH) { @@ -919,6 +925,33 @@ } /** + * Rename a partition in a table + * + * @param db + * Database to rename the partition. + * @param renamePartitionDesc + * rename old Partition to new one. + * @return Returns 0 when execution succeeds and above 0 if it fails. + * @throws HiveException + */ + private int renamePartition(Hive db, RenamePartitionDesc renamePartitionDesc) throws HiveException { + + Table tbl = db.getTable(renamePartitionDesc.getDbName(), renamePartitionDesc.getTableName()); + + validateAlterTableType( + tbl, AlterTableDesc.AlterTableTypes.RENAMEPARTITION, + false); + + Partition newPart = new Partition(tbl, renamePartitionDesc.getNewPartSpec(), null); + db.renamePartition(tbl, renamePartitionDesc.getOldPartSpec(), newPart); + + Partition part = db + .getPartition(tbl, renamePartitionDesc.getNewPartSpec(), false); + work.getOutputs().add(new WriteEntity(part)); + return 0; + } + + /** * Rewrite the partition's metadata and force the pre/post execute hooks to * be fired. * @@ -1457,6 +1490,7 @@ switch (alterType) { case ADDPARTITION: case DROPPARTITION: + case RENAMEPARTITION: case ADDPROPS: case RENAME: // allow this form Index: ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java (revision 1145366) +++ ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java (working copy) @@ -53,6 +53,7 @@ private ShowPartitionsDesc showPartsDesc; private DescTableDesc descTblDesc; private AddPartitionDesc addPartitionDesc; + private RenamePartitionDesc renamePartitionDesc; private AlterTableSimpleDesc alterTblSimpleDesc; private MsckDesc msckDesc; private ShowTableStatusDesc showTblStatusDesc; @@ -67,7 +68,7 @@ private GrantRevokeRoleDDL grantRevokeRoleDDL; boolean needLock = false; - + /** * ReadEntitites that are passed to the hooks. */ @@ -310,6 +311,17 @@ } /** + * @param renamePartitionDesc + * information about the partitions we want to add. + */ + public DDLWork(HashSet inputs, HashSet outputs, + RenamePartitionDesc renamePartitionDesc) { + this(inputs, outputs); + + this.renamePartitionDesc = renamePartitionDesc; + } + + /** * @param touchDesc * information about the table/partitions that we want to touch */ @@ -713,6 +725,21 @@ } /** + * @return information about the partitions we want to rename. + */ + public RenamePartitionDesc getRenamePartitionDesc() { + return renamePartitionDesc; + } + + /** + * @param renamePartitionDesc + * information about the partitions we want to rename. + */ + public void setRenamePartitionDesc(RenamePartitionDesc renamePartitionDesc) { + this.renamePartitionDesc = renamePartitionDesc; + } + + /** * @return information about the table/partitions we want to alter. */ public AlterTableSimpleDesc getAlterTblSimpleDesc() { @@ -806,7 +833,7 @@ public void setRoleDDLDesc(RoleDDLDesc roleDDLDesc) { this.roleDDLDesc = roleDDLDesc; } - + /** * @return grant desc */ @@ -820,7 +847,7 @@ public void setGrantDesc(GrantDesc grantDesc) { this.grantDesc = grantDesc; } - + /** * @return show grant desc */ @@ -842,7 +869,7 @@ public void setRevokeDesc(RevokeDesc revokeDesc) { this.revokeDesc = revokeDesc; } - + /** * @return */ @@ -856,7 +883,7 @@ public void setGrantRevokeRoleDDL(GrantRevokeRoleDDL grantRevokeRoleDDL) { this.grantRevokeRoleDDL = grantRevokeRoleDDL; } - + public void setAlterDatabaseDesc(AlterDatabaseDesc alterDbDesc) { this.alterDbDesc = alterDbDesc; } @@ -864,7 +891,7 @@ public AlterDatabaseDesc getAlterDatabaseDesc() { return this.alterDbDesc; } - + /** * @return descriptor for merging files */ Index: ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java (revision 1145366) +++ ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java (working copy) @@ -21,7 +21,7 @@ import org.apache.hadoop.hive.ql.security.authorization.Privilege; public enum HiveOperation { - + EXPLAIN("EXPLAIN", null, null), LOAD("LOAD", null, new Privilege[]{Privilege.ALTER_DATA}), EXPORT("EXPORT", new Privilege[]{Privilege.SELECT}, null), @@ -36,6 +36,7 @@ ALTERTABLE_ADDCOLS("ALTERTABLE_ADDCOLS", new Privilege[]{Privilege.ALTER_METADATA}, null), ALTERTABLE_REPLACECOLS("ALTERTABLE_REPLACECOLS", new Privilege[]{Privilege.ALTER_METADATA}, null), ALTERTABLE_RENAMECOL("ALTERTABLE_RENAMECOL", new Privilege[]{Privilege.ALTER_METADATA}, null), + ALTERTABLE_RENAMEPART("ALTERTABLE_RENAMEPART", new Privilege[]{Privilege.ALTER_METADATA}, null), ALTERTABLE_RENAME("ALTERTABLE_RENAME", new Privilege[]{Privilege.ALTER_METADATA}, null), ALTERTABLE_DROPPARTS("ALTERTABLE_DROPPARTS", new Privilege[]{Privilege.DROP}, null), ALTERTABLE_ADDPARTS("ALTERTABLE_ADDPARTS", new Privilege[]{Privilege.CREATE}, null), @@ -79,20 +80,20 @@ ALTERPARTITION_LOCATION("ALTERPARTITION_LOCATION", new Privilege[]{Privilege.ALTER_DATA}, null), CREATETABLE("CREATETABLE", null, new Privilege[]{Privilege.CREATE}), CREATETABLE_AS_SELECT("CREATETABLE_AS_SELECT", new Privilege[]{Privilege.SELECT}, new Privilege[]{Privilege.CREATE}), - QUERY("QUERY", new Privilege[]{Privilege.SELECT}, new Privilege[]{Privilege.ALTER_DATA, Privilege.CREATE}), - ALTERINDEX_PROPS("ALTERINDEX_PROPS",null, null), - ALTERDATABASE("ALTERDATABASE", null, null), - DESCDATABASE("DESCDATABASE", null, null), + QUERY("QUERY", new Privilege[]{Privilege.SELECT}, new Privilege[]{Privilege.ALTER_DATA, Privilege.CREATE}), + ALTERINDEX_PROPS("ALTERINDEX_PROPS",null, null), + ALTERDATABASE("ALTERDATABASE", null, null), + DESCDATABASE("DESCDATABASE", null, null), ALTERTABLE_MERGEFILES("ALTER_TABLE_MERGE", new Privilege[] { Privilege.SELECT }, new Privilege[] { Privilege.ALTER_DATA }), ALTERPARTITION_MERGEFILES("ALTER_PARTITION_MERGE", new Privilege[] { Privilege.SELECT }, new Privilege[] { Privilege.ALTER_DATA }), ; private String operationName; - + private Privilege[] inputRequiredPrivileges; - + private Privilege[] outputRequiredPrivileges; - + public Privilege[] getInputRequiredPrivileges() { return inputRequiredPrivileges; } @@ -111,9 +112,9 @@ this.inputRequiredPrivileges = inputRequiredPrivileges; this.outputRequiredPrivileges = outputRequiredPrivileges; } - + public static class PrivilegeAgreement { - + private Privilege[] inputUserLevelRequiredPriv; private Privilege[] inputDBLevelRequiredPriv; private Privilege[] inputTableLevelRequiredPriv; @@ -122,7 +123,7 @@ private Privilege[] outputDBLevelRequiredPriv; private Privilege[] outputTableLevelRequiredPriv; private Privilege[] outputColumnLevelRequiredPriv; - + public PrivilegeAgreement putUserLevelRequiredPriv( Privilege[] inputUserLevelRequiredPriv, Privilege[] outputUserLevelRequiredPriv) { @@ -138,7 +139,7 @@ this.outputDBLevelRequiredPriv = outputDBLevelRequiredPriv; return this; } - + public PrivilegeAgreement putTableLevelRequiredPriv( Privilege[] inputTableLevelRequiredPriv, Privilege[] outputTableLevelRequiredPriv) { Index: ql/src/java/org/apache/hadoop/hive/ql/plan/RenamePartitionDesc.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/plan/RenamePartitionDesc.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/plan/RenamePartitionDesc.java (revision 0) @@ -0,0 +1,261 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hive.ql.plan; + +import java.io.Serializable; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.apache.hadoop.hive.metastore.api.FieldSchema; +import org.apache.hadoop.hive.metastore.api.Order; + +/** + * Contains the information needed to add a partition. + */ +public class RenamePartitionDesc extends DDLDesc implements Serializable { + + private static final long serialVersionUID = 1L; + + String tableName; + String dbName; + String location; + boolean ifNotExists; + boolean expectView; + LinkedHashMap oldPartSpec; + LinkedHashMap newPartSpec; + Map partParams; + String inputFormat = null; + String outputFormat = null; + int numBuckets = -1; + List cols = null; + String serializationLib = null; + Map serdeParams = null; + List bucketCols = null; + List sortCols = null; + + /** + * For serialization only. + */ + public RenamePartitionDesc() { + } + + /** + * @param dbName + * database to add to. + * @param tableName + * table to add to. + * @param oldPartSpec + * old partition specification. + * @param newPartSpec + * new partition specification. + */ + public RenamePartitionDesc(String dbName, String tableName, + Map oldPartSpec, Map newPartSpec) { + super(); + this.dbName = dbName; + this.tableName = tableName; + this.oldPartSpec = new LinkedHashMap(oldPartSpec); + this.newPartSpec = new LinkedHashMap(newPartSpec); + } + + /** + * @return database name + */ + public String getDbName() { + return dbName; + } + + /** + * @param dbName + * database name + */ + public void setDbName(String dbName) { + this.dbName = dbName; + } + + /** + * @return the table we're going to add the partitions to. + */ + public String getTableName() { + return tableName; + } + + /** + * @param tableName + * the table we're going to add the partitions to. + */ + public void setTableName(String tableName) { + this.tableName = tableName; + } + + /** + * @return location of partition in relation to table + */ + public String getLocation() { + return location; + } + + /** + * @param location + * location of partition in relation to table + */ + public void setLocation(String location) { + this.location = location; + } + + /** + * @return old partition specification. + */ + public LinkedHashMap getOldPartSpec() { + return oldPartSpec; + } + + /** + * @param partSpec + * partition specification + */ + public void setOldPartSpec(LinkedHashMap partSpec) { + this.oldPartSpec = partSpec; + } + + /** + * @return new partition specification. + */ + public LinkedHashMap getNewPartSpec() { + return newPartSpec; + } + + /** + * @param partSpec + * partition specification + */ + public void setNewPartSpec(LinkedHashMap partSpec) { + this.newPartSpec = partSpec; + } + + /** + * @return if the partition should only be added if it doesn't exist already + */ + public boolean getIfNotExists() { + return this.ifNotExists; + } + + /** + * @param ifNotExists + * if the part should be added only if it doesn't exist + */ + public void setIfNotExists(boolean ifNotExists) { + this.ifNotExists = ifNotExists; + } + + /** + * @return partition parameters. + */ + public Map getPartParams() { + return partParams; + } + + /** + * @param partParams + * partition parameters + */ + + public void setPartParams(Map partParams) { + this.partParams = partParams; + } + + public int getNumBuckets() { + return numBuckets; + } + + public void setNumBuckets(int numBuckets) { + this.numBuckets = numBuckets; + } + + public List getCols() { + return cols; + } + + public void setCols(List cols) { + this.cols = cols; + } + + public String getSerializationLib() { + return serializationLib; + } + + public void setSerializationLib(String serializationLib) { + this.serializationLib = serializationLib; + } + + public Map getSerdeParams() { + return serdeParams; + } + + public void setSerdeParams(Map serdeParams) { + this.serdeParams = serdeParams; + } + + public List getBucketCols() { + return bucketCols; + } + + public void setBucketCols(List bucketCols) { + this.bucketCols = bucketCols; + } + + public List getSortCols() { + return sortCols; + } + + public void setSortCols(List sortCols) { + this.sortCols = sortCols; + } + + public String getInputFormat() { + return inputFormat; + } + + public void setInputFormat(String inputFormat) { + this.inputFormat = inputFormat; + } + + public String getOutputFormat() { + return outputFormat; + } + + public void setOutputFormat(String outputFormat) { + this.outputFormat = outputFormat; + } + + /* + * @return whether to expect a view being altered + */ + public boolean getExpectView() { + return expectView; + } + + /** + * @param expectView + * set whether to expect a view being altered + */ + public void setExpectView(boolean expectView) { + this.expectView = expectView; + } +} Index: ql/src/java/org/apache/hadoop/hive/ql/plan/AlterTableDesc.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/plan/AlterTableDesc.java (revision 1145366) +++ ql/src/java/org/apache/hadoop/hive/ql/plan/AlterTableDesc.java (working copy) @@ -43,7 +43,7 @@ RENAME, ADDCOLS, REPLACECOLS, ADDPROPS, ADDSERDE, ADDSERDEPROPS, ADDFILEFORMAT, ADDCLUSTERSORTCOLUMN, RENAMECOLUMN, ADDPARTITION, TOUCH, ARCHIVE, UNARCHIVE, ALTERPROTECTMODE, ALTERPARTITIONPROTECTMODE, - ALTERLOCATION, DROPPARTITION + ALTERLOCATION, DROPPARTITION, RENAMEPARTITION }; public static enum ProtectModeType { Index: ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g (revision 1145366) +++ ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g (working copy) @@ -119,6 +119,7 @@ TOK_ALTERTABLE_RENAME; TOK_ALTERTABLE_ADDCOLS; TOK_ALTERTABLE_RENAMECOL; +TOK_ALTERTABLE_RENAMEPART; TOK_ALTERTABLE_REPLACECOLS; TOK_ALTERTABLE_ADDPARTS; TOK_ALTERTABLE_DROPPARTS; @@ -556,6 +557,7 @@ : alterStatementSuffixRename | alterStatementSuffixAddCol | alterStatementSuffixRenameCol + | alterStatementSuffixRenamePart | alterStatementSuffixDropPartitions | alterStatementSuffixAddPartitions | alterStatementSuffixTouch @@ -629,6 +631,13 @@ : Identifier KW_CHANGE KW_COLUMN? oldName=Identifier newName=Identifier colType (KW_COMMENT comment=StringLiteral)? alterStatementChangeColPosition? ->^(TOK_ALTERTABLE_RENAMECOL Identifier $oldName $newName colType $comment? alterStatementChangeColPosition?) ; + +alterStatementSuffixRenamePart +@init { msgs.push("rename partition statement"); } +@after { msgs.pop(); } + : Identifier partitionSpec KW_RENAME KW_TO partitionSpec + ->^(TOK_ALTERTABLE_RENAMEPART Identifier (partitionSpec)+) + ; alterStatementChangeColPosition : first=KW_FIRST|KW_AFTER afterCol=Identifier Index: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java (revision 1145366) +++ ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java (working copy) @@ -49,6 +49,7 @@ commandType.put(HiveParser.TOK_ALTERTABLE_ADDCOLS, HiveOperation.ALTERTABLE_ADDCOLS); commandType.put(HiveParser.TOK_ALTERTABLE_REPLACECOLS, HiveOperation.ALTERTABLE_REPLACECOLS); commandType.put(HiveParser.TOK_ALTERTABLE_RENAMECOL, HiveOperation.ALTERTABLE_RENAMECOL); + commandType.put(HiveParser.TOK_ALTERTABLE_RENAMEPART, HiveOperation.ALTERTABLE_RENAMEPART); commandType.put(HiveParser.TOK_ALTERTABLE_RENAME, HiveOperation.ALTERTABLE_RENAME); commandType.put(HiveParser.TOK_ALTERTABLE_DROPPARTS, HiveOperation.ALTERTABLE_DROPPARTS); commandType.put(HiveParser.TOK_ALTERTABLE_ADDPARTS, HiveOperation.ALTERTABLE_ADDPARTS); @@ -135,6 +136,7 @@ case HiveParser.TOK_MSCK: case HiveParser.TOK_ALTERTABLE_ADDCOLS: case HiveParser.TOK_ALTERTABLE_RENAMECOL: + case HiveParser.TOK_ALTERTABLE_RENAMEPART: case HiveParser.TOK_ALTERTABLE_REPLACECOLS: case HiveParser.TOK_ALTERTABLE_RENAME: case HiveParser.TOK_ALTERTABLE_DROPPARTS: Index: ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java (revision 1145366) +++ ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java (working copy) @@ -92,6 +92,7 @@ import org.apache.hadoop.hive.ql.plan.PrincipalDesc; import org.apache.hadoop.hive.ql.plan.PrivilegeDesc; import org.apache.hadoop.hive.ql.plan.PrivilegeObjectDesc; +import org.apache.hadoop.hive.ql.plan.RenamePartitionDesc; import org.apache.hadoop.hive.ql.plan.RevokeDesc; import org.apache.hadoop.hive.ql.plan.RoleDDLDesc; import org.apache.hadoop.hive.ql.plan.ShowDatabasesDesc; @@ -286,6 +287,9 @@ case HiveParser.TOK_ALTERTABLE_RENAMECOL: analyzeAlterTableRenameCol(ast); break; + case HiveParser.TOK_ALTERTABLE_RENAMEPART: + analyzeAlterTableRenamePart(ast); + break; case HiveParser.TOK_ALTERTABLE_ADDPARTS: analyzeAlterTableAddParts(ast, false); break; @@ -1688,6 +1692,29 @@ alterTblDesc), conf)); } + private void analyzeAlterTableRenamePart(ASTNode ast) throws SemanticException { + String tblName = getUnescapedName((ASTNode)ast.getChild(0)); + + List> partSpecs = getPartitionSpecs(ast); + + try { + Table tab = db.getTable(db.getCurrentDatabase(), tblName, false); + if (tab != null) { + inputs.add(new ReadEntity(tab)); + } + } catch (HiveException e) { + throw new SemanticException(ErrorMsg.INVALID_TABLE.getMsg(tblName)); + } + if (partSpecs == null || partSpecs.size() != 2) { + throw new SemanticException("Isn't two partitions"); + } + addTablePartsOutputs(tblName, partSpecs); + RenamePartitionDesc renamePartitionDesc = new RenamePartitionDesc( + db.getCurrentDatabase(), tblName, partSpecs.get(0), partSpecs.get(1)); + rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), + renamePartitionDesc), conf)); + } + private void analyzeAlterTableModifyCols(ASTNode ast, AlterTableTypes alterType) throws SemanticException { String tblName = getUnescapedName((ASTNode)ast.getChild(0)); @@ -2068,9 +2095,9 @@ outputs.add(new WriteEntity(part)); } catch (HiveException e) { // Ignore the error if the partition does not exist - if (throwIfNonExistent) { - throw new SemanticException(ErrorMsg.INVALID_PARTITION.getMsg(ast.getChild(index))); - } + if (throwIfNonExistent) { + throw new SemanticException(ErrorMsg.INVALID_PARTITION.getMsg(ast.getChild(index))); + } } } }