This is an automated email from the ASF dual-hosted git repository.

panxiaolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 8661b5ec214 [Bug](function) fix npe on select http_stream directly 
(#28423)
8661b5ec214 is described below

commit 8661b5ec214261b4f6237d9887eb6e1aba37292a
Author: Pxl <pxl...@qq.com>
AuthorDate: Fri Dec 15 11:09:45 2023 +0800

    [Bug](function) fix npe on select http_stream directly (#28423)
    
    fix npe on select http_stream directly
---
 .../apache/doris/tablefunction/ExternalFileTableValuedFunction.java  | 2 +-
 regression-test/suites/query_p0/system/test_query_sys.groovy         | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/tablefunction/ExternalFileTableValuedFunction.java
 
b/fe/fe-core/src/main/java/org/apache/doris/tablefunction/ExternalFileTableValuedFunction.java
index 3569c4f4479..72a0f061c00 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/tablefunction/ExternalFileTableValuedFunction.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/tablefunction/ExternalFileTableValuedFunction.java
@@ -385,7 +385,7 @@ public abstract class ExternalFileTableValuedFunction 
extends TableValuedFunctio
         long backendId = ctx.getBackendId();
         if (getTFileType() == TFileType.FILE_STREAM) {
             Backend be = 
Env.getCurrentSystemInfo().getIdToBackend().get(backendId);
-            if (be.isAlive()) {
+            if (be == null || be.isAlive()) {
                 return be;
             }
         }
diff --git a/regression-test/suites/query_p0/system/test_query_sys.groovy 
b/regression-test/suites/query_p0/system/test_query_sys.groovy
index 0be52a301d1..b17500a0ccb 100644
--- a/regression-test/suites/query_p0/system/test_query_sys.groovy
+++ b/regression-test/suites/query_p0/system/test_query_sys.groovy
@@ -46,4 +46,9 @@ suite("test_query_sys", "query,p0") {
     // INFORMATION_SCHEMA
     sql "SELECT table_name FROM INFORMATION_SCHEMA.TABLES where 
table_schema=\"test_query_db\" and TABLE_TYPE = \"BASE TABLE\" order by 
table_name"
     sql "SELECT COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT FROM 
INFORMATION_SCHEMA.COLUMNS WHERE table_name = \"${tableName}\" AND table_schema 
=\"test_query_db\" AND column_name LIKE \"k%\""
+
+    test {
+        sql "select * from http_stream('format'='csv');"
+        exception "No Alive backends"
+    }
 }


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

Reply via email to