From c59475146c9055500a46819e131681c21ca2011f Mon Sep 17 00:00:00 2001 From: Jibing Li Date: Mon, 17 Jun 2024 17:38:31 +0800 Subject: [PATCH] Fix batch is null bug. --- .../src/main/java/org/apache/doris/qe/StmtExecutor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java index 5d8958a53d7941..b32109ced5f8e5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java @@ -3346,9 +3346,14 @@ public List executeInternalQuery() { try { while (true) { batch = coord.getNext(); - if (batch == null || batch.isEos()) { + Preconditions.checkNotNull(batch, "Batch is Null."); + if (batch.isEos()) { return resultRows; } else { + // For null and not EOS batch, continue to get the next batch. + if (batch.getBatch() == null) { + continue; + } resultRows.addAll(convertResultBatchToResultRows(batch.getBatch())); } }