diff --git a/fe/fe-core/src/main/java/com/starrocks/analysis/FunctionParams.java b/fe/fe-core/src/main/java/com/starrocks/analysis/FunctionParams.java index f91d0f45099827..749609393dad82 100644 --- a/fe/fe-core/src/main/java/com/starrocks/analysis/FunctionParams.java +++ b/fe/fe-core/src/main/java/com/starrocks/analysis/FunctionParams.java @@ -61,7 +61,7 @@ public class FunctionParams implements Writable { private List orderByElements; // c'tor for non-star params public FunctionParams(boolean isDistinct, List exprs) { - if (exprs.stream().anyMatch(e -> e instanceof NamedArgument)) { + if (exprs != null && exprs.stream().anyMatch(e -> e instanceof NamedArgument)) { this.exprs = exprs.stream().map(e -> (e instanceof NamedArgument ? ((NamedArgument) e).getExpr() : e)).collect(Collectors.toList()); this.exprsNames = exprs.stream().map(e -> (e instanceof NamedArgument ? ((NamedArgument) e).getName() diff --git a/test/sql/test_stream_load/R/test_stream_load_columns b/test/sql/test_stream_load/R/test_stream_load_columns new file mode 100644 index 00000000000000..e4a1fe77cfa5b6 --- /dev/null +++ b/test/sql/test_stream_load/R/test_stream_load_columns @@ -0,0 +1,33 @@ +-- name: test_stream_load_columns +create database db_${uuid0}; +-- result: +-- !result +use db_${uuid0}; +-- result: +-- !result +CREATE TABLE `t0` ( + `c0` int(11) NOT NULL, + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP +) ENGINE=OLAP +DUPLICATE KEY(`c0`) +DISTRIBUTED BY HASH(`c0`) BUCKETS 10 +PROPERTIES ( + "replication_num" = "1" +); +-- result: +-- !result +shell: curl --location-trusted -u root: -X PUT -H "Expect:100-continue" -H "columns: c0, create_time=now()" -d '1' ${url}/api/db_${uuid0}/t0/_stream_load +-- result: +0 +{ + "Status": "Success", + "Message": "OK" +} +-- !result +sync; +-- result: +-- !result +select c0 from db_${uuid0}.t0; +-- result: +1 +-- !result \ No newline at end of file diff --git a/test/sql/test_stream_load/T/test_stream_load_columns b/test/sql/test_stream_load/T/test_stream_load_columns new file mode 100644 index 00000000000000..3eed2e835a1a13 --- /dev/null +++ b/test/sql/test_stream_load/T/test_stream_load_columns @@ -0,0 +1,18 @@ +-- name: test_stream_load_columns +create database db_${uuid0}; +use db_${uuid0}; + +CREATE TABLE `t0` ( + `c0` int(11) NOT NULL, + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP +) ENGINE=OLAP +DUPLICATE KEY(`c0`) +DISTRIBUTED BY HASH(`c0`) BUCKETS 10 +PROPERTIES ( + "replication_num" = "1" +); + +shell: curl --location-trusted -u root: -X PUT -H "Expect:100-continue" -H "columns: c0, create_time=now()" -d '1' ${url}/api/db_${uuid0}/t0/_stream_load +sync; + +select c0 from db_${uuid0}.t0; \ No newline at end of file