diff --git a/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/BaseJdbcExecutor.java b/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/BaseJdbcExecutor.java index 40ef980a1745af..edc922f4a1ee11 100644 --- a/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/BaseJdbcExecutor.java +++ b/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/BaseJdbcExecutor.java @@ -236,7 +236,7 @@ public long getBlockAddress(int batchSize, Map outputParams) thr } protected void initializeBlock(int columnCount, String[] replaceStringList, int batchSizeNum, - VectorTable outputTable) { + VectorTable outputTable) { for (int i = 0; i < columnCount; ++i) { block.add(outputTable.getColumn(i).newObjectContainerArray(batchSizeNum)); } @@ -293,7 +293,7 @@ public int getCurBlockRows() { public boolean hasNext() throws UdfRuntimeException { try { - if (resultSet == null) { + if (resultSet == null || resultSet.isClosed()) { return false; } return resultSet.next(); diff --git a/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/DefaultJdbcExecutor.java b/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/DefaultJdbcExecutor.java index 243abb0ada3ace..ddc991a3710e9d 100644 --- a/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/DefaultJdbcExecutor.java +++ b/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/DefaultJdbcExecutor.java @@ -332,7 +332,7 @@ public int getCurBlockRows() { public boolean hasNext() throws UdfRuntimeException { try { - if (resultSet == null) { + if (resultSet == null || resultSet.isClosed()) { return false; } return resultSet.next(); @@ -866,7 +866,7 @@ private List convertArray(List list, ColumnType childType) { convertedList.add(convertArray((List) element, childType)); } else { if (converter != null) { - convertedList.add(converter.convert(new Object[] {element})[0]); + convertedList.add(converter.convert(new Object[]{element})[0]); } else { convertedList.add(element); }