You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/07/06 10:02:50 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #6165: [Bug]:fix when data null , flink-connector throw NullPointerException

morningman commented on a change in pull request #6165:
URL: https://github.com/apache/incubator-doris/pull/6165#discussion_r664417096



##########
File path: extension/flink-doris-connector/src/main/java/org/apache/doris/flink/table/DorisDynamicOutputFormat.java
##########
@@ -118,7 +118,8 @@ private void addBatch(RowData row) {
         StringJoiner value = new StringJoiner(this.fieldDelimiter);
         GenericRowData rowData = (GenericRowData) row;
         for(int i = 0; i < row.getArity(); ++i) {
-            value.add(rowData.getField(i).toString());
+            String field = rowData.getField(i) == null ? "" : rowData.getField(i).toString();
+            value.add(field);

Review comment:
       Do need to distinguish `null` and `empty string`? 




-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org