test: add dummy select case (#618)

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
Ruihang Xia
2022-11-22 16:47:45 +08:00
committed by GitHub
parent b407ebf6bb
commit 9f865b50ab
3 changed files with 51 additions and 4 deletions

View File

@@ -0,0 +1,36 @@
select 1;
+--------------------------+
| Int64(1), #Field, #Int64 |
+--------------------------+
| 1 |
+--------------------------+
select 2 + 3;
+----------------------------------------+
| Int64(2) Plus Int64(3), #Field, #Int64 |
+----------------------------------------+
| 5 |
+----------------------------------------+
select 4 + 0.5;
+----------------------------------------------+
| Int64(4) Plus Float64(0.5), #Field, #Float64 |
+----------------------------------------------+
| 4.5 |
+----------------------------------------------+
select "a";
Failed to execute, error: Datanode { code: 3000, msg: "Failed to execute sql, source: Cannot plan SQL: SELECT \"a\", source: Error during planning: Invalid identifier '#a' for schema fields:[], metadata:{}" }
select "A";
Failed to execute, error: Datanode { code: 3000, msg: "Failed to execute sql, source: Cannot plan SQL: SELECT \"A\", source: Error during planning: Invalid identifier '#A' for schema fields:[], metadata:{}" }
select * where "a" = "A";
Failed to execute, error: Datanode { code: 3000, msg: "Failed to execute sql, source: Cannot plan SQL: SELECT * WHERE \"a\" = \"A\", source: Error during planning: Invalid identifier '#a' for schema fields:[], metadata:{}" }

View File

@@ -0,0 +1,11 @@
select 1;
select 2 + 3;
select 4 + 0.5;
select "a";
select "A";
select * where "a" = "A";

View File

@@ -35,8 +35,8 @@ impl Environment for Env {
async fn start(&self, mode: &str, _config: Option<String>) -> Self::DB {
match mode {
"local" => Self::start_local().await,
"remote" => Self::start_remote().await,
"standalone" => Self::start_standalone().await,
"distributed" => Self::start_distributed().await,
_ => panic!("Unexpected mode: {}", mode),
}
}
@@ -48,7 +48,7 @@ impl Environment for Env {
}
impl Env {
pub async fn start_local() -> GreptimeDB {
pub async fn start_standalone() -> GreptimeDB {
let server_process = Command::new("cargo")
.current_dir("../")
.args(["run", "--", "standalone", "start"])
@@ -67,7 +67,7 @@ impl Env {
}
}
pub async fn start_remote() -> GreptimeDB {
pub async fn start_distributed() -> GreptimeDB {
todo!()
}
}