@SuppressWarnings("unchecked") public T compareParameters() { if (!this.result) { checkExistingIsSuperstate(this.existingUnit.getProps(), this.newUnit.getProps()); checkExistingIsSuperstate(this.existingUnit.getStorageProps(), this.newUnit.getStorageProps()); checkExistingIsSuperstate(this.existingUnit.getSerDeProps(), this.newUnit.getSerDeProps()); } return (T) this; }
/** * Compare an existing state and a new {@link State} to ensure that the existing {@link State} contains all entries in the new * {@link State}, and update {@link #result} accordingly. */ protected void checkExistingIsSuperstate(State existingState, State newState) { checkExistingIsSuperset(existingState.getProperties().entrySet(), newState.getProperties().entrySet()); }
@SuppressWarnings("unchecked") public T compareIsCompressed() { if (!this.result) { compare(this.existingUnit.getIsCompressed(), this.newUnit.getIsCompressed()); } return (T) this; }
/** * Compare all parameters. */ @SuppressWarnings("unchecked") public T compareAll() { this.compareInputFormat().compareOutputFormat().compareIsCompressed().compareIsStoredAsSubDirs().compareNumBuckets() .compareBucketCols().compareRawLocation().compareParameters(); return (T) this; }
protected boolean needToUpdateTable(HiveTable existingTable, HiveTable newTable) { return getTableComparator(existingTable, newTable).compareAll().result(); }
new HiveRegistrationUnitComparator<>(null, null); comparator.checkExistingIsSuperstate(existingState, newState); Assert.assertFalse(comparator.result); new HiveRegistrationUnitComparator<>(null, null); comparator.checkExistingIsSuperstate(existingState, newState); Assert.assertTrue(comparator.result); new HiveRegistrationUnitComparator<>(null, null); comparator.checkExistingIsSuperstate(existingState, newState); Assert.assertTrue(comparator.result); existingState.setProp(key2, value2); comparator = new HiveRegistrationUnitComparator<>(null, null); comparator.checkExistingIsSuperstate(existingState, newState); Assert.assertFalse(comparator.result);
@SuppressWarnings("unchecked") @Override public T compareAll() { super.compareAll().compareValues(); return (T) this; }
/** * Compare all parameters. */ @SuppressWarnings("unchecked") public T compareAll() { this.compareInputFormat().compareOutputFormat().compareIsCompressed().compareIsStoredAsSubDirs().compareNumBuckets() .compareBucketCols().compareRawLocation().compareParameters(); return (T) this; }
protected boolean needToUpdatePartition(HivePartition existingPartition, HivePartition newPartition) { return getPartitionComparator(existingPartition, newPartition).compareAll().result(); }
@SuppressWarnings("unchecked") @Override public T compareAll() { super.compareAll().compareOwner().compareRetention(); return (T) this; } }
protected boolean needToUpdateTable(HiveTable existingTable, HiveTable newTable) { return getTableComparator(existingTable, newTable).compareAll().result(); }
@SuppressWarnings("unchecked") public T compareBucketCols() { if (!this.result) { compare(this.existingUnit.getBucketColumns(), this.newUnit.getBucketColumns()); } return (T) this; }
@SuppressWarnings("unchecked") public T compareParameters() { if (!this.result) { checkExistingIsSuperstate(this.existingUnit.getProps(), this.newUnit.getProps()); checkExistingIsSuperstate(this.existingUnit.getStorageProps(), this.newUnit.getStorageProps()); checkExistingIsSuperstate(this.existingUnit.getSerDeProps(), this.newUnit.getSerDeProps()); } return (T) this; }
@SuppressWarnings("unchecked") @Override public T compareAll() { super.compareAll().compareValues(); return (T) this; }
/** * Compare an existing state and a new {@link State} to ensure that the existing {@link State} contains all entries in the new * {@link State}, and update {@link #result} accordingly. */ protected void checkExistingIsSuperstate(State existingState, State newState) { checkExistingIsSuperset(existingState.getProperties().entrySet(), newState.getProperties().entrySet()); }
protected boolean needToUpdatePartition(HivePartition existingPartition, HivePartition newPartition) { return getPartitionComparator(existingPartition, newPartition).compareAll().result(); }
@SuppressWarnings("unchecked") public T compareOutputFormat() { if (!this.result) { compare(this.existingUnit.getOutputFormat(), this.newUnit.getOutputFormat()); } return (T) this; }
@SuppressWarnings("unchecked") @Override public T compareAll() { super.compareAll().compareOwner().compareRetention(); return (T) this; } }
@SuppressWarnings("unchecked") public T compareIsStoredAsSubDirs() { if (!this.result) { compare(this.existingUnit.getIsStoredAsSubDirs(), this.newUnit.getIsStoredAsSubDirs()); } return (T) this; }
@SuppressWarnings("unchecked") public T compareInputFormat() { if (!this.result) { compare(this.existingUnit.getInputFormat(), this.newUnit.getInputFormat()); } return (T) this; }