Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] Fix FunctionParams NPE #55885

Merged
merged 2 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class FunctionParams implements Writable {
private List<OrderByElement> orderByElements;
// c'tor for non-star params
public FunctionParams(boolean isDistinct, List<Expr> 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()
Expand Down
33 changes: 33 additions & 0 deletions test/sql/test_stream_load/R/test_stream_load_columns
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions test/sql/test_stream_load/T/test_stream_load_columns
Original file line number Diff line number Diff line change
@@ -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;
Loading