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(); }
PartitionWithoutSD retPartition = partitionSpecWithSharedSD.getPartitions().get(i); Assert.assertEquals(2, retPartition.getValuesSize()); validateList(expectedVals.get(i), retPartition.getValues()); Assert.assertNull("parameters were not requested so should have been null", retPartition.getParameters());
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++; } }
@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; }
PartitionWithoutSD partition = partitions.get(0); assertThat(partition.getRelativePath(), is("/bar")); assertThat(partition.getValues(), is(Collections.singletonList("val1")));
PartitionWithoutSD partition = partitions.get(0); assertThat(partition.getRelativePath(), is((String)null)); assertThat(partition.getValues(), is(Collections.singletonList("val1")));
PartitionWithoutSD partition1 = partitions1.get(0); assertThat(partition1.getRelativePath(), is((String)null)); assertThat(partition1.getValues(), is(Collections.singletonList("val3"))); assertThat(partition2_1.getValues(), is(Collections.singletonList("val1"))); assertThat(partition2_2.getRelativePath(), is("/baz")); assertThat(partition2_2.getValues(), is(Collections.singletonList("val4")));
sharedSD.getLocation() + retPartition.getRelativePath()); validateMap(origPartition.getParameters(), retPartition.getParameters()); validateList(origPartition.getValues(), retPartition.getValues());
returnedPartitionWithoutSD.getParameters().containsKey("excludeKey2")); List<String> returnedVals = returnedPartitionWithoutSD.getValues(); List<String> actualVals = origPartition.getValues(); for (int j = 0; j < actualVals.size(); j++) {
switch (projectedField) { case "values": validateList(origPartition.getValues(), retPartition.getValues()); break; case "parameters":
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() ); }