Skip to content

Commit

Permalink
add sql test
Browse files Browse the repository at this point in the history
Signed-off-by: PengFei Li <[email protected]>
  • Loading branch information
banmoy committed Feb 14, 2025
1 parent ea94cdb commit 4f9f8ab
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
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;

0 comments on commit 4f9f8ab

Please sign in to comment.