private void addPropsForPublisher ( QueryBasedHiveConversionEntity hiveConversionEntity ) { if ( ! hiveConversionEntity . getPartition ( ) . isPresent ( ) ) { return ; } ConvertibleHiveDataset convertibleHiveDataset = hiveConversionEntity . getConvertibleHiveDataset ( ) ; for ( String format : convertibleHiveDataset . getDestFormats ( ) ) { Optional < ConvertibleHiveDataset . ConversionConfig > conversionConfigForFormat = convertibleHiveDataset . getConversionConfigForFormat ( format ) ; if ( ! conversionConfigForFormat . isPresent ( ) ) { continue ; } SchemaAwareHivePartition sourcePartition = hiveConversionEntity . getHivePartition ( ) . get ( ) ; // Get complete source partition name dbName@tableName@partitionName String completeSourcePartitionName = StringUtils . join ( Arrays . asList ( sourcePartition . getTable ( ) . getDbName ( ) , sourcePartition . getTable ( ) . getTableName ( ) , sourcePartition . getName ( ) ) , AT_CHAR ) ; ConvertibleHiveDataset . ConversionConfig config = conversionConfigForFormat . get ( ) ; // Get complete destination partition name dbName@tableName@partitionName String completeDestPartitionName = StringUtils . join ( Arrays . asList ( config . getDestinationDbName ( ) , config . getDestinationTableName ( ) , sourcePartition . getName ( ) ) , AT_CHAR ) ; workUnit . setProp ( HiveConvertPublisher . COMPLETE_SOURCE_PARTITION_NAME , completeSourcePartitionName ) ; workUnit . setProp ( HiveConvertPublisher . COMPLETE_DEST_PARTITION_NAME , completeDestPartitionName ) ; } }
Method to add properties needed by publisher to preserve partition params