Source:
public void prepareRun(BatchSinkContext context) throws Exception { FailureCollector collector = context.getFailureCollector(); config.validate(collector); FileFormat fileFormat = config.getFormat(); ValidatingOutputFormat validatingOutputFormat; try { validatingOutputFormat = context.newPluginInstance(fileFormat.name().toLowerCase()); } catch (InvalidPluginConfigException e) { LOG.error("Failed to create config for plugin missing properties: invalid properties: {}", fileFormat.name(), e.getMissingProperties(), e.getInvalidProperties()); throw e; } FormatContext formatContext = new FormatContext(collector, context.getInputSchema()); validateOutputFormatProvider(formatContext, fileFormat, validatingOutputFormat); collector.getOrThrowException(); Schema schema = config.getSchema(); if (schema == null) { schema = context.getInputSchema(); } LineageRecorder lineageRecorder = new LineageRecorder(context, config.getReferenceName()); lineageRecorder.createExternalDataset(schema); if (schema != null && schema.getFields() != null && !schema.getFields().isEmpty()) { recordLineage(lineageRecorder, schema.getFields().stream().map(Schema.Field::getName).collect(Collectors.toList())); } Map<String, String> outputProperties = new HashMap<>(validatingOutputFormat.getOutputFormatConfiguration()); outputProperties.putAll(getFileSystemProperties(context)); outputProperties.put(FileOutputFormat.OUTDIR, getOutputDir(context.getLogicalStartTime())); context.addOutput(Output.of(config.getReferenceName(), new SinkOutputFormatProvider(validatingOutputFormat.getOutputFormatClassName(), outputProperties))); }

Target:
public void prepareRun(BatchSinkContext context) throws Exception { FailureCollector collector = context.getFailureCollector(); config.validate(collector); FileFormat fileFormat = config.getFormat(); ValidatingOutputFormat validatingOutputFormat; try { validatingOutputFormat = context.newPluginInstance(fileFormat.name().toLowerCase()); } catch (InvalidPluginConfigException e) { Set<String> properties = new HashSet<>(e.getMissingProperties()); for (InvalidPluginProperty invalidProperty: e.getInvalidProperties()) { properties.add(invalidProperty.getName()); } String errorMessage = String.format("Format '%s' cannot be used because properties %s were not provided or " + "were invalid when the pipeline was deployed. Set the format to a " + "different value, or re-create the pipeline with all required properties.", fileFormat.name(), properties); throw new IllegalArgumentException(errorMessage, e); } FormatContext formatContext = new FormatContext(collector, context.getInputSchema()); validateOutputFormatProvider(formatContext, fileFormat, validatingOutputFormat); collector.getOrThrowException(); Schema schema = config.getSchema(); if (schema == null) { schema = context.getInputSchema(); } LineageRecorder lineageRecorder = new LineageRecorder(context, config.getReferenceName()); lineageRecorder.createExternalDataset(schema); if (schema != null && schema.getFields() != null && !schema.getFields().isEmpty()) { recordLineage(lineageRecorder, schema.getFields().stream().map(Schema.Field::getName).collect(Collectors.toList())); } Map<String, String> outputProperties = new HashMap<>(validatingOutputFormat.getOutputFormatConfiguration()); outputProperties.putAll(getFileSystemProperties(context)); outputProperties.put(FileOutputFormat.OUTDIR, getOutputDir(context.getLogicalStartTime())); context.addOutput(Output.of(config.getReferenceName(), new SinkOutputFormatProvider(validatingOutputFormat.getOutputFormatClassName(), outputProperties))); }