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

test: add integration test for query plan #1228

Merged
merged 8 commits into from
Sep 26, 2023
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
122 changes: 15 additions & 107 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion integration_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ ceresdb-client = "1.0.2"
local-ip-address = "0.5"
reqwest = { workspace = true }
serde = { workspace = true }
sqlness = "0.4.3"
sqlness = "0.5.0"
tokio = { workspace = true }
uuid = { version = "1.3", features = ["v4"] }
12 changes: 6 additions & 6 deletions integration_tests/cases/common/dml/case_sensitive.result
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SELECT
FROM
CASE_SENSITIVE_TABLE1;

Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to create plan, query: SELECT \n * \n FROM \n CASE_SENSITIVE_TABLE1;. Caused by: Failed to create plan, err:Failed to generate datafusion plan, err:Execution error: Table is not found, \"table:CASE_SENSITIVE_TABLE1\"" })
Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to create plan, query:SELECT\n *\nFROM\n CASE_SENSITIVE_TABLE1;. Caused by: Failed to create plan, err:Failed to generate datafusion plan, err:Execution error: Table is not found, \"table:CASE_SENSITIVE_TABLE1\"" })

SELECT
*
Expand All @@ -51,7 +51,7 @@ SELECT
FROM
`CASE_SENSITIVE_TABLE1`;

Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to create plan, query: SELECT \n * \n FROM \n `CASE_SENSITIVE_TABLE1`;. Caused by: Failed to create plan, err:Failed to generate datafusion plan, err:Execution error: Table is not found, \"table:CASE_SENSITIVE_TABLE1\"" })
Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to create plan, query:SELECT\n *\nFROM\n `CASE_SENSITIVE_TABLE1`;. Caused by: Failed to create plan, err:Failed to generate datafusion plan, err:Execution error: Table is not found, \"table:CASE_SENSITIVE_TABLE1\"" })

SHOW CREATE TABLE case_SENSITIVE_table1;

Expand All @@ -61,7 +61,7 @@ String("case_SENSITIVE_table1"),String("CREATE TABLE `case_SENSITIVE_table1` (`t

SHOW CREATE TABLE CASE_SENSITIVE_TABLE1;

Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to create plan, query: SHOW CREATE TABLE CASE_SENSITIVE_TABLE1;. Caused by: Failed to create plan, err:Table not found, table:CASE_SENSITIVE_TABLE1" })
Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to create plan, query:SHOW CREATE TABLE CASE_SENSITIVE_TABLE1;. Caused by: Failed to create plan, err:Table not found, table:CASE_SENSITIVE_TABLE1" })

SHOW CREATE TABLE `case_SENSITIVE_table1`;

Expand All @@ -71,7 +71,7 @@ String("case_SENSITIVE_table1"),String("CREATE TABLE `case_SENSITIVE_table1` (`t

SHOW CREATE TABLE `CASE_SENSITIVE_TABLE1`;

Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to create plan, query: SHOW CREATE TABLE `CASE_SENSITIVE_TABLE1`;. Caused by: Failed to create plan, err:Table not found, table:CASE_SENSITIVE_TABLE1" })
Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to create plan, query:SHOW CREATE TABLE `CASE_SENSITIVE_TABLE1`;. Caused by: Failed to create plan, err:Table not found, table:CASE_SENSITIVE_TABLE1" })

DESC case_SENSITIVE_table1;

Expand All @@ -83,7 +83,7 @@ String("VALUE1"),String("double"),Boolean(false),Boolean(true),Boolean(false),Bo

DESC CASE_SENSITIVE_TABLE1;

Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to create plan, query: DESC CASE_SENSITIVE_TABLE1;. Caused by: Failed to create plan, err:Table not found, table:CASE_SENSITIVE_TABLE1" })
Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to create plan, query:DESC CASE_SENSITIVE_TABLE1;. Caused by: Failed to create plan, err:Table not found, table:CASE_SENSITIVE_TABLE1" })

DESC `case_SENSITIVE_table1`;

Expand All @@ -95,7 +95,7 @@ String("VALUE1"),String("double"),Boolean(false),Boolean(true),Boolean(false),Bo

DESC `CASE_SENSITIVE_TABLE1`;

Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to create plan, query: DESC `CASE_SENSITIVE_TABLE1`;. Caused by: Failed to create plan, err:Table not found, table:CASE_SENSITIVE_TABLE1" })
Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to create plan, query:DESC `CASE_SENSITIVE_TABLE1`;. Caused by: Failed to create plan, err:Table not found, table:CASE_SENSITIVE_TABLE1" })

DROP TABLE IF EXISTS case_SENSITIVE_table1;

Expand Down
6 changes: 6 additions & 0 deletions integration_tests/cases/common/dml/insert_mode.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- overwrite
jiacai2050 marked this conversation as resolved.
Show resolved Hide resolved
DROP TABLE IF EXISTS `03_dml_insert_mode_table1`;

affected_rows: 0
Expand Down Expand Up @@ -54,6 +55,7 @@ DROP TABLE `03_dml_insert_mode_table1`;

affected_rows: 0

-- append
DROP TABLE IF EXISTS `03_dml_insert_mode_table2`;

affected_rows: 0
Expand Down Expand Up @@ -113,6 +115,7 @@ DROP TABLE `03_dml_insert_mode_table2`;

affected_rows: 0

-- default(overwrite)
DROP TABLE IF EXISTS `03_dml_insert_mode_table3`;

affected_rows: 0
Expand All @@ -133,6 +136,8 @@ INSERT INTO `03_dml_insert_mode_table3` (`timestamp`, `value`, `dic`)

affected_rows: 3

-- TODO support insert Null
-- INSERT INTO `03_dml_insert_mode_table3` (`timestamp`, `value`, `dic`) VALUES (1, 100, "d2"), (2, 200, "d1"), (3, 300, Null);
SELECT
*
FROM
Expand Down Expand Up @@ -168,6 +173,7 @@ DROP TABLE `03_dml_insert_mode_table3`;

affected_rows: 0

-- insert with missing columns
DROP TABLE IF EXISTS `03_dml_insert_mode_table4`;

affected_rows: 0
Expand Down
1 change: 1 addition & 0 deletions integration_tests/cases/common/dml/issue-1087.result
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CREATE TABLE `issue_1087` (

affected_rows: 0

-- Check which optimizer rules we are using now
explain verbose select * from issue_1087;

plan_type,plan,
Expand Down
Loading