@Test public void testSchemaValidation() { CSVFormatter.Config config = new CSVFormatter.Config("DELIMITED", "VBAR", OUTPUT.toString()); Transform<StructuredRecord, StructuredRecord> transform = new CSVFormatter(config); MockPipelineConfigurer mockPipelineConfigurer = new MockPipelineConfigurer(INPUT1); transform.configurePipeline(mockPipelineConfigurer); Assert.assertEquals(OUTPUT, mockPipelineConfigurer.getOutputSchema()); }
@Override public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); config.validate(collector); Schema schema = config.getSchema(collector); pipelineConfigurer.getStageConfigurer().setOutputSchema(schema); }
CSVFormatter extends Transform<StructuredRecord, StructuredRecord> { @Override public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); config.validate(collector); Schema schema = config.getSchema(collector); pipelineConfigurer.getStageConfigurer().setOutputSchema(schema); } }
CSVFormatter extends Transform<StructuredRecord, StructuredRecord> { @Override public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); config.validate(collector); Schema schema = config.getSchema(collector); pipelineConfigurer.getStageConfigurer().setOutputSchema(schema); } CSVFormatter(Config config); }
CSVFormatter extends Transform<StructuredRecord, StructuredRecord> { @Override public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); config.validate(collector); Schema schema = config.getSchema(collector); pipelineConfigurer.getStageConfigurer().setOutputSchema(schema); } CSVFormatter(Config config); @Override void configurePipeline(PipelineConfigurer pipelineConfigurer); @Override void prepareRun(StageSubmitterContext context); @Override void initialize(TransformContext context); @Override void transform(StructuredRecord record, Emitter<StructuredRecord> emitter); }
CSVFormatter extends Transform<StructuredRecord, StructuredRecord> { @Override public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); config.validate(collector); Schema schema = config.getSchema(collector); pipelineConfigurer.getStageConfigurer().setOutputSchema(schema); } CSVFormatter(Config config); @Override void configurePipeline(PipelineConfigurer pipelineConfigurer); @Override void prepareRun(StageSubmitterContext context); @Override void initialize(TransformContext context); @Override void transform(StructuredRecord record, Emitter<StructuredRecord> emitter);  }