use of co.cask.cdap.etl.api.MultiInputStageConfigurer in project cdap by caskdata.
the class MockJoiner method configurePipeline.
@Override
public void configurePipeline(MultiInputPipelineConfigurer pipelineConfigurer) {
MultiInputStageConfigurer stageConfigurer = pipelineConfigurer.getMultiInputStageConfigurer();
Map<String, Schema> inputSchemas = stageConfigurer.getInputSchemas();
stageConfigurer.setOutputSchema(getOutputSchema(inputSchemas));
config.validateConfig();
}
use of co.cask.cdap.etl.api.MultiInputStageConfigurer in project cdap by caskdata.
the class DupeFlagger method configurePipeline.
@Override
public void configurePipeline(MultiInputPipelineConfigurer pipelineConfigurer) {
MultiInputStageConfigurer stageConfigurer = pipelineConfigurer.getMultiInputStageConfigurer();
Map<String, Schema> inputSchemas = stageConfigurer.getInputSchemas();
if (inputSchemas.size() != 2) {
throw new IllegalArgumentException(String.format("The DupeFlagger plugin must have exactly two inputs with the same schema, but found %d inputs.", inputSchemas.size()));
}
Iterator<Schema> schemaIterator = inputSchemas.values().iterator();
Schema schema1 = schemaIterator.next();
Schema schema2 = schemaIterator.next();
if (!schema1.equals(schema2)) {
throw new IllegalArgumentException("The DupeFlagger plugin must have exactly two inputs with the same schema, " + "but the schemas are not the same.");
}
if (!config.containsMacro("keep")) {
if (!inputSchemas.keySet().contains(config.keep)) {
throw new IllegalArgumentException(config.keep + " is not an input.");
}
}
if (!config.containsMacro("flagField")) {
stageConfigurer.setOutputSchema(getOutputSchema(schema1));
}
}
Aggregations