Skip to content
Permalink
Browse files
[fix] When doing checkpoint, write cache data to doris to prevent loss (
  • Loading branch information
liuyaolin committed Feb 22, 2022
1 parent a175157 commit b023f91e28befbc188ad70e18aaf2e58344e11bf
Showing 2 changed files with 5 additions and 3 deletions.
@@ -53,12 +53,12 @@ public void invoke(T value, Context context) throws Exception {

@Override
public void initializeState(FunctionInitializationContext context) throws Exception {

}

@Override
public void snapshotState(FunctionSnapshotContext context) throws Exception {

outputFormat.flush();
}

@Override
@@ -24,6 +24,8 @@
import org.apache.flink.table.connector.sink.DynamicTableSink;
import org.apache.flink.table.connector.sink.OutputFormatProvider;
import org.apache.flink.types.RowKind;
import org.apache.doris.flink.cfg.GenericDorisSinkFunction;
import org.apache.flink.table.connector.sink.SinkFunctionProvider;

/**
* DorisDynamicTableSink
@@ -65,7 +67,7 @@ public SinkRuntimeProvider getSinkRuntimeProvider(Context context) {
.setExecutionOptions(executionOptions)
.setFieldDataTypes(tableSchema.getFieldDataTypes())
.setFieldNames(tableSchema.getFieldNames());
return OutputFormatProvider.of(builder.build());
return SinkFunctionProvider.of(new GenericDorisSinkFunction(builder.build()));
}

@Override

0 comments on commit b023f91

Please sign in to comment.