hive-protolib/src/main/java/com/streamsets/pipeline/stage/processor/hive/HiveMetadataProcessor.java
@VisibleForTesting
  Record generateNewPartitionRecord(
      String database,
      String tableName,
      LinkedHashMap<String, String> partitionList,
      String location,
      boolean customLocation,
      Map<String, String> metadataHeaderAttributes) throws StageException {

    //creating a record with uuid as postfix so multiple SDCs won't generate the record with same id.
    Record metadataRecord = getContext().createRecord("Partition Metadata Record" + UUID.randomUUID().toString());
    Field metadataField = HiveMetastoreUtil.newPartitionMetadataFieldBuilder(
        database,
        tableName,
        partitionList,
        location,
        customLocation,
        dataFormat
    );
    metadataRecord.set(metadataField);

    for (Map.Entry<String, String> entry : metadataHeaderAttributes.entrySet()){
      metadataRecord.getHeader().setAttribute(entry.getKey(), entry.getValue());
    }

    return metadataRecord;
  }
@VisibleForTesting
  Record generateNewPartitionRecord(
      String database,
      String tableName,
      LinkedHashMap<String, String> partitionList,
      String location,
      boolean customLocation,
      Map<String, String> metadataHeaderAttributes) throws StageException {

    //creating a record with uuid as postfix so multiple SDCs won't generate the record with same id.
    Record metadataRecord = getContext().createRecord("Partition Metadata Record" + UUID.randomUUID().toString());
    Field metadataField = HiveMetastoreUtil.newPartitionMetadataFieldBuilder(
        database,
        tableName,
        partitionList,
        location,
        customLocation,
        dataFormat
    );
    metadataRecord.set(metadataField);

    for (Map.Entry<String, String> entry : metadataHeaderAttributes.entrySet()){
      metadataRecord.getHeader().setAttribute(entry.getKey(), entry.getValue());
    }

    return metadataRecord;
  }
@ VisibleForTesting Record generateNewPartitionRecord ( String database , String tableName , LinkedHashMap < String , String > partitionList , String location , boolean customLocation , Map < String , String > metadataHeaderAttributes ) throws StageException { //creating a record with uuid as postfix so multiple SDCs won't generate the record with same id. Record metadataRecord = getContext ( ) . createRecord ( "Partition Metadata Record" + UUID . randomUUID ( ) . toString ( ) ) ; Field metadataField = HiveMetastoreUtil . newPartitionMetadataFieldBuilder ( database , tableName , partitionList , location , customLocation , dataFormat ) ; metadataRecord . set ( metadataField ) ; for ( Map . Entry < String , String > entry : metadataHeaderAttributes . entrySet ( ) ) { metadataRecord . getHeader ( ) . setAttribute ( entry . getKey ( ) , entry . getValue ( ) ) ; } return metadataRecord ; }
Generate a record for new partition. It creates a new Record and fill in metadata.
@param database database name
@param tableName table name
@param partitionList New partition to be created
@param location Directory path in Hadoop filesystem for the new partition.
@param customLocation Whether the {@code location} is a custom path or the default path defined by Hive.
@return New metadata record
@throws StageException
Generate a record for new partition . It creates a new Record and fill in metadata .