Vu-Hoang Phan
02/24/2024, 10:22 PMpublic static void main(String[] args) throws Exception {
var env = StreamExecutionEnvironment.getExecutionEnvironment();
Actions.forTable(table).rewriteDataFiles().execute();
env.execute();
}
Flink needs to have a data stream and a sink to work with. Under the hood of rewriteDataFiles() action there is a data stream created, but I don’t see the sink anywhere.
This program will throw exceptions, but still perform the rewrite action. Since I’m using the Flink k8s operator, my Flink job pod keeps crashing. How do I make Flink gracefully finish the action? Thanks.Tim Wolfe
02/25/2024, 2:27 AMDiscardingSink, to satisfy Flink's requirement for a data stream to have an endpoint. Alternatively, you can use a custom source that emits a limited number of elements and completes, signaling Flink that the job has finished. Ensure your job's configuration aligns with its nature when using the Flink Kubernetes operator to prevent unnecessary restarts or crashes.Vu-Hoang Phan
02/26/2024, 8:21 PMrewriteDataFiles().execute() creates a data stream then call execute and collect under the hood.