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,138 @@ } } + 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"); + String part2_path = "/ds=tmp_2011-07-11/hr=-8"; + + List tmp_vals2 = new ArrayList(2); + tmp_vals2.add("tmp_2011-07-16"); + tmp_vals2.add("-10"); + + 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); + + client.renamePartition(dbName, tblName, part.getValues(), tmp_vals); + + 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(), + tbl.getSd().getLocation() + part2_path); + + client.renamePartition(dbName, tblName, tmp_vals, vals); + + 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("testRenamePartition() 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) @@ -141,7 +141,7 @@ public abstract List listPartitionNamesByFilter(String db_name, String tbl_name, String filter, short max_parts) throws MetaException; - public abstract void alterPartition(String db_name, String tbl_name, + public abstract void alterPartition(String db_name, String tbl_name, List part_vals, Partition new_part) throws InvalidObjectException, MetaException; public abstract boolean addIndex(Index index) @@ -286,6 +286,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 newpart_vals + * values of the 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, final List newpart_vals) + 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 newpart_vals + * @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, + * java.lang.String, java.util.List) + */ + public void renamePartition(final String dbname, final String name, final List part_vals, final List newpart_vals) + throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException, + TException { + client.rename_partition(dbname, name, part_vals, newpart_vals); + } + 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; @@ -1742,7 +1743,7 @@ .currentTimeMillis() / 1000)); } Partition oldPart = ms.getPartition(db_name, tbl_name, new_part.getValues()); - ms.alterPartition(db_name, tbl_name, new_part); + ms.alterPartition(db_name, tbl_name, new_part.getValues(), new_part); for (MetaStoreEventListener listener : listeners) { listener.onAlterPartition(new AlterPartitionEvent(oldPart, new_part, true, this)); } @@ -1783,6 +1784,154 @@ return; } + private void rename_partition_core(final RawStore ms, final String dbname, final String name, final List part_vals, final List newpart_vals) + throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException { + boolean success = false; + + Path srcPath = null; + Path destPath = null; + FileSystem srcFs = null; + FileSystem destFs = null; + Table tbl = null; + Partition part = null; + + String oldPartLoc = null; + String newPartLoc = null; + + try { + ms.openTransaction(); + try { + 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"); + } + + Partition check_part = null; + try { + check_part = ms.getPartition(dbname, name, newpart_vals); + } catch(NoSuchObjectException e) { + // this means there is no existing partition + check_part = null; + } + if (check_part != null) { + throw new AlreadyExistsException("Partition already exists:" + dbname + "." + name + "." + newpart_vals); + } + tbl = ms.getTable(dbname, name); + if (tbl == null) { + throw new InvalidObjectException( + "Unable to rename partition because table or database do not exist"); + } + destPath = new Path(tbl.getSd().getLocation(), Warehouse.makePartName(tbl.getPartitionKeys(), + newpart_vals)); + + if (destPath != null) { + newPartLoc = destPath.toString(); + oldPartLoc = part.getSd().getLocation(); + + srcPath = new Path(oldPartLoc); + + LOG.info("srcPath:" + oldPartLoc); + LOG.info("descPath:" + newPartLoc); + 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 (newPartLoc.compareTo(oldPartLoc) != 0 && 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() + " " + newpart_vals); + } + // Set DDL time to now if not specified + if (part.getParameters() == null || + part.getParameters().get(Constants.DDL_TIME) == null || + Integer.parseInt(part.getParameters().get(Constants.DDL_TIME)) == 0) { + part.putToParameters(Constants.DDL_TIME, Long.toString(System + .currentTimeMillis() / 1000)); + } + part.setValues(newpart_vals); + part.getSd().setLocation(newPartLoc); + ms.alterPartition(dbname, name, part_vals, part); + } + + success = ms.commitTransaction(); + } finally { + if (!success) { + ms.rollbackTransaction(); + } + if (success && newPartLoc.compareTo(oldPartLoc) != 0) { + //rename the data directory + try{ + if (srcFs.exists(srcPath)) { + srcFs.rename(srcPath, destPath); + LOG.info("rename done!"); + } + } catch (IOException e) { + boolean revertMetaDataTransaction = false; + try { + ms.openTransaction(); + part.setValues(part_vals); + part.getSd().setLocation(oldPartLoc); + ms.alterPartition(dbname, name, newpart_vals, 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 List newpart_vals) + throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException { + startTableFunction("rename_partition", dbname, name); + LOG.info("Old Partition values:" + part_vals); + LOG.info("New Partition values:" + newpart_vals); + + try { + executeWithRetry(new Command() { + @Override + public Boolean run(RawStore ms) throws Exception { + rename_partition_core(ms, dbname, name, part_vals, newpart_vals); + 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/HiveAlterHandler.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java (revision 1145366) +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java (working copy) @@ -30,9 +30,9 @@ 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; import org.apache.hadoop.hive.metastore.api.Partition; import org.apache.hadoop.hive.metastore.api.Table; -import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; /** * Hive specific implementation of alter @@ -164,7 +164,7 @@ oldUri.getAuthority(), newPath); part.getSd().setLocation(newPartLocPath.toString()); - msdb.alterPartition(dbname, name, part); + msdb.alterPartition(dbname, name, part.getValues(), part); } } } 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,18 +1704,20 @@ } } - public void alterPartition(String dbname, String name, Partition newPart) + public void alterPartition(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, newPart.getValues()); + MPartition oldp = getMPartition(dbname, name, part_vals); MPartition newp = convertToMPart(newPart); if (oldp == null || newp == null) { throw new InvalidObjectException("partition does not exist."); } + oldp.setValues(newp.getValues()); + oldp.setPartitionName(newp.getPartitionName()); oldp.setParameters(newPart.getParameters()); copyMSD(newp.getSd(), oldp.getSd()); if (newp.getCreateTime() != oldp.getCreateTime()) { 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, newpart_vals): + """ + Parameters: + - dbname + - name + - part_vals + - newpart_vals + """ + pass + def add_partition(self, new_part): """ Parameters: @@ -1188,6 +1198,48 @@ raise result.o2 return + def rename_partition(self, dbname, name, part_vals, newpart_vals): + """ + Parameters: + - dbname + - name + - part_vals + - newpart_vals + """ + self.send_rename_partition(dbname, name, part_vals, newpart_vals) + self.recv_rename_partition() + + def send_rename_partition(self, dbname, name, part_vals, newpart_vals): + 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.newpart_vals = newpart_vals + 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.newpart_vals) + 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,216 @@ def __ne__(self, other): return not (self == other) +class rename_partition_args: + """ + Attributes: + - dbname + - name + - part_vals + - newpart_vals + """ + + 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.LIST, 'newpart_vals', (TType.STRING,None), None, ), # 4 + ) + + def __init__(self, dbname=None, name=None, part_vals=None, newpart_vals=None,): + self.dbname = dbname + self.name = name + self.part_vals = part_vals + self.newpart_vals = newpart_vals + + 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.LIST: + self.newpart_vals = [] + (_etype248, _size245) = iprot.readListBegin() + for _i249 in xrange(_size245): + _elem250 = iprot.readString(); + self.newpart_vals.append(_elem250) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('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 iter251 in self.part_vals: + oprot.writeString(iter251) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.newpart_vals != None: + oprot.writeFieldBegin('newpart_vals', TType.LIST, 4) + oprot.writeListBegin(TType.STRING, len(self.newpart_vals)) + for iter252 in self.newpart_vals: + oprot.writeString(iter252) + oprot.writeListEnd() + 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 +7125,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) + (_etype256, _size253) = iprot.readListBegin() + for _i257 in xrange(_size253): + _elem258 = iprot.readString(); + self.part_vals.append(_elem258) iprot.readListEnd() else: iprot.skip(ftype) @@ -6870,8 +7153,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 iter259 in self.part_vals: + oprot.writeString(iter259) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -7215,10 +7498,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) + (_etype263, _size260) = iprot.readListBegin() + for _i264 in xrange(_size260): + _elem265 = iprot.readString(); + self.part_vals.append(_elem265) iprot.readListEnd() else: iprot.skip(ftype) @@ -7248,8 +7531,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 iter266 in self.part_vals: + oprot.writeString(iter266) oprot.writeListEnd() oprot.writeFieldEnd() if self.deleteData != None: @@ -7578,10 +7861,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) + (_etype270, _size267) = iprot.readListBegin() + for _i271 in xrange(_size267): + _elem272 = iprot.readString(); + self.part_vals.append(_elem272) iprot.readListEnd() else: iprot.skip(ftype) @@ -7606,8 +7889,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 iter273 in self.part_vals: + oprot.writeString(iter273) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -7760,10 +8043,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) + (_etype277, _size274) = iprot.readListBegin() + for _i278 in xrange(_size274): + _elem279 = iprot.readString(); + self.part_vals.append(_elem279) iprot.readListEnd() else: iprot.skip(ftype) @@ -7775,10 +8058,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) + (_etype283, _size280) = iprot.readListBegin() + for _i284 in xrange(_size280): + _elem285 = iprot.readString(); + self.group_names.append(_elem285) iprot.readListEnd() else: iprot.skip(ftype) @@ -7803,8 +8086,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 iter286 in self.part_vals: + oprot.writeString(iter286) oprot.writeListEnd() oprot.writeFieldEnd() if self.user_name != None: @@ -7814,8 +8097,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 iter287 in self.group_names: + oprot.writeString(iter287) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -8202,11 +8485,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) + (_etype291, _size288) = iprot.readListBegin() + for _i292 in xrange(_size288): + _elem293 = Partition() + _elem293.read(iprot) + self.success.append(_elem293) iprot.readListEnd() else: iprot.skip(ftype) @@ -8235,8 +8518,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 iter294 in self.success: + iter294.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -8322,10 +8605,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) + (_etype298, _size295) = iprot.readListBegin() + for _i299 in xrange(_size295): + _elem300 = iprot.readString(); + self.group_names.append(_elem300) iprot.readListEnd() else: iprot.skip(ftype) @@ -8358,8 +8641,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 iter301 in self.group_names: + oprot.writeString(iter301) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -8410,11 +8693,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) + (_etype305, _size302) = iprot.readListBegin() + for _i306 in xrange(_size302): + _elem307 = Partition() + _elem307.read(iprot) + self.success.append(_elem307) iprot.readListEnd() else: iprot.skip(ftype) @@ -8443,8 +8726,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 iter308 in self.success: + iter308.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -8583,10 +8866,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) + (_etype312, _size309) = iprot.readListBegin() + for _i313 in xrange(_size309): + _elem314 = iprot.readString(); + self.success.append(_elem314) iprot.readListEnd() else: iprot.skip(ftype) @@ -8609,8 +8892,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 iter315 in self.success: + oprot.writeString(iter315) oprot.writeListEnd() oprot.writeFieldEnd() if self.o2 != None: @@ -8679,10 +8962,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) + (_etype319, _size316) = iprot.readListBegin() + for _i320 in xrange(_size316): + _elem321 = iprot.readString(); + self.part_vals.append(_elem321) iprot.readListEnd() else: iprot.skip(ftype) @@ -8712,8 +8995,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 iter322 in self.part_vals: + oprot.writeString(iter322) oprot.writeListEnd() oprot.writeFieldEnd() if self.max_parts != None: @@ -8765,11 +9048,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) + (_etype326, _size323) = iprot.readListBegin() + for _i327 in xrange(_size323): + _elem328 = Partition() + _elem328.read(iprot) + self.success.append(_elem328) iprot.readListEnd() else: iprot.skip(ftype) @@ -8792,8 +9075,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 iter329 in self.success: + iter329.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -8868,10 +9151,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) + (_etype333, _size330) = iprot.readListBegin() + for _i334 in xrange(_size330): + _elem335 = iprot.readString(); + self.part_vals.append(_elem335) iprot.readListEnd() else: iprot.skip(ftype) @@ -8888,10 +9171,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) + (_etype339, _size336) = iprot.readListBegin() + for _i340 in xrange(_size336): + _elem341 = iprot.readString(); + self.group_names.append(_elem341) iprot.readListEnd() else: iprot.skip(ftype) @@ -8916,8 +9199,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 iter342 in self.part_vals: + oprot.writeString(iter342) oprot.writeListEnd() oprot.writeFieldEnd() if self.max_parts != None: @@ -8931,8 +9214,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 iter343 in self.group_names: + oprot.writeString(iter343) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -8983,11 +9266,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) + (_etype347, _size344) = iprot.readListBegin() + for _i348 in xrange(_size344): + _elem349 = Partition() + _elem349.read(iprot) + self.success.append(_elem349) iprot.readListEnd() else: iprot.skip(ftype) @@ -9016,8 +9299,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 iter350 in self.success: + iter350.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -9090,10 +9373,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) + (_etype354, _size351) = iprot.readListBegin() + for _i355 in xrange(_size351): + _elem356 = iprot.readString(); + self.part_vals.append(_elem356) iprot.readListEnd() else: iprot.skip(ftype) @@ -9123,8 +9406,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 iter357 in self.part_vals: + oprot.writeString(iter357) oprot.writeListEnd() oprot.writeFieldEnd() if self.max_parts != None: @@ -9176,10 +9459,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) + (_etype361, _size358) = iprot.readListBegin() + for _i362 in xrange(_size358): + _elem363 = iprot.readString(); + self.success.append(_elem363) iprot.readListEnd() else: iprot.skip(ftype) @@ -9202,8 +9485,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 iter364 in self.success: + oprot.writeString(iter364) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -9353,11 +9636,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) + (_etype368, _size365) = iprot.readListBegin() + for _i369 in xrange(_size365): + _elem370 = Partition() + _elem370.read(iprot) + self.success.append(_elem370) iprot.readListEnd() else: iprot.skip(ftype) @@ -9386,8 +9669,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 iter371 in self.success: + iter371.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -9457,10 +9740,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) + (_etype375, _size372) = iprot.readListBegin() + for _i376 in xrange(_size372): + _elem377 = iprot.readString(); + self.names.append(_elem377) iprot.readListEnd() else: iprot.skip(ftype) @@ -9485,8 +9768,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 iter378 in self.names: + oprot.writeString(iter378) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -9537,11 +9820,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) + (_etype382, _size379) = iprot.readListBegin() + for _i383 in xrange(_size379): + _elem384 = Partition() + _elem384.read(iprot) + self.success.append(_elem384) iprot.readListEnd() else: iprot.skip(ftype) @@ -9570,8 +9853,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 iter385 in self.success: + iter385.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -9985,10 +10268,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) + (_etype389, _size386) = iprot.readListBegin() + for _i390 in xrange(_size386): + _elem391 = iprot.readString(); + self.success.append(_elem391) iprot.readListEnd() else: iprot.skip(ftype) @@ -10011,8 +10294,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 iter392 in self.success: + oprot.writeString(iter392) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -10123,11 +10406,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 + (_ktype394, _vtype395, _size393 ) = iprot.readMapBegin() + for _i397 in xrange(_size393): + _key398 = iprot.readString(); + _val399 = iprot.readString(); + self.success[_key398] = _val399 iprot.readMapEnd() else: iprot.skip(ftype) @@ -10150,9 +10433,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 kiter400,viter401 in self.success.items(): + oprot.writeString(kiter400) + oprot.writeString(viter401) oprot.writeMapEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -10221,11 +10504,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 + (_ktype403, _vtype404, _size402 ) = iprot.readMapBegin() + for _i406 in xrange(_size402): + _key407 = iprot.readString(); + _val408 = iprot.readString(); + self.part_vals[_key407] = _val408 iprot.readMapEnd() else: iprot.skip(ftype) @@ -10255,9 +10538,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 kiter409,viter410 in self.part_vals.items(): + oprot.writeString(kiter409) + oprot.writeString(viter410) oprot.writeMapEnd() oprot.writeFieldEnd() if self.eventType != None: @@ -10451,11 +10734,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 + (_ktype412, _vtype413, _size411 ) = iprot.readMapBegin() + for _i415 in xrange(_size411): + _key416 = iprot.readString(); + _val417 = iprot.readString(); + self.part_vals[_key416] = _val417 iprot.readMapEnd() else: iprot.skip(ftype) @@ -10485,9 +10768,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 kiter418,viter419 in self.part_vals.items(): + oprot.writeString(kiter418) + oprot.writeString(viter419) oprot.writeMapEnd() oprot.writeFieldEnd() if self.eventType != None: @@ -11448,11 +11731,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) + (_etype423, _size420) = iprot.readListBegin() + for _i424 in xrange(_size420): + _elem425 = Index() + _elem425.read(iprot) + self.success.append(_elem425) iprot.readListEnd() else: iprot.skip(ftype) @@ -11481,8 +11764,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 iter426 in self.success: + iter426.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -11621,10 +11904,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) + (_etype430, _size427) = iprot.readListBegin() + for _i431 in xrange(_size427): + _elem432 = iprot.readString(); + self.success.append(_elem432) iprot.readListEnd() else: iprot.skip(ftype) @@ -11647,8 +11930,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 iter433 in self.success: + oprot.writeString(iter433) oprot.writeListEnd() oprot.writeFieldEnd() if self.o2 != None: @@ -12002,10 +12285,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) + (_etype437, _size434) = iprot.readListBegin() + for _i438 in xrange(_size434): + _elem439 = iprot.readString(); + self.success.append(_elem439) iprot.readListEnd() else: iprot.skip(ftype) @@ -12028,8 +12311,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 iter440 in self.success: + oprot.writeString(iter440) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -12496,11 +12779,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) + (_etype444, _size441) = iprot.readListBegin() + for _i445 in xrange(_size441): + _elem446 = Role() + _elem446.read(iprot) + self.success.append(_elem446) iprot.readListEnd() else: iprot.skip(ftype) @@ -12523,8 +12806,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 iter447 in self.success: + iter447.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -12591,10 +12874,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) + (_etype451, _size448) = iprot.readListBegin() + for _i452 in xrange(_size448): + _elem453 = iprot.readString(); + self.group_names.append(_elem453) iprot.readListEnd() else: iprot.skip(ftype) @@ -12619,8 +12902,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 iter454 in self.group_names: + oprot.writeString(iter454) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -12824,11 +13107,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) + (_etype458, _size455) = iprot.readListBegin() + for _i459 in xrange(_size455): + _elem460 = HiveObjectPrivilege() + _elem460.read(iprot) + self.success.append(_elem460) iprot.readListEnd() else: iprot.skip(ftype) @@ -12851,8 +13134,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 iter461 in self.success: + iter461.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, newpart_vals)' 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,322 @@ 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_LIST) { + { + this->newpart_vals.clear(); + uint32_t _size259; + ::apache::thrift::protocol::TType _etype262; + iprot->readListBegin(_etype262, _size259); + this->newpart_vals.resize(_size259); + uint32_t _i263; + for (_i263 = 0; _i263 < _size259; ++_i263) + { + xfer += iprot->readString(this->newpart_vals[_i263]); + } + iprot->readListEnd(); + } + this->__isset.newpart_vals = 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 _iter264; + for (_iter264 = this->part_vals.begin(); _iter264 != this->part_vals.end(); ++_iter264) + { + xfer += oprot->writeString((*_iter264)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("newpart_vals", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->newpart_vals.size()); + std::vector ::const_iterator _iter265; + for (_iter265 = this->newpart_vals.begin(); _iter265 != this->newpart_vals.end(); ++_iter265) + { + xfer += oprot->writeString((*_iter265)); + } + xfer += oprot->writeListEnd(); + } + 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 _iter266; + for (_iter266 = (*(this->part_vals)).begin(); _iter266 != (*(this->part_vals)).end(); ++_iter266) + { + xfer += oprot->writeString((*_iter266)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("newpart_vals", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, (*(this->newpart_vals)).size()); + std::vector ::const_iterator _iter267; + for (_iter267 = (*(this->newpart_vals)).begin(); _iter267 != (*(this->newpart_vals)).end(); ++_iter267) + { + xfer += oprot->writeString((*_iter267)); + } + xfer += oprot->writeListEnd(); + } + 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 +4728,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 _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[_i258]); + xfer += iprot->readString(this->part_vals[_i272]); } iprot->readListEnd(); } @@ -4452,10 +4768,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 _iter273; + for (_iter273 = this->part_vals.begin(); _iter273 != this->part_vals.end(); ++_iter273) { - xfer += oprot->writeString((*_iter259)); + xfer += oprot->writeString((*_iter273)); } xfer += oprot->writeListEnd(); } @@ -4477,10 +4793,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 _iter274; + for (_iter274 = (*(this->part_vals)).begin(); _iter274 != (*(this->part_vals)).end(); ++_iter274) { - xfer += oprot->writeString((*_iter260)); + xfer += oprot->writeString((*_iter274)); } xfer += oprot->writeListEnd(); } @@ -4932,14 +5248,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 _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[_i265]); + xfer += iprot->readString(this->part_vals[_i279]); } iprot->readListEnd(); } @@ -4980,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 _iter266; - for (_iter266 = this->part_vals.begin(); _iter266 != this->part_vals.end(); ++_iter266) + std::vector ::const_iterator _iter280; + for (_iter280 = this->part_vals.begin(); _iter280 != this->part_vals.end(); ++_iter280) { - xfer += oprot->writeString((*_iter266)); + xfer += oprot->writeString((*_iter280)); } xfer += oprot->writeListEnd(); } @@ -5008,10 +5324,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 _iter281; + for (_iter281 = (*(this->part_vals)).begin(); _iter281 != (*(this->part_vals)).end(); ++_iter281) { - xfer += oprot->writeString((*_iter267)); + xfer += oprot->writeString((*_iter281)); } xfer += oprot->writeListEnd(); } @@ -5440,14 +5756,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 _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[_i272]); + xfer += iprot->readString(this->part_vals[_i286]); } iprot->readListEnd(); } @@ -5480,10 +5796,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 _iter287; + for (_iter287 = this->part_vals.begin(); _iter287 != this->part_vals.end(); ++_iter287) { - xfer += oprot->writeString((*_iter273)); + xfer += oprot->writeString((*_iter287)); } xfer += oprot->writeListEnd(); } @@ -5505,10 +5821,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 _iter288; + for (_iter288 = (*(this->part_vals)).begin(); _iter288 != (*(this->part_vals)).end(); ++_iter288) { - xfer += oprot->writeString((*_iter274)); + xfer += oprot->writeString((*_iter288)); } xfer += oprot->writeListEnd(); } @@ -5694,14 +6010,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 _size289; + ::apache::thrift::protocol::TType _etype292; + iprot->readListBegin(_etype292, _size289); + this->part_vals.resize(_size289); + uint32_t _i293; + for (_i293 = 0; _i293 < _size289; ++_i293) { - xfer += iprot->readString(this->part_vals[_i279]); + xfer += iprot->readString(this->part_vals[_i293]); } iprot->readListEnd(); } @@ -5722,14 +6038,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 _size294; + ::apache::thrift::protocol::TType _etype297; + iprot->readListBegin(_etype297, _size294); + this->group_names.resize(_size294); + uint32_t _i298; + for (_i298 = 0; _i298 < _size294; ++_i298) { - xfer += iprot->readString(this->group_names[_i284]); + xfer += iprot->readString(this->group_names[_i298]); } iprot->readListEnd(); } @@ -5762,10 +6078,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 _iter299; + for (_iter299 = this->part_vals.begin(); _iter299 != this->part_vals.end(); ++_iter299) { - xfer += oprot->writeString((*_iter285)); + xfer += oprot->writeString((*_iter299)); } xfer += oprot->writeListEnd(); } @@ -5776,10 +6092,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 _iter300; + for (_iter300 = this->group_names.begin(); _iter300 != this->group_names.end(); ++_iter300) { - xfer += oprot->writeString((*_iter286)); + xfer += oprot->writeString((*_iter300)); } xfer += oprot->writeListEnd(); } @@ -5801,10 +6117,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 _iter301; + for (_iter301 = (*(this->part_vals)).begin(); _iter301 != (*(this->part_vals)).end(); ++_iter301) { - xfer += oprot->writeString((*_iter287)); + xfer += oprot->writeString((*_iter301)); } xfer += oprot->writeListEnd(); } @@ -5815,10 +6131,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 _iter302; + for (_iter302 = (*(this->group_names)).begin(); _iter302 != (*(this->group_names)).end(); ++_iter302) { - xfer += oprot->writeString((*_iter288)); + xfer += oprot->writeString((*_iter302)); } xfer += oprot->writeListEnd(); } @@ -6304,14 +6620,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 _size303; + ::apache::thrift::protocol::TType _etype306; + iprot->readListBegin(_etype306, _size303); + this->success.resize(_size303); + uint32_t _i307; + for (_i307 = 0; _i307 < _size303; ++_i307) { - xfer += this->success[_i293].read(iprot); + xfer += this->success[_i307].read(iprot); } iprot->readListEnd(); } @@ -6358,10 +6674,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 _iter308; + for (_iter308 = this->success.begin(); _iter308 != this->success.end(); ++_iter308) { - xfer += (*_iter294).write(oprot); + xfer += (*_iter308).write(oprot); } xfer += oprot->writeListEnd(); } @@ -6404,14 +6720,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 _size309; + ::apache::thrift::protocol::TType _etype312; + iprot->readListBegin(_etype312, _size309); + (*(this->success)).resize(_size309); + uint32_t _i313; + for (_i313 = 0; _i313 < _size309; ++_i313) { - xfer += (*(this->success))[_i299].read(iprot); + xfer += (*(this->success))[_i313].read(iprot); } iprot->readListEnd(); } @@ -6504,14 +6820,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 _size314; + ::apache::thrift::protocol::TType _etype317; + iprot->readListBegin(_etype317, _size314); + this->group_names.resize(_size314); + uint32_t _i318; + for (_i318 = 0; _i318 < _size314; ++_i318) { - xfer += iprot->readString(this->group_names[_i304]); + xfer += iprot->readString(this->group_names[_i318]); } iprot->readListEnd(); } @@ -6550,10 +6866,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 _iter319; + for (_iter319 = this->group_names.begin(); _iter319 != this->group_names.end(); ++_iter319) { - xfer += oprot->writeString((*_iter305)); + xfer += oprot->writeString((*_iter319)); } xfer += oprot->writeListEnd(); } @@ -6581,10 +6897,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 _iter320; + for (_iter320 = (*(this->group_names)).begin(); _iter320 != (*(this->group_names)).end(); ++_iter320) { - xfer += oprot->writeString((*_iter306)); + xfer += oprot->writeString((*_iter320)); } xfer += oprot->writeListEnd(); } @@ -6618,14 +6934,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 _size321; + ::apache::thrift::protocol::TType _etype324; + iprot->readListBegin(_etype324, _size321); + this->success.resize(_size321); + uint32_t _i325; + for (_i325 = 0; _i325 < _size321; ++_i325) { - xfer += this->success[_i311].read(iprot); + xfer += this->success[_i325].read(iprot); } iprot->readListEnd(); } @@ -6672,10 +6988,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 _iter326; + for (_iter326 = this->success.begin(); _iter326 != this->success.end(); ++_iter326) { - xfer += (*_iter312).write(oprot); + xfer += (*_iter326).write(oprot); } xfer += oprot->writeListEnd(); } @@ -6718,14 +7034,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 _size327; + ::apache::thrift::protocol::TType _etype330; + iprot->readListBegin(_etype330, _size327); + (*(this->success)).resize(_size327); + uint32_t _i331; + for (_i331 = 0; _i331 < _size327; ++_i331) { - xfer += (*(this->success))[_i317].read(iprot); + xfer += (*(this->success))[_i331].read(iprot); } iprot->readListEnd(); } @@ -6876,14 +7192,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 _size332; + ::apache::thrift::protocol::TType _etype335; + iprot->readListBegin(_etype335, _size332); + this->success.resize(_size332); + uint32_t _i336; + for (_i336 = 0; _i336 < _size332; ++_i336) { - xfer += iprot->readString(this->success[_i322]); + xfer += iprot->readString(this->success[_i336]); } iprot->readListEnd(); } @@ -6922,10 +7238,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 _iter337; + for (_iter337 = this->success.begin(); _iter337 != this->success.end(); ++_iter337) { - xfer += oprot->writeString((*_iter323)); + xfer += oprot->writeString((*_iter337)); } xfer += oprot->writeListEnd(); } @@ -6964,14 +7280,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 _size338; + ::apache::thrift::protocol::TType _etype341; + iprot->readListBegin(_etype341, _size338); + (*(this->success)).resize(_size338); + uint32_t _i342; + for (_i342 = 0; _i342 < _size338; ++_i342) { - xfer += iprot->readString((*(this->success))[_i328]); + xfer += iprot->readString((*(this->success))[_i342]); } iprot->readListEnd(); } @@ -7040,14 +7356,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 _size343; + ::apache::thrift::protocol::TType _etype346; + iprot->readListBegin(_etype346, _size343); + this->part_vals.resize(_size343); + uint32_t _i347; + for (_i347 = 0; _i347 < _size343; ++_i347) { - xfer += iprot->readString(this->part_vals[_i333]); + xfer += iprot->readString(this->part_vals[_i347]); } iprot->readListEnd(); } @@ -7088,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 _iter334; - for (_iter334 = this->part_vals.begin(); _iter334 != this->part_vals.end(); ++_iter334) + std::vector ::const_iterator _iter348; + for (_iter348 = this->part_vals.begin(); _iter348 != this->part_vals.end(); ++_iter348) { - xfer += oprot->writeString((*_iter334)); + xfer += oprot->writeString((*_iter348)); } xfer += oprot->writeListEnd(); } @@ -7116,10 +7432,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 _iter349; + for (_iter349 = (*(this->part_vals)).begin(); _iter349 != (*(this->part_vals)).end(); ++_iter349) { - xfer += oprot->writeString((*_iter335)); + xfer += oprot->writeString((*_iter349)); } xfer += oprot->writeListEnd(); } @@ -7156,14 +7472,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 _size350; + ::apache::thrift::protocol::TType _etype353; + iprot->readListBegin(_etype353, _size350); + this->success.resize(_size350); + uint32_t _i354; + for (_i354 = 0; _i354 < _size350; ++_i354) { - xfer += this->success[_i340].read(iprot); + xfer += this->success[_i354].read(iprot); } iprot->readListEnd(); } @@ -7202,10 +7518,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 _iter355; + for (_iter355 = this->success.begin(); _iter355 != this->success.end(); ++_iter355) { - xfer += (*_iter341).write(oprot); + xfer += (*_iter355).write(oprot); } xfer += oprot->writeListEnd(); } @@ -7244,14 +7560,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 _size356; + ::apache::thrift::protocol::TType _etype359; + iprot->readListBegin(_etype359, _size356); + (*(this->success)).resize(_size356); + uint32_t _i360; + for (_i360 = 0; _i360 < _size356; ++_i360) { - xfer += (*(this->success))[_i346].read(iprot); + xfer += (*(this->success))[_i360].read(iprot); } iprot->readListEnd(); } @@ -7320,14 +7636,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 _size361; + ::apache::thrift::protocol::TType _etype364; + iprot->readListBegin(_etype364, _size361); + this->part_vals.resize(_size361); + uint32_t _i365; + for (_i365 = 0; _i365 < _size361; ++_i365) { - xfer += iprot->readString(this->part_vals[_i351]); + xfer += iprot->readString(this->part_vals[_i365]); } iprot->readListEnd(); } @@ -7356,14 +7672,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 _size366; + ::apache::thrift::protocol::TType _etype369; + iprot->readListBegin(_etype369, _size366); + this->group_names.resize(_size366); + uint32_t _i370; + for (_i370 = 0; _i370 < _size366; ++_i370) { - xfer += iprot->readString(this->group_names[_i356]); + xfer += iprot->readString(this->group_names[_i370]); } iprot->readListEnd(); } @@ -7396,10 +7712,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 _iter371; + for (_iter371 = this->part_vals.begin(); _iter371 != this->part_vals.end(); ++_iter371) { - xfer += oprot->writeString((*_iter357)); + xfer += oprot->writeString((*_iter371)); } xfer += oprot->writeListEnd(); } @@ -7413,10 +7729,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 _iter372; + for (_iter372 = this->group_names.begin(); _iter372 != this->group_names.end(); ++_iter372) { - xfer += oprot->writeString((*_iter358)); + xfer += oprot->writeString((*_iter372)); } xfer += oprot->writeListEnd(); } @@ -7438,10 +7754,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 _iter373; + for (_iter373 = (*(this->part_vals)).begin(); _iter373 != (*(this->part_vals)).end(); ++_iter373) { - xfer += oprot->writeString((*_iter359)); + xfer += oprot->writeString((*_iter373)); } xfer += oprot->writeListEnd(); } @@ -7455,10 +7771,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 _iter374; + for (_iter374 = (*(this->group_names)).begin(); _iter374 != (*(this->group_names)).end(); ++_iter374) { - xfer += oprot->writeString((*_iter360)); + xfer += oprot->writeString((*_iter374)); } xfer += oprot->writeListEnd(); } @@ -7492,14 +7808,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 _size375; + ::apache::thrift::protocol::TType _etype378; + iprot->readListBegin(_etype378, _size375); + this->success.resize(_size375); + uint32_t _i379; + for (_i379 = 0; _i379 < _size375; ++_i379) { - xfer += this->success[_i365].read(iprot); + xfer += this->success[_i379].read(iprot); } iprot->readListEnd(); } @@ -7546,10 +7862,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 _iter380; + for (_iter380 = this->success.begin(); _iter380 != this->success.end(); ++_iter380) { - xfer += (*_iter366).write(oprot); + xfer += (*_iter380).write(oprot); } xfer += oprot->writeListEnd(); } @@ -7592,14 +7908,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 _size381; + ::apache::thrift::protocol::TType _etype384; + iprot->readListBegin(_etype384, _size381); + (*(this->success)).resize(_size381); + uint32_t _i385; + for (_i385 = 0; _i385 < _size381; ++_i385) { - xfer += (*(this->success))[_i371].read(iprot); + xfer += (*(this->success))[_i385].read(iprot); } iprot->readListEnd(); } @@ -7676,14 +7992,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 _size386; + ::apache::thrift::protocol::TType _etype389; + iprot->readListBegin(_etype389, _size386); + this->part_vals.resize(_size386); + uint32_t _i390; + for (_i390 = 0; _i390 < _size386; ++_i390) { - xfer += iprot->readString(this->part_vals[_i376]); + xfer += iprot->readString(this->part_vals[_i390]); } iprot->readListEnd(); } @@ -7724,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 _iter377; - for (_iter377 = this->part_vals.begin(); _iter377 != this->part_vals.end(); ++_iter377) + std::vector ::const_iterator _iter391; + for (_iter391 = this->part_vals.begin(); _iter391 != this->part_vals.end(); ++_iter391) { - xfer += oprot->writeString((*_iter377)); + xfer += oprot->writeString((*_iter391)); } xfer += oprot->writeListEnd(); } @@ -7752,10 +8068,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 _iter392; + for (_iter392 = (*(this->part_vals)).begin(); _iter392 != (*(this->part_vals)).end(); ++_iter392) { - xfer += oprot->writeString((*_iter378)); + xfer += oprot->writeString((*_iter392)); } xfer += oprot->writeListEnd(); } @@ -7792,14 +8108,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 _size393; + ::apache::thrift::protocol::TType _etype396; + iprot->readListBegin(_etype396, _size393); + this->success.resize(_size393); + uint32_t _i397; + for (_i397 = 0; _i397 < _size393; ++_i397) { - xfer += iprot->readString(this->success[_i383]); + xfer += iprot->readString(this->success[_i397]); } iprot->readListEnd(); } @@ -7838,10 +8154,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 _iter398; + for (_iter398 = this->success.begin(); _iter398 != this->success.end(); ++_iter398) { - xfer += oprot->writeString((*_iter384)); + xfer += oprot->writeString((*_iter398)); } xfer += oprot->writeListEnd(); } @@ -7880,14 +8196,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 _size399; + ::apache::thrift::protocol::TType _etype402; + iprot->readListBegin(_etype402, _size399); + (*(this->success)).resize(_size399); + uint32_t _i403; + for (_i403 = 0; _i403 < _size399; ++_i403) { - xfer += iprot->readString((*(this->success))[_i389]); + xfer += iprot->readString((*(this->success))[_i403]); } iprot->readListEnd(); } @@ -8044,14 +8360,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 _size404; + ::apache::thrift::protocol::TType _etype407; + iprot->readListBegin(_etype407, _size404); + this->success.resize(_size404); + uint32_t _i408; + for (_i408 = 0; _i408 < _size404; ++_i408) { - xfer += this->success[_i394].read(iprot); + xfer += this->success[_i408].read(iprot); } iprot->readListEnd(); } @@ -8098,10 +8414,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 _iter409; + for (_iter409 = this->success.begin(); _iter409 != this->success.end(); ++_iter409) { - xfer += (*_iter395).write(oprot); + xfer += (*_iter409).write(oprot); } xfer += oprot->writeListEnd(); } @@ -8144,14 +8460,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 _size410; + ::apache::thrift::protocol::TType _etype413; + iprot->readListBegin(_etype413, _size410); + (*(this->success)).resize(_size410); + uint32_t _i414; + for (_i414 = 0; _i414 < _size410; ++_i414) { - xfer += (*(this->success))[_i400].read(iprot); + xfer += (*(this->success))[_i414].read(iprot); } iprot->readListEnd(); } @@ -8228,14 +8544,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 _size415; + ::apache::thrift::protocol::TType _etype418; + iprot->readListBegin(_etype418, _size415); + this->names.resize(_size415); + uint32_t _i419; + for (_i419 = 0; _i419 < _size415; ++_i419) { - xfer += iprot->readString(this->names[_i405]); + xfer += iprot->readString(this->names[_i419]); } iprot->readListEnd(); } @@ -8268,10 +8584,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 _iter420; + for (_iter420 = this->names.begin(); _iter420 != this->names.end(); ++_iter420) { - xfer += oprot->writeString((*_iter406)); + xfer += oprot->writeString((*_iter420)); } xfer += oprot->writeListEnd(); } @@ -8293,10 +8609,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 _iter421; + for (_iter421 = (*(this->names)).begin(); _iter421 != (*(this->names)).end(); ++_iter421) { - xfer += oprot->writeString((*_iter407)); + xfer += oprot->writeString((*_iter421)); } xfer += oprot->writeListEnd(); } @@ -8330,14 +8646,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 _size422; + ::apache::thrift::protocol::TType _etype425; + iprot->readListBegin(_etype425, _size422); + this->success.resize(_size422); + uint32_t _i426; + for (_i426 = 0; _i426 < _size422; ++_i426) { - xfer += this->success[_i412].read(iprot); + xfer += this->success[_i426].read(iprot); } iprot->readListEnd(); } @@ -8384,10 +8700,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 _iter427; + for (_iter427 = this->success.begin(); _iter427 != this->success.end(); ++_iter427) { - xfer += (*_iter413).write(oprot); + xfer += (*_iter427).write(oprot); } xfer += oprot->writeListEnd(); } @@ -8430,14 +8746,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 _size428; + ::apache::thrift::protocol::TType _etype431; + iprot->readListBegin(_etype431, _size428); + (*(this->success)).resize(_size428); + uint32_t _i432; + for (_i432 = 0; _i432 < _size428; ++_i432) { - xfer += (*(this->success))[_i418].read(iprot); + xfer += (*(this->success))[_i432].read(iprot); } iprot->readListEnd(); } @@ -8958,14 +9274,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 _size433; + ::apache::thrift::protocol::TType _etype436; + iprot->readListBegin(_etype436, _size433); + this->success.resize(_size433); + uint32_t _i437; + for (_i437 = 0; _i437 < _size433; ++_i437) { - xfer += iprot->readString(this->success[_i423]); + xfer += iprot->readString(this->success[_i437]); } iprot->readListEnd(); } @@ -9004,10 +9320,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 _iter438; + for (_iter438 = this->success.begin(); _iter438 != this->success.end(); ++_iter438) { - xfer += oprot->writeString((*_iter424)); + xfer += oprot->writeString((*_iter438)); } xfer += oprot->writeListEnd(); } @@ -9046,14 +9362,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 _size439; + ::apache::thrift::protocol::TType _etype442; + iprot->readListBegin(_etype442, _size439); + (*(this->success)).resize(_size439); + uint32_t _i443; + for (_i443 = 0; _i443 < _size439; ++_i443) { - xfer += iprot->readString((*(this->success))[_i429]); + xfer += iprot->readString((*(this->success))[_i443]); } iprot->readListEnd(); } @@ -9168,17 +9484,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 _size444; + ::apache::thrift::protocol::TType _ktype445; + ::apache::thrift::protocol::TType _vtype446; + iprot->readMapBegin(_ktype445, _vtype446, _size444); + uint32_t _i448; + for (_i448 = 0; _i448 < _size444; ++_i448) { - std::string _key435; - xfer += iprot->readString(_key435); - std::string& _val436 = this->success[_key435]; - xfer += iprot->readString(_val436); + std::string _key449; + xfer += iprot->readString(_key449); + std::string& _val450 = this->success[_key449]; + xfer += iprot->readString(_val450); } iprot->readMapEnd(); } @@ -9217,11 +9533,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 _iter451; + for (_iter451 = this->success.begin(); _iter451 != this->success.end(); ++_iter451) { - xfer += oprot->writeString(_iter437->first); - xfer += oprot->writeString(_iter437->second); + xfer += oprot->writeString(_iter451->first); + xfer += oprot->writeString(_iter451->second); } xfer += oprot->writeMapEnd(); } @@ -9260,17 +9576,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 _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 _key443; - xfer += iprot->readString(_key443); - std::string& _val444 = (*(this->success))[_key443]; - xfer += iprot->readString(_val444); + std::string _key457; + xfer += iprot->readString(_key457); + std::string& _val458 = (*(this->success))[_key457]; + xfer += iprot->readString(_val458); } iprot->readMapEnd(); } @@ -9339,17 +9655,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 _size459; + ::apache::thrift::protocol::TType _ktype460; + ::apache::thrift::protocol::TType _vtype461; + iprot->readMapBegin(_ktype460, _vtype461, _size459); + uint32_t _i463; + for (_i463 = 0; _i463 < _size459; ++_i463) { - std::string _key450; - xfer += iprot->readString(_key450); - std::string& _val451 = this->part_vals[_key450]; - xfer += iprot->readString(_val451); + std::string _key464; + xfer += iprot->readString(_key464); + std::string& _val465 = this->part_vals[_key464]; + xfer += iprot->readString(_val465); } iprot->readMapEnd(); } @@ -9360,9 +9676,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 ecast466; + xfer += iprot->readI32(ecast466); + this->eventType = (PartitionEventType::type)ecast466; this->__isset.eventType = true; } else { xfer += iprot->skip(ftype); @@ -9392,11 +9708,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 _iter467; + for (_iter467 = this->part_vals.begin(); _iter467 != this->part_vals.end(); ++_iter467) { - xfer += oprot->writeString(_iter453->first); - xfer += oprot->writeString(_iter453->second); + xfer += oprot->writeString(_iter467->first); + xfer += oprot->writeString(_iter467->second); } xfer += oprot->writeMapEnd(); } @@ -9421,11 +9737,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 _iter468; + for (_iter468 = (*(this->part_vals)).begin(); _iter468 != (*(this->part_vals)).end(); ++_iter468) { - xfer += oprot->writeString(_iter454->first); - xfer += oprot->writeString(_iter454->second); + xfer += oprot->writeString(_iter468->first); + xfer += oprot->writeString(_iter468->second); } xfer += oprot->writeMapEnd(); } @@ -9674,17 +9990,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 _size469; + ::apache::thrift::protocol::TType _ktype470; + ::apache::thrift::protocol::TType _vtype471; + iprot->readMapBegin(_ktype470, _vtype471, _size469); + uint32_t _i473; + for (_i473 = 0; _i473 < _size469; ++_i473) { - std::string _key460; - xfer += iprot->readString(_key460); - std::string& _val461 = this->part_vals[_key460]; - xfer += iprot->readString(_val461); + std::string _key474; + xfer += iprot->readString(_key474); + std::string& _val475 = this->part_vals[_key474]; + xfer += iprot->readString(_val475); } iprot->readMapEnd(); } @@ -9695,9 +10011,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 ecast476; + xfer += iprot->readI32(ecast476); + this->eventType = (PartitionEventType::type)ecast476; this->__isset.eventType = true; } else { xfer += iprot->skip(ftype); @@ -9727,11 +10043,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 _iter477; + for (_iter477 = this->part_vals.begin(); _iter477 != this->part_vals.end(); ++_iter477) { - xfer += oprot->writeString(_iter463->first); - xfer += oprot->writeString(_iter463->second); + xfer += oprot->writeString(_iter477->first); + xfer += oprot->writeString(_iter477->second); } xfer += oprot->writeMapEnd(); } @@ -9756,11 +10072,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 _iter478; + for (_iter478 = (*(this->part_vals)).begin(); _iter478 != (*(this->part_vals)).end(); ++_iter478) { - xfer += oprot->writeString(_iter464->first); - xfer += oprot->writeString(_iter464->second); + xfer += oprot->writeString(_iter478->first); + xfer += oprot->writeString(_iter478->second); } xfer += oprot->writeMapEnd(); } @@ -11021,14 +11337,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 _size479; + ::apache::thrift::protocol::TType _etype482; + iprot->readListBegin(_etype482, _size479); + this->success.resize(_size479); + uint32_t _i483; + for (_i483 = 0; _i483 < _size479; ++_i483) { - xfer += this->success[_i469].read(iprot); + xfer += this->success[_i483].read(iprot); } iprot->readListEnd(); } @@ -11075,10 +11391,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 _iter484; + for (_iter484 = this->success.begin(); _iter484 != this->success.end(); ++_iter484) { - xfer += (*_iter470).write(oprot); + xfer += (*_iter484).write(oprot); } xfer += oprot->writeListEnd(); } @@ -11121,14 +11437,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 _size485; + ::apache::thrift::protocol::TType _etype488; + iprot->readListBegin(_etype488, _size485); + (*(this->success)).resize(_size485); + uint32_t _i489; + for (_i489 = 0; _i489 < _size485; ++_i489) { - xfer += (*(this->success))[_i475].read(iprot); + xfer += (*(this->success))[_i489].read(iprot); } iprot->readListEnd(); } @@ -11279,14 +11595,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 _size490; + ::apache::thrift::protocol::TType _etype493; + iprot->readListBegin(_etype493, _size490); + this->success.resize(_size490); + uint32_t _i494; + for (_i494 = 0; _i494 < _size490; ++_i494) { - xfer += iprot->readString(this->success[_i480]); + xfer += iprot->readString(this->success[_i494]); } iprot->readListEnd(); } @@ -11325,10 +11641,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 _iter495; + for (_iter495 = this->success.begin(); _iter495 != this->success.end(); ++_iter495) { - xfer += oprot->writeString((*_iter481)); + xfer += oprot->writeString((*_iter495)); } xfer += oprot->writeListEnd(); } @@ -11367,14 +11683,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 _size496; + ::apache::thrift::protocol::TType _etype499; + iprot->readListBegin(_etype499, _size496); + (*(this->success)).resize(_size496); + uint32_t _i500; + for (_i500 = 0; _i500 < _size496; ++_i500) { - xfer += iprot->readString((*(this->success))[_i486]); + xfer += iprot->readString((*(this->success))[_i500]); } iprot->readListEnd(); } @@ -11831,14 +12147,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 _size501; + ::apache::thrift::protocol::TType _etype504; + iprot->readListBegin(_etype504, _size501); + this->success.resize(_size501); + uint32_t _i505; + for (_i505 = 0; _i505 < _size501; ++_i505) { - xfer += iprot->readString(this->success[_i491]); + xfer += iprot->readString(this->success[_i505]); } iprot->readListEnd(); } @@ -11877,10 +12193,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 _iter506; + for (_iter506 = this->success.begin(); _iter506 != this->success.end(); ++_iter506) { - xfer += oprot->writeString((*_iter492)); + xfer += oprot->writeString((*_iter506)); } xfer += oprot->writeListEnd(); } @@ -11919,14 +12235,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 _size507; + ::apache::thrift::protocol::TType _etype510; + iprot->readListBegin(_etype510, _size507); + (*(this->success)).resize(_size507); + uint32_t _i511; + for (_i511 = 0; _i511 < _size507; ++_i511) { - xfer += iprot->readString((*(this->success))[_i497]); + xfer += iprot->readString((*(this->success))[_i511]); } iprot->readListEnd(); } @@ -11993,9 +12309,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 ecast512; + xfer += iprot->readI32(ecast512); + this->principal_type = (PrincipalType::type)ecast512; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -12011,9 +12327,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 ecast513; + xfer += iprot->readI32(ecast513); + this->grantorType = (PrincipalType::type)ecast513; this->__isset.grantorType = true; } else { xfer += iprot->skip(ftype); @@ -12245,9 +12561,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 ecast514; + xfer += iprot->readI32(ecast514); + this->principal_type = (PrincipalType::type)ecast514; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -12445,9 +12761,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 ecast515; + xfer += iprot->readI32(ecast515); + this->principal_type = (PrincipalType::type)ecast515; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -12517,14 +12833,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 _size516; + ::apache::thrift::protocol::TType _etype519; + iprot->readListBegin(_etype519, _size516); + this->success.resize(_size516); + uint32_t _i520; + for (_i520 = 0; _i520 < _size516; ++_i520) { - xfer += this->success[_i506].read(iprot); + xfer += this->success[_i520].read(iprot); } iprot->readListEnd(); } @@ -12563,10 +12879,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 _iter521; + for (_iter521 = this->success.begin(); _iter521 != this->success.end(); ++_iter521) { - xfer += (*_iter507).write(oprot); + xfer += (*_iter521).write(oprot); } xfer += oprot->writeListEnd(); } @@ -12605,14 +12921,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 _size522; + ::apache::thrift::protocol::TType _etype525; + iprot->readListBegin(_etype525, _size522); + (*(this->success)).resize(_size522); + uint32_t _i526; + for (_i526 = 0; _i526 < _size522; ++_i526) { - xfer += (*(this->success))[_i512].read(iprot); + xfer += (*(this->success))[_i526].read(iprot); } iprot->readListEnd(); } @@ -12681,14 +12997,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 _size527; + ::apache::thrift::protocol::TType _etype530; + iprot->readListBegin(_etype530, _size527); + this->group_names.resize(_size527); + uint32_t _i531; + for (_i531 = 0; _i531 < _size527; ++_i531) { - xfer += iprot->readString(this->group_names[_i517]); + xfer += iprot->readString(this->group_names[_i531]); } iprot->readListEnd(); } @@ -12721,10 +13037,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 _iter532; + for (_iter532 = this->group_names.begin(); _iter532 != this->group_names.end(); ++_iter532) { - xfer += oprot->writeString((*_iter518)); + xfer += oprot->writeString((*_iter532)); } xfer += oprot->writeListEnd(); } @@ -12746,10 +13062,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 _iter533; + for (_iter533 = (*(this->group_names)).begin(); _iter533 != (*(this->group_names)).end(); ++_iter533) { - xfer += oprot->writeString((*_iter519)); + xfer += oprot->writeString((*_iter533)); } xfer += oprot->writeListEnd(); } @@ -12905,9 +13221,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 ecast534; + xfer += iprot->readI32(ecast534); + this->principal_type = (PrincipalType::type)ecast534; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -12991,14 +13307,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 _size535; + ::apache::thrift::protocol::TType _etype538; + iprot->readListBegin(_etype538, _size535); + this->success.resize(_size535); + uint32_t _i539; + for (_i539 = 0; _i539 < _size535; ++_i539) { - xfer += this->success[_i525].read(iprot); + xfer += this->success[_i539].read(iprot); } iprot->readListEnd(); } @@ -13037,10 +13353,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 _iter540; + for (_iter540 = this->success.begin(); _iter540 != this->success.end(); ++_iter540) { - xfer += (*_iter526).write(oprot); + xfer += (*_iter540).write(oprot); } xfer += oprot->writeListEnd(); } @@ -13079,14 +13395,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 _size541; + ::apache::thrift::protocol::TType _etype544; + iprot->readListBegin(_etype544, _size541); + (*(this->success)).resize(_size541); + uint32_t _i545; + for (_i545 = 0; _i545 < _size541; ++_i545) { - xfer += (*(this->success))[_i531].read(iprot); + xfer += (*(this->success))[_i545].read(iprot); } iprot->readListEnd(); } @@ -15243,6 +15559,76 @@ return; } +void ThriftHiveMetastoreClient::rename_partition(const std::string& dbname, const std::string& name, const std::vector & part_vals, const std::vector & newpart_vals) +{ + send_rename_partition(dbname, name, part_vals, newpart_vals); + recv_rename_partition(); +} + +void ThriftHiveMetastoreClient::send_rename_partition(const std::string& dbname, const std::string& name, const std::vector & part_vals, const std::vector & newpart_vals) +{ + 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.newpart_vals = &newpart_vals; + 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 +19052,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.newpart_vals); + } 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 std::vector & newpart_vals) = 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 std::vector & /* newpart_vals */) { + 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), newpart_vals(false) {} + bool dbname; + bool name; + bool part_vals; + bool newpart_vals; +} _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; + std::vector newpart_vals; + + _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 (!(newpart_vals == rhs.newpart_vals)) + 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 std::vector * newpart_vals; + + 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 std::vector & newpart_vals); + void send_rename_partition(const std::string& dbname, const std::string& name, const std::vector & part_vals, const std::vector & newpart_vals); + 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 std::vector & newpart_vals) { + uint32_t sz = ifaces_.size(); + for (uint32_t i = 0; i < sz; ++i) { + ifaces_[i]->rename_partition(dbname, name, part_vals, newpart_vals); + } + } + 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 std::vector & newpart_vals) { + // 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, newpart_vals) + send_rename_partition(dbname, name, part_vals, newpart_vals) + recv_rename_partition() + end + + def send_rename_partition(dbname, name, part_vals, newpart_vals) + send_message('rename_partition', Rename_partition_args, :dbname => dbname, :name => name, :part_vals => part_vals, :newpart_vals => newpart_vals) + 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.newpart_vals) + 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 + NEWPART_VALS = 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}}, + NEWPART_VALS => {:type => ::Thrift::Types::LIST, :name => 'newpart_vals', :element => {:type => ::Thrift::Types::STRING}} + } + + 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, List newpart_vals) 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, List newpart_vals, 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, List newpart_vals) throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException, TException + { + send_rename_partition(dbname, name, part_vals, newpart_vals); + recv_rename_partition(); + } + + public void send_rename_partition(String dbname, String name, List part_vals, List newpart_vals) 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.setNewpart_vals(newpart_vals); + 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, List newpart_vals, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + rename_partition_call method_call = new rename_partition_call(dbname, name, part_vals, newpart_vals, 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 List newpart_vals; + public rename_partition_call(String dbname, String name, List part_vals, List newpart_vals, 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.newpart_vals = newpart_vals; + } + + 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.setNewpart_vals(newpart_vals); + 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.newpart_vals); + } 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,1164 @@ } + 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 NEWPART_VALS_FIELD_DESC = new TField("newpart_vals", TType.LIST, (short)4); + + private String dbname; + private String name; + private List part_vals; + private List newpart_vals; + + /** 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"), + NEWPART_VALS((short)4, "newpart_vals"); + + 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: // NEWPART_VALS + return NEWPART_VALS; + 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.NEWPART_VALS, new FieldMetaData("newpart_vals", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); + 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, + List newpart_vals) + { + this(); + this.dbname = dbname; + this.name = name; + this.part_vals = part_vals; + this.newpart_vals = newpart_vals; + } + + /** + * 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.isSetNewpart_vals()) { + List __this__newpart_vals = new ArrayList(); + for (String other_element : other.newpart_vals) { + __this__newpart_vals.add(other_element); + } + this.newpart_vals = __this__newpart_vals; + } + } + + 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.newpart_vals = 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 int getNewpart_valsSize() { + return (this.newpart_vals == null) ? 0 : this.newpart_vals.size(); + } + + public java.util.Iterator getNewpart_valsIterator() { + return (this.newpart_vals == null) ? null : this.newpart_vals.iterator(); + } + + public void addToNewpart_vals(String elem) { + if (this.newpart_vals == null) { + this.newpart_vals = new ArrayList(); + } + this.newpart_vals.add(elem); + } + + public List getNewpart_vals() { + return this.newpart_vals; + } + + public void setNewpart_vals(List newpart_vals) { + this.newpart_vals = newpart_vals; + } + + public void unsetNewpart_vals() { + this.newpart_vals = null; + } + + /** Returns true if field newpart_vals is set (has been asigned a value) and false otherwise */ + public boolean isSetNewpart_vals() { + return this.newpart_vals != null; + } + + public void setNewpart_valsIsSet(boolean value) { + if (!value) { + this.newpart_vals = 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 NEWPART_VALS: + if (value == null) { + unsetNewpart_vals(); + } else { + setNewpart_vals((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case DBNAME: + return getDbname(); + + case NAME: + return getName(); + + case PART_VALS: + return getPart_vals(); + + case NEWPART_VALS: + return getNewpart_vals(); + + } + 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 NEWPART_VALS: + return isSetNewpart_vals(); + } + 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_newpart_vals = true && this.isSetNewpart_vals(); + boolean that_present_newpart_vals = true && that.isSetNewpart_vals(); + if (this_present_newpart_vals || that_present_newpart_vals) { + if (!(this_present_newpart_vals && that_present_newpart_vals)) + return false; + if (!this.newpart_vals.equals(that.newpart_vals)) + 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(isSetNewpart_vals()).compareTo(typedOther.isSetNewpart_vals()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNewpart_vals()) { + lastComparison = TBaseHelper.compareTo(this.newpart_vals, typedOther.newpart_vals); + 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: // NEWPART_VALS + if (field.type == TType.LIST) { + { + TList _list138 = iprot.readListBegin(); + this.newpart_vals = new ArrayList(_list138.size); + for (int _i139 = 0; _i139 < _list138.size; ++_i139) + { + String _elem140; + _elem140 = iprot.readString(); + this.newpart_vals.add(_elem140); + } + iprot.readListEnd(); + } + } 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 _iter141 : this.part_vals) + { + oprot.writeString(_iter141); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (this.newpart_vals != null) { + oprot.writeFieldBegin(NEWPART_VALS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.newpart_vals.size())); + for (String _iter142 : this.newpart_vals) + { + oprot.writeString(_iter142); + } + oprot.writeListEnd(); + } + 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("newpart_vals:"); + if (this.newpart_vals == null) { + sb.append("null"); + } else { + sb.append(this.newpart_vals); + } + 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 +24949,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 _list143 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list143.size); + for (int _i144 = 0; _i144 < _list143.size; ++_i144) { - String _elem137; - _elem137 = iprot.readString(); - this.part_vals.add(_elem137); + String _elem145; + _elem145 = iprot.readString(); + this.part_vals.add(_elem145); } iprot.readListEnd(); } @@ -23695,9 +24990,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 _iter146 : this.part_vals) { - oprot.writeString(_iter138); + oprot.writeString(_iter146); } oprot.writeListEnd(); } @@ -25754,13 +27049,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 _list147 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list147.size); + for (int _i148 = 0; _i148 < _list147.size; ++_i148) { - String _elem141; - _elem141 = iprot.readString(); - this.part_vals.add(_elem141); + String _elem149; + _elem149 = iprot.readString(); + this.part_vals.add(_elem149); } iprot.readListEnd(); } @@ -25803,9 +27098,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 _iter150 : this.part_vals) { - oprot.writeString(_iter142); + oprot.writeString(_iter150); } oprot.writeListEnd(); } @@ -27706,13 +29001,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 _list151 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list151.size); + for (int _i152 = 0; _i152 < _list151.size; ++_i152) { - String _elem145; - _elem145 = iprot.readString(); - this.part_vals.add(_elem145); + String _elem153; + _elem153 = iprot.readString(); + this.part_vals.add(_elem153); } iprot.readListEnd(); } @@ -27747,9 +29042,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 _iter154 : this.part_vals) { - oprot.writeString(_iter146); + oprot.writeString(_iter154); } oprot.writeListEnd(); } @@ -28807,13 +30102,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 _list155 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list155.size); + for (int _i156 = 0; _i156 < _list155.size; ++_i156) { - String _elem149; - _elem149 = iprot.readString(); - this.part_vals.add(_elem149); + String _elem157; + _elem157 = iprot.readString(); + this.part_vals.add(_elem157); } iprot.readListEnd(); } @@ -28831,13 +30126,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 _list158 = iprot.readListBegin(); + this.group_names = new ArrayList(_list158.size); + for (int _i159 = 0; _i159 < _list158.size; ++_i159) { - String _elem152; - _elem152 = iprot.readString(); - this.group_names.add(_elem152); + String _elem160; + _elem160 = iprot.readString(); + this.group_names.add(_elem160); } iprot.readListEnd(); } @@ -28872,9 +30167,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 _iter161 : this.part_vals) { - oprot.writeString(_iter153); + oprot.writeString(_iter161); } oprot.writeListEnd(); } @@ -28889,9 +30184,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 _iter162 : this.group_names) { - oprot.writeString(_iter154); + oprot.writeString(_iter162); } oprot.writeListEnd(); } @@ -31157,14 +32452,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 _list163 = iprot.readListBegin(); + this.success = new ArrayList(_list163.size); + for (int _i164 = 0; _i164 < _list163.size; ++_i164) { - Partition _elem157; - _elem157 = new Partition(); - _elem157.read(iprot); - this.success.add(_elem157); + Partition _elem165; + _elem165 = new Partition(); + _elem165.read(iprot); + this.success.add(_elem165); } iprot.readListEnd(); } @@ -31204,9 +32499,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter158 : this.success) + for (Partition _iter166 : this.success) { - _iter158.write(oprot); + _iter166.write(oprot); } oprot.writeListEnd(); } @@ -31818,13 +33113,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 _list167 = iprot.readListBegin(); + this.group_names = new ArrayList(_list167.size); + for (int _i168 = 0; _i168 < _list167.size; ++_i168) { - String _elem161; - _elem161 = iprot.readString(); - this.group_names.add(_elem161); + String _elem169; + _elem169 = iprot.readString(); + this.group_names.add(_elem169); } iprot.readListEnd(); } @@ -31867,9 +33162,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 _iter170 : this.group_names) { - oprot.writeString(_iter162); + oprot.writeString(_iter170); } oprot.writeListEnd(); } @@ -32315,14 +33610,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 _list171 = iprot.readListBegin(); + this.success = new ArrayList(_list171.size); + for (int _i172 = 0; _i172 < _list171.size; ++_i172) { - Partition _elem165; - _elem165 = new Partition(); - _elem165.read(iprot); - this.success.add(_elem165); + Partition _elem173; + _elem173 = new Partition(); + _elem173.read(iprot); + this.success.add(_elem173); } iprot.readListEnd(); } @@ -32362,9 +33657,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter166 : this.success) + for (Partition _iter174 : this.success) { - _iter166.write(oprot); + _iter174.write(oprot); } oprot.writeListEnd(); } @@ -33192,13 +34487,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 _list175 = iprot.readListBegin(); + this.success = new ArrayList(_list175.size); + for (int _i176 = 0; _i176 < _list175.size; ++_i176) { - String _elem169; - _elem169 = iprot.readString(); - this.success.add(_elem169); + String _elem177; + _elem177 = iprot.readString(); + this.success.add(_elem177); } iprot.readListEnd(); } @@ -33230,9 +34525,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter170 : this.success) + for (String _iter178 : this.success) { - oprot.writeString(_iter170); + oprot.writeString(_iter178); } oprot.writeListEnd(); } @@ -33749,13 +35044,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 _list179 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list179.size); + for (int _i180 = 0; _i180 < _list179.size; ++_i180) { - String _elem173; - _elem173 = iprot.readString(); - this.part_vals.add(_elem173); + String _elem181; + _elem181 = iprot.readString(); + this.part_vals.add(_elem181); } iprot.readListEnd(); } @@ -33798,9 +35093,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 _iter182 : this.part_vals) { - oprot.writeString(_iter174); + oprot.writeString(_iter182); } oprot.writeListEnd(); } @@ -34173,14 +35468,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 _list183 = iprot.readListBegin(); + this.success = new ArrayList(_list183.size); + for (int _i184 = 0; _i184 < _list183.size; ++_i184) { - Partition _elem177; - _elem177 = new Partition(); - _elem177.read(iprot); - this.success.add(_elem177); + Partition _elem185; + _elem185 = new Partition(); + _elem185.read(iprot); + this.success.add(_elem185); } iprot.readListEnd(); } @@ -34212,9 +35507,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter178 : this.success) + for (Partition _iter186 : this.success) { - _iter178.write(oprot); + _iter186.write(oprot); } oprot.writeListEnd(); } @@ -34887,13 +36182,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 _list187 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list187.size); + for (int _i188 = 0; _i188 < _list187.size; ++_i188) { - String _elem181; - _elem181 = iprot.readString(); - this.part_vals.add(_elem181); + String _elem189; + _elem189 = iprot.readString(); + this.part_vals.add(_elem189); } iprot.readListEnd(); } @@ -34919,13 +36214,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 _list190 = iprot.readListBegin(); + this.group_names = new ArrayList(_list190.size); + for (int _i191 = 0; _i191 < _list190.size; ++_i191) { - String _elem184; - _elem184 = iprot.readString(); - this.group_names.add(_elem184); + String _elem192; + _elem192 = iprot.readString(); + this.group_names.add(_elem192); } iprot.readListEnd(); } @@ -34960,9 +36255,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 _iter193 : this.part_vals) { - oprot.writeString(_iter185); + oprot.writeString(_iter193); } oprot.writeListEnd(); } @@ -34980,9 +36275,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 _iter194 : this.group_names) { - oprot.writeString(_iter186); + oprot.writeString(_iter194); } oprot.writeListEnd(); } @@ -35436,14 +36731,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 _list195 = iprot.readListBegin(); + this.success = new ArrayList(_list195.size); + for (int _i196 = 0; _i196 < _list195.size; ++_i196) { - Partition _elem189; - _elem189 = new Partition(); - _elem189.read(iprot); - this.success.add(_elem189); + Partition _elem197; + _elem197 = new Partition(); + _elem197.read(iprot); + this.success.add(_elem197); } iprot.readListEnd(); } @@ -35483,9 +36778,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter190 : this.success) + for (Partition _iter198 : this.success) { - _iter190.write(oprot); + _iter198.write(oprot); } oprot.writeListEnd(); } @@ -36014,13 +37309,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 _list199 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list199.size); + for (int _i200 = 0; _i200 < _list199.size; ++_i200) { - String _elem193; - _elem193 = iprot.readString(); - this.part_vals.add(_elem193); + String _elem201; + _elem201 = iprot.readString(); + this.part_vals.add(_elem201); } iprot.readListEnd(); } @@ -36063,9 +37358,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 _iter202 : this.part_vals) { - oprot.writeString(_iter194); + oprot.writeString(_iter202); } oprot.writeListEnd(); } @@ -36438,13 +37733,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 _list203 = iprot.readListBegin(); + this.success = new ArrayList(_list203.size); + for (int _i204 = 0; _i204 < _list203.size; ++_i204) { - String _elem197; - _elem197 = iprot.readString(); - this.success.add(_elem197); + String _elem205; + _elem205 = iprot.readString(); + this.success.add(_elem205); } iprot.readListEnd(); } @@ -36476,9 +37771,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter198 : this.success) + for (String _iter206 : this.success) { - oprot.writeString(_iter198); + oprot.writeString(_iter206); } oprot.writeListEnd(); } @@ -37450,14 +38745,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 _list207 = iprot.readListBegin(); + this.success = new ArrayList(_list207.size); + for (int _i208 = 0; _i208 < _list207.size; ++_i208) { - Partition _elem201; - _elem201 = new Partition(); - _elem201.read(iprot); - this.success.add(_elem201); + Partition _elem209; + _elem209 = new Partition(); + _elem209.read(iprot); + this.success.add(_elem209); } iprot.readListEnd(); } @@ -37497,9 +38792,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter202 : this.success) + for (Partition _iter210 : this.success) { - _iter202.write(oprot); + _iter210.write(oprot); } oprot.writeListEnd(); } @@ -37955,13 +39250,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 _list211 = iprot.readListBegin(); + this.names = new ArrayList(_list211.size); + for (int _i212 = 0; _i212 < _list211.size; ++_i212) { - String _elem205; - _elem205 = iprot.readString(); - this.names.add(_elem205); + String _elem213; + _elem213 = iprot.readString(); + this.names.add(_elem213); } iprot.readListEnd(); } @@ -37996,9 +39291,9 @@ oprot.writeFieldBegin(NAMES_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.names.size())); - for (String _iter206 : this.names) + for (String _iter214 : this.names) { - oprot.writeString(_iter206); + oprot.writeString(_iter214); } oprot.writeListEnd(); } @@ -38432,14 +39727,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 _list215 = iprot.readListBegin(); + this.success = new ArrayList(_list215.size); + for (int _i216 = 0; _i216 < _list215.size; ++_i216) { - Partition _elem209; - _elem209 = new Partition(); - _elem209.read(iprot); - this.success.add(_elem209); + Partition _elem217; + _elem217 = new Partition(); + _elem217.read(iprot); + this.success.add(_elem217); } iprot.readListEnd(); } @@ -38479,9 +39774,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter210 : this.success) + for (Partition _iter218 : this.success) { - _iter210.write(oprot); + _iter218.write(oprot); } oprot.writeListEnd(); } @@ -40685,13 +41980,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 _list219 = iprot.readListBegin(); + this.success = new ArrayList(_list219.size); + for (int _i220 = 0; _i220 < _list219.size; ++_i220) { - String _elem213; - _elem213 = iprot.readString(); - this.success.add(_elem213); + String _elem221; + _elem221 = iprot.readString(); + this.success.add(_elem221); } iprot.readListEnd(); } @@ -40723,9 +42018,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter214 : this.success) + for (String _iter222 : this.success) { - oprot.writeString(_iter214); + oprot.writeString(_iter222); } oprot.writeListEnd(); } @@ -41370,15 +42665,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 _map223 = iprot.readMapBegin(); + this.success = new HashMap(2*_map223.size); + for (int _i224 = 0; _i224 < _map223.size; ++_i224) { - String _key217; - String _val218; - _key217 = iprot.readString(); - _val218 = iprot.readString(); - this.success.put(_key217, _val218); + String _key225; + String _val226; + _key225 = iprot.readString(); + _val226 = iprot.readString(); + this.success.put(_key225, _val226); } iprot.readMapEnd(); } @@ -41410,10 +42705,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 _iter227 : this.success.entrySet()) { - oprot.writeString(_iter219.getKey()); - oprot.writeString(_iter219.getValue()); + oprot.writeString(_iter227.getKey()); + oprot.writeString(_iter227.getValue()); } oprot.writeMapEnd(); } @@ -41942,15 +43237,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 _map228 = iprot.readMapBegin(); + this.part_vals = new HashMap(2*_map228.size); + for (int _i229 = 0; _i229 < _map228.size; ++_i229) { - String _key222; - String _val223; - _key222 = iprot.readString(); - _val223 = iprot.readString(); - this.part_vals.put(_key222, _val223); + String _key230; + String _val231; + _key230 = iprot.readString(); + _val231 = iprot.readString(); + this.part_vals.put(_key230, _val231); } iprot.readMapEnd(); } @@ -41992,10 +43287,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 _iter232 : this.part_vals.entrySet()) { - oprot.writeString(_iter224.getKey()); - oprot.writeString(_iter224.getValue()); + oprot.writeString(_iter232.getKey()); + oprot.writeString(_iter232.getValue()); } oprot.writeMapEnd(); } @@ -43259,15 +44554,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 _map233 = iprot.readMapBegin(); + this.part_vals = new HashMap(2*_map233.size); + for (int _i234 = 0; _i234 < _map233.size; ++_i234) { - String _key227; - String _val228; - _key227 = iprot.readString(); - _val228 = iprot.readString(); - this.part_vals.put(_key227, _val228); + String _key235; + String _val236; + _key235 = iprot.readString(); + _val236 = iprot.readString(); + this.part_vals.put(_key235, _val236); } iprot.readMapEnd(); } @@ -43309,10 +44604,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 _iter237 : this.part_vals.entrySet()) { - oprot.writeString(_iter229.getKey()); - oprot.writeString(_iter229.getValue()); + oprot.writeString(_iter237.getKey()); + oprot.writeString(_iter237.getValue()); } oprot.writeMapEnd(); } @@ -48738,14 +50033,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 _list238 = iprot.readListBegin(); + this.success = new ArrayList(_list238.size); + for (int _i239 = 0; _i239 < _list238.size; ++_i239) { - Index _elem232; - _elem232 = new Index(); - _elem232.read(iprot); - this.success.add(_elem232); + Index _elem240; + _elem240 = new Index(); + _elem240.read(iprot); + this.success.add(_elem240); } iprot.readListEnd(); } @@ -48785,9 +50080,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Index _iter233 : this.success) + for (Index _iter241 : this.success) { - _iter233.write(oprot); + _iter241.write(oprot); } oprot.writeListEnd(); } @@ -49615,13 +50910,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 _list242 = iprot.readListBegin(); + this.success = new ArrayList(_list242.size); + for (int _i243 = 0; _i243 < _list242.size; ++_i243) { - String _elem236; - _elem236 = iprot.readString(); - this.success.add(_elem236); + String _elem244; + _elem244 = iprot.readString(); + this.success.add(_elem244); } iprot.readListEnd(); } @@ -49653,9 +50948,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter237 : this.success) + for (String _iter245 : this.success) { - oprot.writeString(_iter237); + oprot.writeString(_iter245); } oprot.writeListEnd(); } @@ -51488,13 +52783,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 _list246 = iprot.readListBegin(); + this.success = new ArrayList(_list246.size); + for (int _i247 = 0; _i247 < _list246.size; ++_i247) { - String _elem240; - _elem240 = iprot.readString(); - this.success.add(_elem240); + String _elem248; + _elem248 = iprot.readString(); + this.success.add(_elem248); } iprot.readListEnd(); } @@ -51526,9 +52821,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter241 : this.success) + for (String _iter249 : this.success) { - oprot.writeString(_iter241); + oprot.writeString(_iter249); } oprot.writeListEnd(); } @@ -54204,14 +55499,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 _list250 = iprot.readListBegin(); + this.success = new ArrayList(_list250.size); + for (int _i251 = 0; _i251 < _list250.size; ++_i251) { - Role _elem244; - _elem244 = new Role(); - _elem244.read(iprot); - this.success.add(_elem244); + Role _elem252; + _elem252 = new Role(); + _elem252.read(iprot); + this.success.add(_elem252); } iprot.readListEnd(); } @@ -54243,9 +55538,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Role _iter245 : this.success) + for (Role _iter253 : this.success) { - _iter245.write(oprot); + _iter253.write(oprot); } oprot.writeListEnd(); } @@ -54690,13 +55985,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 _list254 = iprot.readListBegin(); + this.group_names = new ArrayList(_list254.size); + for (int _i255 = 0; _i255 < _list254.size; ++_i255) { - String _elem248; - _elem248 = iprot.readString(); - this.group_names.add(_elem248); + String _elem256; + _elem256 = iprot.readString(); + this.group_names.add(_elem256); } iprot.readListEnd(); } @@ -54731,9 +56026,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 _iter257 : this.group_names) { - oprot.writeString(_iter249); + oprot.writeString(_iter257); } oprot.writeListEnd(); } @@ -55932,14 +57227,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 _list258 = iprot.readListBegin(); + this.success = new ArrayList(_list258.size); + for (int _i259 = 0; _i259 < _list258.size; ++_i259) { - HiveObjectPrivilege _elem252; - _elem252 = new HiveObjectPrivilege(); - _elem252.read(iprot); - this.success.add(_elem252); + HiveObjectPrivilege _elem260; + _elem260 = new HiveObjectPrivilege(); + _elem260.read(iprot); + this.success.add(_elem260); } iprot.readListEnd(); } @@ -55971,9 +57266,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (HiveObjectPrivilege _iter253 : this.success) + for (HiveObjectPrivilege _iter261 : this.success) { - _iter253.write(oprot); + _iter261.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, $newpart_vals); 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, $newpart_vals) + { + $this->send_rename_partition($dbname, $name, $part_vals, $newpart_vals); + $this->recv_rename_partition(); + } + + public function send_rename_partition($dbname, $name, $part_vals, $newpart_vals) + { + $args = new metastore_ThriftHiveMetastore_rename_partition_args(); + $args->dbname = $dbname; + $args->name = $name; + $args->part_vals = $part_vals; + $args->newpart_vals = $newpart_vals; + $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,330 @@ } +class metastore_ThriftHiveMetastore_rename_partition_args { + static $_TSPEC; + + public $dbname = null; + public $name = null; + public $part_vals = null; + public $newpart_vals = 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' => 'newpart_vals', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + ); + } + 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['newpart_vals'])) { + $this->newpart_vals = $vals['newpart_vals']; + } + } + } + + 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::LST) { + $this->newpart_vals = array(); + $_size245 = 0; + $_etype248 = 0; + $xfer += $input->readListBegin($_etype248, $_size245); + for ($_i249 = 0; $_i249 < $_size245; ++$_i249) + { + $elem250 = null; + $xfer += $input->readString($elem250); + $this->newpart_vals []= $elem250; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_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 $iter251) + { + $xfer += $output->writeString($iter251); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->newpart_vals !== null) { + if (!is_array($this->newpart_vals)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('newpart_vals', TType::LST, 4); + { + $output->writeListBegin(TType::STRING, count($this->newpart_vals)); + { + foreach ($this->newpart_vals as $iter252) + { + $xfer += $output->writeString($iter252); + } + } + $output->writeListEnd(); + } + $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 +8254,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) + $_size253 = 0; + $_etype256 = 0; + $xfer += $input->readListBegin($_etype256, $_size253); + for ($_i257 = 0; $_i257 < $_size253; ++$_i257) { - $elem244 = null; - $xfer += $input->readString($elem244); - $this->part_vals []= $elem244; + $elem258 = null; + $xfer += $input->readString($elem258); + $this->part_vals []= $elem258; } $xfer += $input->readListEnd(); } else { @@ -7911,9 +8299,9 @@ { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter245) + foreach ($this->part_vals as $iter259) { - $xfer += $output->writeString($iter245); + $xfer += $output->writeString($iter259); } } $output->writeListEnd(); @@ -8410,14 +8798,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) + $_size260 = 0; + $_etype263 = 0; + $xfer += $input->readListBegin($_etype263, $_size260); + for ($_i264 = 0; $_i264 < $_size260; ++$_i264) { - $elem251 = null; - $xfer += $input->readString($elem251); - $this->part_vals []= $elem251; + $elem265 = null; + $xfer += $input->readString($elem265); + $this->part_vals []= $elem265; } $xfer += $input->readListEnd(); } else { @@ -8462,9 +8850,9 @@ { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter252) + foreach ($this->part_vals as $iter266) { - $xfer += $output->writeString($iter252); + $xfer += $output->writeString($iter266); } } $output->writeListEnd(); @@ -8924,14 +9312,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) + $_size267 = 0; + $_etype270 = 0; + $xfer += $input->readListBegin($_etype270, $_size267); + for ($_i271 = 0; $_i271 < $_size267; ++$_i271) { - $elem258 = null; - $xfer += $input->readString($elem258); - $this->part_vals []= $elem258; + $elem272 = null; + $xfer += $input->readString($elem272); + $this->part_vals []= $elem272; } $xfer += $input->readListEnd(); } else { @@ -8969,9 +9357,9 @@ { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter259) + foreach ($this->part_vals as $iter273) { - $xfer += $output->writeString($iter259); + $xfer += $output->writeString($iter273); } } $output->writeListEnd(); @@ -9203,14 +9591,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) + $_size274 = 0; + $_etype277 = 0; + $xfer += $input->readListBegin($_etype277, $_size274); + for ($_i278 = 0; $_i278 < $_size274; ++$_i278) { - $elem265 = null; - $xfer += $input->readString($elem265); - $this->part_vals []= $elem265; + $elem279 = null; + $xfer += $input->readString($elem279); + $this->part_vals []= $elem279; } $xfer += $input->readListEnd(); } else { @@ -9227,14 +9615,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) + $_size280 = 0; + $_etype283 = 0; + $xfer += $input->readListBegin($_etype283, $_size280); + for ($_i284 = 0; $_i284 < $_size280; ++$_i284) { - $elem271 = null; - $xfer += $input->readString($elem271); - $this->group_names []= $elem271; + $elem285 = null; + $xfer += $input->readString($elem285); + $this->group_names []= $elem285; } $xfer += $input->readListEnd(); } else { @@ -9272,9 +9660,9 @@ { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter272) + foreach ($this->part_vals as $iter286) { - $xfer += $output->writeString($iter272); + $xfer += $output->writeString($iter286); } } $output->writeListEnd(); @@ -9294,9 +9682,9 @@ { $output->writeListBegin(TType::STRING, count($this->group_names)); { - foreach ($this->group_names as $iter273) + foreach ($this->group_names as $iter287) { - $xfer += $output->writeString($iter273); + $xfer += $output->writeString($iter287); } } $output->writeListEnd(); @@ -9842,15 +10230,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) + $_size288 = 0; + $_etype291 = 0; + $xfer += $input->readListBegin($_etype291, $_size288); + for ($_i292 = 0; $_i292 < $_size288; ++$_i292) { - $elem279 = null; - $elem279 = new metastore_Partition(); - $xfer += $elem279->read($input); - $this->success []= $elem279; + $elem293 = null; + $elem293 = new metastore_Partition(); + $xfer += $elem293->read($input); + $this->success []= $elem293; } $xfer += $input->readListEnd(); } else { @@ -9894,9 +10282,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter280) + foreach ($this->success as $iter294) { - $xfer += $iter280->write($output); + $xfer += $iter294->write($output); } } $output->writeListEnd(); @@ -10027,14 +10415,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) + $_size295 = 0; + $_etype298 = 0; + $xfer += $input->readListBegin($_etype298, $_size295); + for ($_i299 = 0; $_i299 < $_size295; ++$_i299) { - $elem286 = null; - $xfer += $input->readString($elem286); - $this->group_names []= $elem286; + $elem300 = null; + $xfer += $input->readString($elem300); + $this->group_names []= $elem300; } $xfer += $input->readListEnd(); } else { @@ -10082,9 +10470,9 @@ { $output->writeListBegin(TType::STRING, count($this->group_names)); { - foreach ($this->group_names as $iter287) + foreach ($this->group_names as $iter301) { - $xfer += $output->writeString($iter287); + $xfer += $output->writeString($iter301); } } $output->writeListEnd(); @@ -10164,15 +10552,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) + $_size302 = 0; + $_etype305 = 0; + $xfer += $input->readListBegin($_etype305, $_size302); + for ($_i306 = 0; $_i306 < $_size302; ++$_i306) { - $elem293 = null; - $elem293 = new metastore_Partition(); - $xfer += $elem293->read($input); - $this->success []= $elem293; + $elem307 = null; + $elem307 = new metastore_Partition(); + $xfer += $elem307->read($input); + $this->success []= $elem307; } $xfer += $input->readListEnd(); } else { @@ -10216,9 +10604,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter294) + foreach ($this->success as $iter308) { - $xfer += $iter294->write($output); + $xfer += $iter308->write($output); } } $output->writeListEnd(); @@ -10410,14 +10798,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) + $_size309 = 0; + $_etype312 = 0; + $xfer += $input->readListBegin($_etype312, $_size309); + for ($_i313 = 0; $_i313 < $_size309; ++$_i313) { - $elem300 = null; - $xfer += $input->readString($elem300); - $this->success []= $elem300; + $elem314 = null; + $xfer += $input->readString($elem314); + $this->success []= $elem314; } $xfer += $input->readListEnd(); } else { @@ -10453,9 +10841,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter301) + foreach ($this->success as $iter315) { - $xfer += $output->writeString($iter301); + $xfer += $output->writeString($iter315); } } $output->writeListEnd(); @@ -10559,14 +10947,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) + $_size316 = 0; + $_etype319 = 0; + $xfer += $input->readListBegin($_etype319, $_size316); + for ($_i320 = 0; $_i320 < $_size316; ++$_i320) { - $elem307 = null; - $xfer += $input->readString($elem307); - $this->part_vals []= $elem307; + $elem321 = null; + $xfer += $input->readString($elem321); + $this->part_vals []= $elem321; } $xfer += $input->readListEnd(); } else { @@ -10611,9 +10999,9 @@ { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter308) + foreach ($this->part_vals as $iter322) { - $xfer += $output->writeString($iter308); + $xfer += $output->writeString($iter322); } } $output->writeListEnd(); @@ -10689,15 +11077,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) + $_size323 = 0; + $_etype326 = 0; + $xfer += $input->readListBegin($_etype326, $_size323); + for ($_i327 = 0; $_i327 < $_size323; ++$_i327) { - $elem314 = null; - $elem314 = new metastore_Partition(); - $xfer += $elem314->read($input); - $this->success []= $elem314; + $elem328 = null; + $elem328 = new metastore_Partition(); + $xfer += $elem328->read($input); + $this->success []= $elem328; } $xfer += $input->readListEnd(); } else { @@ -10733,9 +11121,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter315) + foreach ($this->success as $iter329) { - $xfer += $iter315->write($output); + $xfer += $iter329->write($output); } } $output->writeListEnd(); @@ -10859,14 +11247,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) + $_size330 = 0; + $_etype333 = 0; + $xfer += $input->readListBegin($_etype333, $_size330); + for ($_i334 = 0; $_i334 < $_size330; ++$_i334) { - $elem321 = null; - $xfer += $input->readString($elem321); - $this->part_vals []= $elem321; + $elem335 = null; + $xfer += $input->readString($elem335); + $this->part_vals []= $elem335; } $xfer += $input->readListEnd(); } else { @@ -10890,14 +11278,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) + $_size336 = 0; + $_etype339 = 0; + $xfer += $input->readListBegin($_etype339, $_size336); + for ($_i340 = 0; $_i340 < $_size336; ++$_i340) { - $elem327 = null; - $xfer += $input->readString($elem327); - $this->group_names []= $elem327; + $elem341 = null; + $xfer += $input->readString($elem341); + $this->group_names []= $elem341; } $xfer += $input->readListEnd(); } else { @@ -10935,9 +11323,9 @@ { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter328) + foreach ($this->part_vals as $iter342) { - $xfer += $output->writeString($iter328); + $xfer += $output->writeString($iter342); } } $output->writeListEnd(); @@ -10962,9 +11350,9 @@ { $output->writeListBegin(TType::STRING, count($this->group_names)); { - foreach ($this->group_names as $iter329) + foreach ($this->group_names as $iter343) { - $xfer += $output->writeString($iter329); + $xfer += $output->writeString($iter343); } } $output->writeListEnd(); @@ -11044,15 +11432,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) + $_size344 = 0; + $_etype347 = 0; + $xfer += $input->readListBegin($_etype347, $_size344); + for ($_i348 = 0; $_i348 < $_size344; ++$_i348) { - $elem335 = null; - $elem335 = new metastore_Partition(); - $xfer += $elem335->read($input); - $this->success []= $elem335; + $elem349 = null; + $elem349 = new metastore_Partition(); + $xfer += $elem349->read($input); + $this->success []= $elem349; } $xfer += $input->readListEnd(); } else { @@ -11096,9 +11484,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter336) + foreach ($this->success as $iter350) { - $xfer += $iter336->write($output); + $xfer += $iter350->write($output); } } $output->writeListEnd(); @@ -11207,14 +11595,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) + $_size351 = 0; + $_etype354 = 0; + $xfer += $input->readListBegin($_etype354, $_size351); + for ($_i355 = 0; $_i355 < $_size351; ++$_i355) { - $elem342 = null; - $xfer += $input->readString($elem342); - $this->part_vals []= $elem342; + $elem356 = null; + $xfer += $input->readString($elem356); + $this->part_vals []= $elem356; } $xfer += $input->readListEnd(); } else { @@ -11259,9 +11647,9 @@ { $output->writeListBegin(TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $iter343) + foreach ($this->part_vals as $iter357) { - $xfer += $output->writeString($iter343); + $xfer += $output->writeString($iter357); } } $output->writeListEnd(); @@ -11336,14 +11724,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) + $_size358 = 0; + $_etype361 = 0; + $xfer += $input->readListBegin($_etype361, $_size358); + for ($_i362 = 0; $_i362 < $_size358; ++$_i362) { - $elem349 = null; - $xfer += $input->readString($elem349); - $this->success []= $elem349; + $elem363 = null; + $xfer += $input->readString($elem363); + $this->success []= $elem363; } $xfer += $input->readListEnd(); } else { @@ -11379,9 +11767,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter350) + foreach ($this->success as $iter364) { - $xfer += $output->writeString($iter350); + $xfer += $output->writeString($iter364); } } $output->writeListEnd(); @@ -11598,15 +11986,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) + $_size365 = 0; + $_etype368 = 0; + $xfer += $input->readListBegin($_etype368, $_size365); + for ($_i369 = 0; $_i369 < $_size365; ++$_i369) { - $elem356 = null; - $elem356 = new metastore_Partition(); - $xfer += $elem356->read($input); - $this->success []= $elem356; + $elem370 = null; + $elem370 = new metastore_Partition(); + $xfer += $elem370->read($input); + $this->success []= $elem370; } $xfer += $input->readListEnd(); } else { @@ -11650,9 +12038,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter357) + foreach ($this->success as $iter371) { - $xfer += $iter357->write($output); + $xfer += $iter371->write($output); } } $output->writeListEnd(); @@ -11753,14 +12141,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) + $_size372 = 0; + $_etype375 = 0; + $xfer += $input->readListBegin($_etype375, $_size372); + for ($_i376 = 0; $_i376 < $_size372; ++$_i376) { - $elem363 = null; - $xfer += $input->readString($elem363); - $this->names []= $elem363; + $elem377 = null; + $xfer += $input->readString($elem377); + $this->names []= $elem377; } $xfer += $input->readListEnd(); } else { @@ -11798,9 +12186,9 @@ { $output->writeListBegin(TType::STRING, count($this->names)); { - foreach ($this->names as $iter364) + foreach ($this->names as $iter378) { - $xfer += $output->writeString($iter364); + $xfer += $output->writeString($iter378); } } $output->writeListEnd(); @@ -11880,15 +12268,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) + $_size379 = 0; + $_etype382 = 0; + $xfer += $input->readListBegin($_etype382, $_size379); + for ($_i383 = 0; $_i383 < $_size379; ++$_i383) { - $elem370 = null; - $elem370 = new metastore_Partition(); - $xfer += $elem370->read($input); - $this->success []= $elem370; + $elem384 = null; + $elem384 = new metastore_Partition(); + $xfer += $elem384->read($input); + $this->success []= $elem384; } $xfer += $input->readListEnd(); } else { @@ -11932,9 +12320,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter371) + foreach ($this->success as $iter385) { - $xfer += $iter371->write($output); + $xfer += $iter385->write($output); } } $output->writeListEnd(); @@ -12485,14 +12873,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) + $_size386 = 0; + $_etype389 = 0; + $xfer += $input->readListBegin($_etype389, $_size386); + for ($_i390 = 0; $_i390 < $_size386; ++$_i390) { - $elem377 = null; - $xfer += $input->readString($elem377); - $this->success []= $elem377; + $elem391 = null; + $xfer += $input->readString($elem391); + $this->success []= $elem391; } $xfer += $input->readListEnd(); } else { @@ -12528,9 +12916,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter378) + foreach ($this->success as $iter392) { - $xfer += $output->writeString($iter378); + $xfer += $output->writeString($iter392); } } $output->writeListEnd(); @@ -12681,17 +13069,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) + $_size393 = 0; + $_ktype394 = 0; + $_vtype395 = 0; + $xfer += $input->readMapBegin($_ktype394, $_vtype395, $_size393); + for ($_i397 = 0; $_i397 < $_size393; ++$_i397) { - $key384 = ''; - $val385 = ''; - $xfer += $input->readString($key384); - $xfer += $input->readString($val385); - $this->success[$key384] = $val385; + $key398 = ''; + $val399 = ''; + $xfer += $input->readString($key398); + $xfer += $input->readString($val399); + $this->success[$key398] = $val399; } $xfer += $input->readMapEnd(); } else { @@ -12727,10 +13115,10 @@ { $output->writeMapBegin(TType::STRING, TType::STRING, count($this->success)); { - foreach ($this->success as $kiter386 => $viter387) + foreach ($this->success as $kiter400 => $viter401) { - $xfer += $output->writeString($kiter386); - $xfer += $output->writeString($viter387); + $xfer += $output->writeString($kiter400); + $xfer += $output->writeString($viter401); } } $output->writeMapEnd(); @@ -12838,17 +13226,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) + $_size402 = 0; + $_ktype403 = 0; + $_vtype404 = 0; + $xfer += $input->readMapBegin($_ktype403, $_vtype404, $_size402); + for ($_i406 = 0; $_i406 < $_size402; ++$_i406) { - $key393 = ''; - $val394 = ''; - $xfer += $input->readString($key393); - $xfer += $input->readString($val394); - $this->part_vals[$key393] = $val394; + $key407 = ''; + $val408 = ''; + $xfer += $input->readString($key407); + $xfer += $input->readString($val408); + $this->part_vals[$key407] = $val408; } $xfer += $input->readMapEnd(); } else { @@ -12893,10 +13281,10 @@ { $output->writeMapBegin(TType::STRING, TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $kiter395 => $viter396) + foreach ($this->part_vals as $kiter409 => $viter410) { - $xfer += $output->writeString($kiter395); - $xfer += $output->writeString($viter396); + $xfer += $output->writeString($kiter409); + $xfer += $output->writeString($viter410); } } $output->writeMapEnd(); @@ -13188,17 +13576,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) + $_size411 = 0; + $_ktype412 = 0; + $_vtype413 = 0; + $xfer += $input->readMapBegin($_ktype412, $_vtype413, $_size411); + for ($_i415 = 0; $_i415 < $_size411; ++$_i415) { - $key402 = ''; - $val403 = ''; - $xfer += $input->readString($key402); - $xfer += $input->readString($val403); - $this->part_vals[$key402] = $val403; + $key416 = ''; + $val417 = ''; + $xfer += $input->readString($key416); + $xfer += $input->readString($val417); + $this->part_vals[$key416] = $val417; } $xfer += $input->readMapEnd(); } else { @@ -13243,10 +13631,10 @@ { $output->writeMapBegin(TType::STRING, TType::STRING, count($this->part_vals)); { - foreach ($this->part_vals as $kiter404 => $viter405) + foreach ($this->part_vals as $kiter418 => $viter419) { - $xfer += $output->writeString($kiter404); - $xfer += $output->writeString($viter405); + $xfer += $output->writeString($kiter418); + $xfer += $output->writeString($viter419); } } $output->writeMapEnd(); @@ -14606,15 +14994,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) + $_size420 = 0; + $_etype423 = 0; + $xfer += $input->readListBegin($_etype423, $_size420); + for ($_i424 = 0; $_i424 < $_size420; ++$_i424) { - $elem411 = null; - $elem411 = new metastore_Index(); - $xfer += $elem411->read($input); - $this->success []= $elem411; + $elem425 = null; + $elem425 = new metastore_Index(); + $xfer += $elem425->read($input); + $this->success []= $elem425; } $xfer += $input->readListEnd(); } else { @@ -14658,9 +15046,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter412) + foreach ($this->success as $iter426) { - $xfer += $iter412->write($output); + $xfer += $iter426->write($output); } } $output->writeListEnd(); @@ -14852,14 +15240,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) + $_size427 = 0; + $_etype430 = 0; + $xfer += $input->readListBegin($_etype430, $_size427); + for ($_i431 = 0; $_i431 < $_size427; ++$_i431) { - $elem418 = null; - $xfer += $input->readString($elem418); - $this->success []= $elem418; + $elem432 = null; + $xfer += $input->readString($elem432); + $this->success []= $elem432; } $xfer += $input->readListEnd(); } else { @@ -14895,9 +15283,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter419) + foreach ($this->success as $iter433) { - $xfer += $output->writeString($iter419); + $xfer += $output->writeString($iter433); } } $output->writeListEnd(); @@ -15359,14 +15747,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) + $_size434 = 0; + $_etype437 = 0; + $xfer += $input->readListBegin($_etype437, $_size434); + for ($_i438 = 0; $_i438 < $_size434; ++$_i438) { - $elem425 = null; - $xfer += $input->readString($elem425); - $this->success []= $elem425; + $elem439 = null; + $xfer += $input->readString($elem439); + $this->success []= $elem439; } $xfer += $input->readListEnd(); } else { @@ -15402,9 +15790,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter426) + foreach ($this->success as $iter440) { - $xfer += $output->writeString($iter426); + $xfer += $output->writeString($iter440); } } $output->writeListEnd(); @@ -16044,15 +16432,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) + $_size441 = 0; + $_etype444 = 0; + $xfer += $input->readListBegin($_etype444, $_size441); + for ($_i445 = 0; $_i445 < $_size441; ++$_i445) { - $elem432 = null; - $elem432 = new metastore_Role(); - $xfer += $elem432->read($input); - $this->success []= $elem432; + $elem446 = null; + $elem446 = new metastore_Role(); + $xfer += $elem446->read($input); + $this->success []= $elem446; } $xfer += $input->readListEnd(); } else { @@ -16088,9 +16476,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter433) + foreach ($this->success as $iter447) { - $xfer += $iter433->write($output); + $xfer += $iter447->write($output); } } $output->writeListEnd(); @@ -16188,14 +16576,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) + $_size448 = 0; + $_etype451 = 0; + $xfer += $input->readListBegin($_etype451, $_size448); + for ($_i452 = 0; $_i452 < $_size448; ++$_i452) { - $elem439 = null; - $xfer += $input->readString($elem439); - $this->group_names []= $elem439; + $elem453 = null; + $xfer += $input->readString($elem453); + $this->group_names []= $elem453; } $xfer += $input->readListEnd(); } else { @@ -16236,9 +16624,9 @@ { $output->writeListBegin(TType::STRING, count($this->group_names)); { - foreach ($this->group_names as $iter440) + foreach ($this->group_names as $iter454) { - $xfer += $output->writeString($iter440); + $xfer += $output->writeString($iter454); } } $output->writeListEnd(); @@ -16525,15 +16913,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) + $_size455 = 0; + $_etype458 = 0; + $xfer += $input->readListBegin($_etype458, $_size455); + for ($_i459 = 0; $_i459 < $_size455; ++$_i459) { - $elem446 = null; - $elem446 = new metastore_HiveObjectPrivilege(); - $xfer += $elem446->read($input); - $this->success []= $elem446; + $elem460 = null; + $elem460 = new metastore_HiveObjectPrivilege(); + $xfer += $elem460->read($input); + $this->success []= $elem460; } $xfer += $input->readListEnd(); } else { @@ -16569,9 +16957,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter447) + foreach ($this->success as $iter461) { - $xfer += $iter447->write($output); + $xfer += $iter461->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:list newpart_vals) + 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,65 @@ } } + /** + * Rename a old partition to new partition + * + * @param tbl + * existing table + * @param oldPartSpec + * spec of old partition + * @param newPartSpec + * spec of new partition + * @throws InvalidOperationException + * if the changes in metadata is not acceptable + * @throws TException + */ + public void renamePartition(Table tbl, Map oldPartSpec, Map newPartSpec) + throws HiveException { + try { + 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(); + List newpvals = new ArrayList(); + for (FieldSchema field : tbl.getPartCols()) { + String val = oldPartSpec.get(field.getName()); + 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); + } + String newval = newPartSpec.get(field.getName()); + if (newval == null && !HiveConf.getBoolVar(conf, HiveConf.ConfVars.DYNAMICPARTITIONING) + || newval.length() == 0) { + throw new HiveException("get partition: Value for key " + + field.getName() + " is null or empty"); + } else if (newval != null){ + newpvals.add(newval); + } + } + getMSC().renamePartition(tbl.getDbName(), tbl.getTableName(), pvals, + newpvals); + + } 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,32 @@ } /** + * 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); + + db.renamePartition(tbl, renamePartitionDesc.getOldPartSpec(), renamePartitionDesc.getNewPartSpec()); + + 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 +1489,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.DROP}, new Privilege[]{Privilege.CREATE}), 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,136 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hive.ql.plan; + +import java.io.Serializable; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Contains the information needed to rename a partition. + */ +public class RenamePartitionDesc extends DDLDesc implements Serializable { + + private static final long serialVersionUID = 1L; + + String tableName; + String dbName; + String location; + LinkedHashMap oldPartSpec; + LinkedHashMap newPartSpec; + + /** + * 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; + } +} 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,32 @@ 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)); + } + else { + throw new SemanticException(ErrorMsg.INVALID_TABLE.getMsg(tblName)); + } + } 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));