diff --git a/spark-doris-connector/src/main/java/org/apache/doris/spark/load/RecordBatchInputStream.java b/spark-doris-connector/src/main/java/org/apache/doris/spark/load/RecordBatchInputStream.java index 9444c1da..70069d2b 100644 --- a/spark-doris-connector/src/main/java/org/apache/doris/spark/load/RecordBatchInputStream.java +++ b/spark-doris-connector/src/main/java/org/apache/doris/spark/load/RecordBatchInputStream.java @@ -170,14 +170,13 @@ private void ensureCapacity(int need) { * @return new capacity */ private int calculateNewCapacity(int capacity, int minCapacity) { - int newCapacity; + int newCapacity = 0; if (capacity == 0) { newCapacity = DEFAULT_BUF_SIZE; - while (newCapacity < minCapacity) { - newCapacity = newCapacity << 1; - } - } else { - newCapacity = capacity << 1; + + } + while (newCapacity < minCapacity) { + newCapacity = newCapacity << 1; } return newCapacity; }