Skip to content

Commit 90c761c

Browse files
Add unit test
1 parent 168f7c1 commit 90c761c

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

catalogs/iceberg-rest-catalog/src/catalog.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,21 @@ pub mod tests {
750750
.expect("Failed to list Tables");
751751
assert_eq!(tables[0].to_string(), "tpch.lineitem".to_owned());
752752

753+
assert_eq!(
754+
iceberg_catalog
755+
.tabular_exists(&Identifier::new(&["tpch".to_owned()], "lineitem"))
756+
.await
757+
.map_err(|s| s.to_string()),
758+
Ok(true)
759+
);
760+
assert_eq!(
761+
iceberg_catalog
762+
.tabular_exists(&Identifier::new(&["tpch".to_owned()], "non_existing_table"))
763+
.await
764+
.map_err(|s| s.to_string()),
765+
Ok(false)
766+
);
767+
753768
let sql = "insert into warehouse.tpch.lineitem select * from lineitem;";
754769

755770
let plan = ctx.state().create_logical_plan(sql).await.unwrap();

0 commit comments

Comments
 (0)