Skip to content

Commit

Permalink
config: kipdb version up (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
KKould authored Oct 5, 2023
1 parent c159a30 commit 3daef34
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ahash = "0.8.3"
lazy_static = "1.4.0"
comfy-table = "7.0.1"
bytes = "1.5.0"
kip_db = "0.1.2-alpha.16"
kip_db = "0.1.2-alpha.17"
async-recursion = "1.0.5"
rust_decimal = "1"
csv = "1"
Expand Down
10 changes: 6 additions & 4 deletions src/execution/executor/dml/copy_from_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn return_result(size: usize, tx: Sender<Tuple>) -> Result<(), ExecutorError> {
#[cfg(test)]
mod tests {
use crate::catalog::{ColumnCatalog, ColumnDesc};
use crate::db::Database;
use crate::db::{Database, DatabaseError};
use futures::StreamExt;
use std::io::Write;
use std::sync::Arc;
Expand All @@ -125,7 +125,7 @@ mod tests {
use crate::types::LogicalType;

#[tokio::test]
async fn read_csv() {
async fn read_csv() -> Result<(), DatabaseError> {
let csv = "1,1.5,one\n2,2.5,two\n";

let mut file = tempfile::NamedTempFile::new().expect("failed to create temp file");
Expand Down Expand Up @@ -189,16 +189,18 @@ mod tests {
};

let temp_dir = TempDir::new().unwrap();
let db = Database::with_kipdb(temp_dir.path()).await.unwrap();
let db = Database::with_kipdb(temp_dir.path()).await?;
let _ = db
.run("create table test_copy (a int primary key, b float, c varchar(10))")
.await;
let actual = executor.execute(&db.storage).next().await.unwrap().unwrap();
let actual = executor.execute(&db.storage).next().await.unwrap()?;

let tuple_builder = TupleBuilder::new_result();
let expected = tuple_builder
.push_result("COPY FROM SOURCE", format!("import {} rows", 2).as_str())
.unwrap();
assert_eq!(actual, expected);

Ok(())
}
}

0 comments on commit 3daef34

Please sign in to comment.