@Override public String getLocation() { return pSpec.getSd().getLocation() + pSpec.getPartitions().get(index).getRelativePath(); }
public Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); case CREATE_TIME: return getCreateTime(); case LAST_ACCESS_TIME: return getLastAccessTime(); case RELATIVE_PATH: return getRelativePath(); case PARAMETERS: return getParameters(); case PRIVILEGES: return getPrivileges(); } throw new IllegalStateException(); }
private void verifyLocations(List<Partition> origPartitions, StorageDescriptor sharedSD, List<PartitionWithoutSD> partitionWithoutSDS) { int i=0; for (Partition origPart : origPartitions) { // in case of location sharedSD has the base location and partition has relative location Assert.assertEquals("Location does not match", origPart.getSd().getLocation(), sharedSD.getLocation() + partitionWithoutSDS.get(i).getRelativePath()); Assert.assertNull("values were not requested but are still set", partitionWithoutSDS.get(i).getValues()); Assert.assertNull("Parameters were not requested but are still set", partitionWithoutSDS.get(i).getParameters()); i++; } }
sharedSD.getLocation() + partitionWithoutSDS.get(partitionWithoutSDSIndex).getRelativePath()); } else { Assert.assertEquals(PropertyUtils.getNestedProperty(origPart, projectField),
@Override public Partition getCurrent() { PartitionWithoutSD partWithoutSD = pSpec.getPartitions().get(index); StorageDescriptor partSD = new StorageDescriptor(pSpec.getSd()); partSD.setLocation(partSD.getLocation() + partWithoutSD.getRelativePath()); Partition p = new Partition( partWithoutSD.getValues(), partitionSpecWithSharedSDProxy.partitionSpec.getDbName(), partitionSpecWithSharedSDProxy.partitionSpec.getTableName(), partWithoutSD.getCreateTime(), partWithoutSD.getLastAccessTime(), partSD, partWithoutSD.getParameters() ); p.setCatName(partitionSpecWithSharedSDProxy.partitionSpec.getCatName()); return p; }
private void validateBasic(GetPartitionsResponse response) throws TException { Assert.assertNotNull("Response is null", response); Assert.assertNotNull("Returned partition spec is null", response.getPartitionSpec()); Assert.assertEquals(1, response.getPartitionSpecSize()); PartitionSpecWithSharedSD partitionSpecWithSharedSD = response.getPartitionSpec().get(0).getSharedSDPartitionSpec(); Assert.assertNotNull(partitionSpecWithSharedSD.getSd()); StorageDescriptor sharedSD = partitionSpecWithSharedSD.getSd(); Assert.assertEquals("Root location should be set to table location", tbl.getSd().getLocation(), sharedSD.getLocation()); List<PartitionWithoutSD> partitionWithoutSDS = partitionSpecWithSharedSD.getPartitions(); Assert.assertEquals(origPartitions.size(), partitionWithoutSDS.size()); for (int i = 0; i < origPartitions.size(); i++) { Partition origPartition = origPartitions.get(i); PartitionWithoutSD returnedPartitionWithoutSD = partitionWithoutSDS.get(i); Assert.assertEquals(String.format("Location returned for Partition %d is not correct", i), origPartition.getSd().getLocation(), sharedSD.getLocation() + returnedPartitionWithoutSD.getRelativePath()); } }
assertThat(partitions.size(), is(1)); PartitionWithoutSD partition = partitions.get(0); assertThat(partition.getRelativePath(), is((String)null)); assertThat(partition.getValues(), is(Collections.singletonList("val1")));
assertThat(partitions.size(), is(1)); PartitionWithoutSD partition = partitions.get(0); assertThat(partition.getRelativePath(), is("/bar")); assertThat(partition.getValues(), is(Collections.singletonList("val1")));
assertThat(partitions1.size(), is(1)); PartitionWithoutSD partition1 = partitions1.get(0); assertThat(partition1.getRelativePath(), is((String)null)); assertThat(partition1.getValues(), is(Collections.singletonList("val3"))); PartitionWithoutSD partition2_1 = partitions2.get(0); PartitionWithoutSD partition2_2 = partitions2.get(1); if (partition2_1.getRelativePath().equals("baz")) { partition2_2 = tmp; assertThat(partition2_1.getRelativePath(), is("/bar")); assertThat(partition2_1.getValues(), is(Collections.singletonList("val1"))); assertThat(partition2_2.getRelativePath(), is("/baz")); assertThat(partition2_2.getValues(), is(Collections.singletonList("val4")));
Assert.assertEquals(origPartition.getLastAccessTime(), retPartition.getLastAccessTime()); Assert.assertEquals(origPartition.getSd().getLocation(), sharedSD.getLocation() + retPartition.getRelativePath()); validateMap(origPartition.getParameters(), retPartition.getParameters()); validateList(origPartition.getValues(), retPartition.getValues());
Assert.assertEquals(String.format("Location returned for Partition %d is not correct", i), origPartition.getSd().getLocation(), sharedSD.getLocation() + returnedPartitionWithoutSD.getRelativePath()); Assert.assertTrue("createTime was request but is not set", returnedPartitionWithoutSD.isSetCreateTime());
@Override public String getLocation() { return pSpec.getSd().getLocation() + pSpec.getPartitions().get(index).getRelativePath(); }
@Override public String getLocation() { return pSpec.getSd().getLocation() + pSpec.getPartitions().get(index).getRelativePath(); }
public Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); case CREATE_TIME: return Integer.valueOf(getCreateTime()); case LAST_ACCESS_TIME: return Integer.valueOf(getLastAccessTime()); case RELATIVE_PATH: return getRelativePath(); case PARAMETERS: return getParameters(); case PRIVILEGES: return getPrivileges(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); case CREATE_TIME: return Integer.valueOf(getCreateTime()); case LAST_ACCESS_TIME: return Integer.valueOf(getLastAccessTime()); case RELATIVE_PATH: return getRelativePath(); case PARAMETERS: return getParameters(); case PRIVILEGES: return getPrivileges(); } throw new IllegalStateException(); }
@Override public Partition getCurrent() { PartitionWithoutSD partWithoutSD = pSpec.getPartitions().get(index); StorageDescriptor partSD = new StorageDescriptor(pSpec.getSd()); partSD.setLocation(partSD.getLocation() + partWithoutSD.getRelativePath()); return new Partition( partWithoutSD.getValues(), partitionSpecWithSharedSDProxy.partitionSpec.getDbName(), partitionSpecWithSharedSDProxy.partitionSpec.getTableName(), partWithoutSD.getCreateTime(), partWithoutSD.getLastAccessTime(), partSD, partWithoutSD.getParameters() ); }
@Override public Partition getCurrent() { PartitionWithoutSD partWithoutSD = pSpec.getPartitions().get(index); StorageDescriptor partSD = new StorageDescriptor(pSpec.getSd()); partSD.setLocation(partSD.getLocation() + partWithoutSD.getRelativePath()); return new Partition( partWithoutSD.getValues(), partitionSpecWithSharedSDProxy.partitionSpec.getDbName(), partitionSpecWithSharedSDProxy.partitionSpec.getTableName(), partWithoutSD.getCreateTime(), partWithoutSD.getLastAccessTime(), partSD, partWithoutSD.getParameters() ); }