use of org.apache.flink.api.common.serialization.SerializationSchema in project flink by apache.
the class TestDynamicTableFactory method createDynamicTableSink.
@Override
public DynamicTableSink createDynamicTableSink(Context context) {
final TableFactoryHelper helper = FactoryUtil.createTableFactoryHelper(this, context);
final Optional<EncodingFormat<SerializationSchema<RowData>>> keyFormat = helper.discoverOptionalEncodingFormat(SerializationFormatFactory.class, KEY_FORMAT);
final EncodingFormat<SerializationSchema<RowData>> valueFormat = helper.discoverOptionalEncodingFormat(SerializationFormatFactory.class, FORMAT).orElseGet(() -> helper.discoverEncodingFormat(SerializationFormatFactory.class, VALUE_FORMAT));
helper.validate();
return new DynamicTableSinkMock(helper.getOptions().get(TARGET), helper.getOptions().get(BUFFER_SIZE), keyFormat.orElse(null), valueFormat);
}
Aggregations