From 7ec64fc464e980176e6249e92879d0f40e3d28b1 Mon Sep 17 00:00:00 2001 From: wudi <676366545@qq.com> Date: Thu, 21 Nov 2024 11:24:23 +0800 Subject: [PATCH] improvment log --- .../apache/doris/flink/sink/writer/DorisStreamLoad.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/writer/DorisStreamLoad.java b/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/writer/DorisStreamLoad.java index 44ff573e7..02c2df494 100644 --- a/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/writer/DorisStreamLoad.java +++ b/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/writer/DorisStreamLoad.java @@ -268,7 +268,14 @@ public RespContent handlePreCommitResponse(CloseableHttpResponse response) throw if (statusCode == 200 && response.getEntity() != null) { String loadResult = EntityUtils.toString(response.getEntity()); LOG.info("load Result {}", loadResult); - return OBJECT_MAPPER.readValue(loadResult, RespContent.class); + RespContent respContent = OBJECT_MAPPER.readValue(loadResult, RespContent.class); + if (respContent == null + || respContent.getLabel() == null + || respContent.getTxnId() == null) { + throw new DorisRuntimeException("Response error : " + loadResult); + } else { + return respContent; + } } throw new StreamLoadException("stream load error: " + response.getStatusLine().toString()); }