Source:
<code>public void prepareRun(BatchSinkContext context) throws IOException { config.validate(); Job job = JobUtils.createInstance(); Configuration hConf = job.getConfiguration(); hConf.set(FileOutputFormat.OUTDIR, config.getOutputDir(context.getLogicalStartTime())); for (Map.Entry<String, String> entry : config.getFSProperties().entrySet()) { hConf.set(entry.getKey(), entry.getValue()); } Schema schema = config.getSchema(); if (schema == null) { schema = context.getInputSchema(); } if ("text".equals(config.format)) { context.addOutput(Output.of(config.referenceName, new SinkOutputFormatProvider(TextOutputFormat.class, hConf))); } else if ("avro".equals(config.format)) { if (schema == null) { throw new IllegalStateException("Cannot write using avro format when schema is unknown. " <START> + "Please set the schema explicitly."); <END> } org.apache.avro.Schema avroSchema = new org.apache.avro.Schema.Parser().parse(schema.toString()); AvroJob.setOutputKeySchema(job, avroSchema); context.addOutput(Output.of(config.referenceName, new SinkOutputFormatProvider(AvroKeyOutputFormat.class, hConf))); } else if ("parquet".equals(config.format)) { if (schema == null) { throw new IllegalStateException("Cannot write using parquet format when schema is unknown. " + "Please set the schema explicitly."); } org.apache.avro.Schema avroSchema = new org.apache.avro.Schema.Parser().parse(schema.toString()); AvroParquetOutputFormat.setSchema(job, avroSchema); context.addOutput(Output.of(config.referenceName, new SinkOutputFormatProvider(AvroParquetOutputFormat.class, hConf))); } }</code><technical_language>checks part of validate config ? non-macro</technical_language>

Target:
public void prepareRun(BatchSinkContext context) throws IOException { config.validate(context.getInputSchema()); Job job = JobUtils.createInstance(); Configuration hConf = job.getConfiguration(); hConf.set(FileOutputFormat.OUTDIR, config.getOutputDir(context.getLogicalStartTime())); for (Map.Entry<String, String> entry : config.getFSProperties().entrySet()) { hConf.set(entry.getKey(), entry.getValue()); } Schema schema = config.getSchema(context.getInputSchema()); if ("text".equals(config.format)) { context.addOutput(Output.of(config.referenceName, new SinkOutputFormatProvider(TextOutputFormat.class, hConf))); } else if ("avro".equals(config.format)) { if (schema == null) { throw new IllegalStateException("Cannot write using avro format when schema is unknown. " + "Please set the schema explicitly."); } org.apache.avro.Schema avroSchema = new org.apache.avro.Schema.Parser().parse(schema.toString()); AvroJob.setOutputKeySchema(job, avroSchema); context.addOutput(Output.of(config.referenceName, new SinkOutputFormatProvider(AvroKeyOutputFormat.class, hConf))); } else if ("parquet".equals(config.format)) { if (schema == null) { throw new IllegalStateException("Cannot write using parquet format when schema is unknown. " + "Please set the schema explicitly."); } org.apache.avro.Schema avroSchema = new org.apache.avro.Schema.Parser().parse(schema.toString()); AvroParquetOutputFormat.setSchema(job, avroSchema); context.addOutput(Output.of(config.referenceName, new SinkOutputFormatProvider(AvroParquetOutputFormat.class, hConf))); } }