mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-27 08:29:59 +00:00
test: add dummy select case (#618)
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
36
tests/cases/standalone/select/dummy.output
Normal file
36
tests/cases/standalone/select/dummy.output
Normal 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:{}" }
|
||||
|
||||
11
tests/cases/standalone/select/dummy.sql
Normal file
11
tests/cases/standalone/select/dummy.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
select 1;
|
||||
|
||||
select 2 + 3;
|
||||
|
||||
select 4 + 0.5;
|
||||
|
||||
select "a";
|
||||
|
||||
select "A";
|
||||
|
||||
select * where "a" = "A";
|
||||
@@ -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!()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user