if (input.getExistingTargetPartition() == null) { throw new RuntimeException("Existing target partition has not been computed! This is an error in the code."); if (PathUtils.isGlob(input.getPartition().getDataLocation())) { log.error(String.format("%s cannot be applied to globbed location %s. Will not skip.", this.getClass().getSimpleName(), input.getPartition().getDataLocation())); return false; if (!input.getExistingTargetPartition().isPresent()) { if (!input.getExistingTargetPartition().get().getParameters().containsKey(HiveDataset.REGISTRATION_GENERATION_TIME_MILLIS)) { input.getExistingTargetPartition().get().getParameters().get(HiveDataset.REGISTRATION_GENERATION_TIME_MILLIS)); getFileStatus(this.helper.getDataset().getFs(), input.getPartition().getDataLocation()); throw new RuntimeException(String.format("Source path %s does not exist!", input.getPartition().getDataLocation())); HiveDataset.REGISTRATION_GENERATION_TIME_MILLIS, input.getPartition().getCompleteName())); return false; } catch (IOException ioe) {
private FileSet<CopyEntity> fileSetForPartition(final Partition partition) { return new HivePartitionFileSet(HiveCopyEntityHelper.this, partition, HiveCopyEntityHelper.this.dataset.getProperties()); } }
Path targetPath = hiveCopyEntityHelper.getTargetLocation(hiveCopyEntityHelper.getDataset().fs, hiveCopyEntityHelper.getTargetFs(), this.partition.getDataLocation(), Optional.of(this.partition)); Partition targetPartition = getTargetPartition(this.partition, targetPath); hiveCopyEntityHelper.getTargetPartitions().remove(this.partition.getValues()); try { checkPartitionCompatibility(targetPartition, this.existingTargetPartition.get()); } catch (IOException ioe) { if (hiveCopyEntityHelper.getExistingEntityPolicy() != HiveCopyEntityHelper.ExistingEntityPolicy.REPLACE_PARTITIONS &&
pc.getExistingTargetPartition().get().getParameters().clear(); Assert.assertFalse(predicate.apply(pc));
Path targetPath = hiveCopyEntityHelper.getTargetLocation(hiveCopyEntityHelper.getDataset().fs, hiveCopyEntityHelper.getTargetFs(), this.partition.getDataLocation(), Optional.of(this.partition)); Partition targetPartition = getTargetPartition(this.partition, targetPath); hiveCopyEntityHelper.getTargetPartitions().remove(this.partition.getValues()); try { checkPartitionCompatibility(targetPartition, this.existingTargetPartition.get()); } catch (IOException ioe) { if (hiveCopyEntityHelper.getExistingEntityPolicy() != HiveCopyEntityHelper.ExistingEntityPolicy.REPLACE_PARTITIONS &&
if (!input.getExistingTargetPartition().isPresent()) { return false; if (PathUtils.isGlob(input.getPartition().getDataLocation())) { log.error(String.format("%s cannot be applied to globbed location %s. Will not skip.", this.getClass().getSimpleName(), input.getPartition().getDataLocation())); return false; input.getPartition().getDataLocation(), this.helper.getTargetFs(), Optional.of(input.getPartition()), false)); .getFileStatus(this.helper.getDataset().getFs(), input.getPartition().getDataLocation()); String.format("Source path %s does not exist!", input.getPartition().getDataLocation()));
private FileSet<CopyEntity> fileSetForPartition(final Partition partition) { return new HivePartitionFileSet(HiveCopyEntityHelper.this, partition, HiveCopyEntityHelper.this.dataset.getProperties()); } }
public HivePartitionFileSet createPartitionCopy(Path location, long registrationGenerationTime, boolean targetPartitionExists) { HivePartitionFileSet partitionCopy = Mockito.mock(HivePartitionFileSet.class); Partition partition = Mockito.mock(Partition.class); Mockito.doReturn(location).when(partition).getDataLocation(); Mockito.doReturn(partition).when(partitionCopy).getPartition(); if (targetPartitionExists) { Partition targetPartition = Mockito.mock(Partition.class); Map<String, String> parameters = Maps.newHashMap(); parameters.put(HiveDataset.REGISTRATION_GENERATION_TIME_MILLIS, Long.toString(registrationGenerationTime)); Mockito.doReturn(parameters).when(targetPartition).getParameters(); Mockito.doReturn(Optional.of(targetPartition)).when(partitionCopy).getExistingTargetPartition(); } else { Mockito.doReturn(Optional.absent()).when(partitionCopy).getExistingTargetPartition(); } return partitionCopy; }
if (input.getExistingTargetPartition() == null) { throw new RuntimeException("Existing target partition has not been computed! This is an error in the code."); if (PathUtils.isGlob(input.getPartition().getDataLocation())) { log.error(String.format("%s cannot be applied to globbed location %s. Will not skip.", this.getClass().getSimpleName(), input.getPartition().getDataLocation())); return false; if (!input.getExistingTargetPartition().isPresent()) { if (!input.getExistingTargetPartition().get().getParameters().containsKey(HiveDataset.REGISTRATION_GENERATION_TIME_MILLIS)) { input.getExistingTargetPartition().get().getParameters().get(HiveDataset.REGISTRATION_GENERATION_TIME_MILLIS)); getFileStatus(this.helper.getDataset().getFs(), input.getPartition().getDataLocation()); throw new RuntimeException(String.format("Source path %s does not exist!", input.getPartition().getDataLocation())); HiveDataset.REGISTRATION_GENERATION_TIME_MILLIS, input.getPartition().getCompleteName())); return false; } catch (IOException ioe) {
if (!input.getExistingTargetPartition().isPresent()) { return false; if (PathUtils.isGlob(input.getPartition().getDataLocation())) { log.error(String.format("%s cannot be applied to globbed location %s. Will not skip.", this.getClass().getSimpleName(), input.getPartition().getDataLocation())); return false; input.getPartition().getDataLocation(), this.helper.getTargetFs(), Optional.of(input.getPartition()), false)); .getFileStatus(this.helper.getDataset().getFs(), input.getPartition().getDataLocation()); String.format("Source path %s does not exist!", input.getPartition().getDataLocation()));