hive-protolib/src/main/java/com/streamsets/pipeline/stage/processor/hive/HiveMetadataProcessor.java
private Map<PartitionInfoCacheSupport.PartitionValues, String> detectNewPartition(
      PartitionInfoCacheSupport.PartitionValues partitionValues,
      PartitionInfoCacheSupport.PartitionInfo pCache,
      String location
  ) throws StageException{
    Map<PartitionInfoCacheSupport.PartitionValues, String> partitionInfoDiff = new HashMap<>();
    partitionInfoDiff.put(partitionValues, location);

    partitionInfoDiff
        = (pCache != null)? pCache.getDiff(partitionInfoDiff) : partitionInfoDiff;
    if (pCache == null || !partitionInfoDiff.isEmpty()){
      return partitionInfoDiff;
    }
    return null;
  }
private Map<PartitionInfoCacheSupport.PartitionValues, String> detectNewPartition(
      PartitionInfoCacheSupport.PartitionValues partitionValues,
      PartitionInfoCacheSupport.PartitionInfo pCache,
      String location
  ) throws StageException{
    Map<PartitionInfoCacheSupport.PartitionValues, String> partitionInfoDiff = new HashMap<>();
    partitionInfoDiff.put(partitionValues, location);

    partitionInfoDiff
        = (pCache != null)? pCache.getDiff(partitionInfoDiff) : partitionInfoDiff;
    if (pCache == null || !partitionInfoDiff.isEmpty()){
      return partitionInfoDiff;
    }
    return null;
  }
Using partition name and value that were obtained from record, compare them
with cached partition.
@param partitionValues Partition representation
@param pCache  Cache that has existing partitions
@return Diff of partitions if new partition is detected. Otherwise null.
@throws StageException