Repository navigation
Description
Search before asking
- I searched in the issues and found nothing similar.
Motivation
Although the implementation is there, we need to provide a cleaner source/sink API as it is currently somewhat messy and has a lot of arguments.
Solution
- Introduce Deserialization Schemas #625
- Introduce FlussSource for Flink DataStream API #626
- Introduce FlussSink for Flink DataStream API #627
- Add Flink DataStream Source/Sink Documentation #628
Source Features
- Add deserialization schema
- Make FlinkSource and related classes Generic
- Introduce FlussSource
- Support projection pushdown via field names
Fluss Source Usage:
FlussSource<Order> flussSource =
FlussSource.<Order>builder()
.setBootstrapServers(bootstrapServers)
.setDatabase(DEFAULT_DB)
.setTable(pkTableName)
.setStartingOffsets(OffsetsInitializer.earliest())
.setScanPartitionDiscoveryIntervalMs(1000L)
.setDeserializationSchema(new OrderDeserializationSchema())
.build();
DataStreamSource<Order> stream =
env.fromSource(flussSource, WatermarkStrategy.noWatermarks(), "Fluss Source");
Currently, it supports setting some key properties via the builder pattern, but to avoid overwhelming users they can set the rest with Configuration via the setFlussConfig(). We can always add more if required and after feedback, I just thought it's better like this for now.
Sink Features
Fluss Sink Usage:
FlinkSink<Order> flussSink =
FlussSink.<Order>builder()
.setBootstrapServers(bootstrapServers)
.setDatabase(DEFAULT_DB)
.setTable(pkTableName)
.useUpsert()
.setRowType(rowType)
.setInputType(Order.class) // Signals that no conversion is needed
.build();
stream.sinkTo(flussSink).name("Fluss Sink");
Anything else?
No response
Willingness to contribute
- I'm willing to submit a PR!
Reacted by Krzysztof Zarzycki
Sub-issues
Collapse Sub-issuesSub-issues
Loading 8 sub-issues
Activity
wuchong commentedon Mar 10, 2025
Thanks @polyzos for opening it and taking care of this. Let's discuss the proposed API first here.
I think Kafka and MongoDB connectors are good example to learn from.
wuchong commentedon Mar 10, 2025
@polyzos Do you want to contribute this issue?
polyzos commentedon Mar 10, 2025
@wuchong Hopefully yes.. I'm gonna spend some time investigating and think of the design and will circle back.
polyzos commentedon Mar 18, 2025
Design Proposal
https://docs.google.com/document/d/1EZxKgTJV5tUlzE7DlWbeQIvBTNvOElCAqNqtVj3URFs/edit?tab=t.0
[-][Feature] Datastream API Support[/-][+][Umbrella][Feature] Datastream API Support[/+]polyzos commentedon May 9, 2025
Update here: The FlussSource has been merged; however, for the FlussSink, we discovered that the original design was insufficient to support a datastream sink with Pojos, as it would require multiple conversions, Pojo -> RowData -> InternalRow.
We have some initial thoughts on a new design that will allow us to keep track of the operations that care place (INSERT, UPDATE, DELETE) when working with Pojos so we can minimize the type conversions internally and be able to go directly from Pojos -> InternalRow
wuchong commentedon Jun 13, 2025
All the tasks of DataStream API are completed, thanks @polyzos and all the contributors!