xiaokangguo commented on a change in pull request #6892:
URL: https://github.com/apache/incubator-doris/pull/6892#discussion_r733561420



##########
File path: 
extension/flink-doris-connector/src/main/java/org/apache/doris/flink/table/DorisDynamicOutputFormat.java
##########
@@ -136,30 +140,37 @@ private void checkFlushException() {
     }
 
     @Override
-    public synchronized void writeRecord(RowData row) throws IOException {
+    public synchronized void writeRecord(T row) throws IOException {
         checkFlushException();
-
         addBatch(row);
         if (executionOptions.getBatchSize() > 0 && batch.size() >= 
executionOptions.getBatchSize()) {
             flush();
         }
     }
 
-    private void addBatch(RowData row) {
-        Map<String, String> valueMap = new HashMap<>();
-        StringJoiner value = new StringJoiner(this.fieldDelimiter);
-        for (int i = 0; i < row.getArity() && i < fieldGetters.length; ++i) {
-            Object field = fieldGetters[i].getFieldOrNull(row);
-            if (jsonFormat) {
-                String data = field != null ? field.toString() : null;
-                valueMap.put(this.fieldNames[i], data);
-            } else {
-                String data = field != null ? field.toString() : NULL_VALUE;
-                value.add(data);
+    // 添加json字符串 本地测试

Review comment:
       got it,thanks!

##########
File path: 
extension/flink-doris-connector/src/test/java/org/apache/doris/flink/DorisStreamSinkExample.java
##########
@@ -0,0 +1,251 @@
+package org.apache.doris.flink;
+
+import org.apache.doris.flink.cfg.DorisExecutionOptions;
+import org.apache.doris.flink.cfg.DorisOptions;
+import org.apache.doris.flink.cfg.DorisReadOptions;
+import org.apache.doris.flink.cfg.DorisSink;
+import org.apache.flink.api.common.functions.MapFunction;
+import org.apache.flink.api.common.serialization.SimpleStringSchema;
+import org.apache.flink.streaming.api.datastream.DataStream;
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer;

Review comment:
       got it,thanks!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to