flink-clickhouse-sink
flink-clickhouse-sink copied to clipboard
The interface for converter to ClickHouse format
@aleksanchezz @ashulenko Probably, for more obvious using this sink we should add the cpecific interface, something like this:
public interface ClickHouseSinkConverter<T> {
String convert(T record);
}
And we can use it directly in the sink:
ClickHouseSinkConverter<SomeClass> chConverter = ....;
DataStream<YourEvent> dataStream = ...;
dataStream.addSink(new ClickhouseSink(props, chConverter))
.name("your_table clickhouse sink);
And inside https://github.com/ivi-ru/flink-clickhouse-sink/blob/master/src/main/java/ru/ivi/opensource/flinkclickhousesink/ClickhouseSink.java#L53 .
That should be really helpful, if a converter is supported.
@spancer hi, it is not a converter, it is just an interface. Basically, this ticket is about refactoring.
It's quite tricky to implement an universal converter from Java Object to Clickhouse-format String. But if you have some will, you could try.
Contributions are welcome.
implemented in https://github.com/ivi-ru/flink-clickhouse-sink/pull/22