public PartitionWithoutSD deepCopy() { return new PartitionWithoutSD(this); }
/** * Performs a deep copy on <i>other</i>. */ public PartitionSpecWithSharedSD(PartitionSpecWithSharedSD other) { if (other.isSetPartitions()) { List<PartitionWithoutSD> __this__partitions = new ArrayList<PartitionWithoutSD>(other.partitions.size()); for (PartitionWithoutSD other_element : other.partitions) { __this__partitions.add(new PartitionWithoutSD(other_element)); } this.partitions = __this__partitions; } if (other.isSetSd()) { this.sd = new StorageDescriptor(other.sd); } }
for (int _i262 = 0; _i262 < _list260.size; ++_i262) _elem261 = new PartitionWithoutSD(); _elem261.read(iprot); struct.partitions.add(_elem261);
@Override public void read(org.apache.thrift.protocol.TProtocol prot, PartitionSpecWithSharedSD struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list265 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.partitions = new ArrayList<PartitionWithoutSD>(_list265.size); PartitionWithoutSD _elem266; for (int _i267 = 0; _i267 < _list265.size; ++_i267) { _elem266 = new PartitionWithoutSD(); _elem266.read(iprot); struct.partitions.add(_elem266); } } struct.setPartitionsIsSet(true); } if (incoming.get(1)) { struct.sd = new StorageDescriptor(); struct.sd.read(iprot); struct.setSdIsSet(true); } } }
private PartitionWithoutSD buildPartitionWithoutSD(List<String> values, int index) throws MetaException { PartitionWithoutSD partition = new PartitionWithoutSD(); partition.setCreateTime(DEFAULT_CREATE_TIME); partition.setLastAccessTime(DEFAULT_CREATE_TIME); partition.setValues(values); Map<String, String> parameters = new HashMap<>(); parameters.put(DEFAULT_PARAM_KEY + index, DEFAULT_PARAM_VALUE + index); partition.setParameters(parameters); partition.setRelativePath("partwithoutsd" + index); return partition; }
= new PartitionWithoutSD(); partitionWithoutSD.setValues(partition.getValues()); partitionWithoutSD.setCreateTime(partition.getCreateTime());
@Test public void testAddPartitionSpecWithSharedSDEmptyValue() throws Exception { Table table = createTable(); PartitionWithoutSD partition = new PartitionWithoutSD(); partition.setRelativePath("addpartspectest"); partition.setValues(Lists.newArrayList("")); String location = table.getSd().getLocation() + "/nullValueTest/"; PartitionSpecProxy partitionSpecProxy = buildPartitionSpecWithSharedSD(Lists.newArrayList(partition), buildSD(location)); client.add_partitions_pspec(partitionSpecProxy); List<String> partitionNames = client.listPartitionNames(DB_NAME, TABLE_NAME, MAX); Assert.assertNotNull(partitionNames); Assert.assertTrue(partitionNames.size() == 1); Assert.assertEquals("year=__HIVE_DEFAULT_PARTITION__", partitionNames.get(0)); }
@Test(expected=MetaException.class) public void testAddPartitionSpecWithSharedSDNoValue() throws Exception { Table table = createTable(); PartitionWithoutSD partition = new PartitionWithoutSD(); partition.setRelativePath("addpartspectest"); String location = table.getSd().getLocation() + "/nullValueTest/"; PartitionSpecProxy partitionSpecProxy = buildPartitionSpecWithSharedSD(Lists.newArrayList(partition), buildSD(location)); client.add_partitions_pspec(partitionSpecProxy); }
public PartitionWithoutSD deepCopy() { return new PartitionWithoutSD(this); }
public PartitionWithoutSD deepCopy() { return new PartitionWithoutSD(this); }
/** * Performs a deep copy on <i>other</i>. */ public PartitionSpecWithSharedSD(PartitionSpecWithSharedSD other) { if (other.isSetPartitions()) { List<PartitionWithoutSD> __this__partitions = new ArrayList<PartitionWithoutSD>(other.partitions.size()); for (PartitionWithoutSD other_element : other.partitions) { __this__partitions.add(new PartitionWithoutSD(other_element)); } this.partitions = __this__partitions; } if (other.isSetSd()) { this.sd = new StorageDescriptor(other.sd); } }
/** * Performs a deep copy on <i>other</i>. */ public PartitionSpecWithSharedSD(PartitionSpecWithSharedSD other) { if (other.isSetPartitions()) { List<PartitionWithoutSD> __this__partitions = new ArrayList<PartitionWithoutSD>(); for (PartitionWithoutSD other_element : other.partitions) { __this__partitions.add(new PartitionWithoutSD(other_element)); } this.partitions = __this__partitions; } if (other.isSetSd()) { this.sd = new StorageDescriptor(other.sd); } }
/** * Performs a deep copy on <i>other</i>. */ public PartitionSpecWithSharedSD(PartitionSpecWithSharedSD other) { if (other.isSetPartitions()) { List<PartitionWithoutSD> __this__partitions = new ArrayList<PartitionWithoutSD>(); for (PartitionWithoutSD other_element : other.partitions) { __this__partitions.add(new PartitionWithoutSD(other_element)); } this.partitions = __this__partitions; } if (other.isSetSd()) { this.sd = new StorageDescriptor(other.sd); } }
_elem246 = new PartitionWithoutSD(); _elem246.read(iprot); struct.partitions.add(_elem246);
_elem246 = new PartitionWithoutSD(); _elem246.read(iprot); struct.partitions.add(_elem246);
for (int _i254 = 0; _i254 < _list252.size; ++_i254) _elem253 = new PartitionWithoutSD(); _elem253.read(iprot); struct.partitions.add(_elem253);
@Override public void read(org.apache.thrift.protocol.TProtocol prot, PartitionSpecWithSharedSD struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list257 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.partitions = new ArrayList<PartitionWithoutSD>(_list257.size); PartitionWithoutSD _elem258; for (int _i259 = 0; _i259 < _list257.size; ++_i259) { _elem258 = new PartitionWithoutSD(); _elem258.read(iprot); struct.partitions.add(_elem258); } } struct.setPartitionsIsSet(true); } if (incoming.get(1)) { struct.sd = new StorageDescriptor(); struct.sd.read(iprot); struct.setSdIsSet(true); } } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, PartitionSpecWithSharedSD struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list249 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.partitions = new ArrayList<PartitionWithoutSD>(_list249.size); for (int _i250 = 0; _i250 < _list249.size; ++_i250) { PartitionWithoutSD _elem251; // optional _elem251 = new PartitionWithoutSD(); _elem251.read(iprot); struct.partitions.add(_elem251); } } struct.setPartitionsIsSet(true); } if (incoming.get(1)) { struct.sd = new StorageDescriptor(); struct.sd.read(iprot); struct.setSdIsSet(true); } } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, PartitionSpecWithSharedSD struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list249 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.partitions = new ArrayList<PartitionWithoutSD>(_list249.size); for (int _i250 = 0; _i250 < _list249.size; ++_i250) { PartitionWithoutSD _elem251; // optional _elem251 = new PartitionWithoutSD(); _elem251.read(iprot); struct.partitions.add(_elem251); } } struct.setPartitionsIsSet(true); } if (incoming.get(1)) { struct.sd = new StorageDescriptor(); struct.sd.read(iprot); struct.setSdIsSet(true); } } }
= new PartitionWithoutSD( partition.getValues(), partition.getCreateTime(), partition.getLastAccessTime(),