Skip to content

Commit e37b99a

Browse files
author
Jan Kaul
committed
fix sql catalog test
1 parent 1d320df commit e37b99a

File tree

1 file changed

+14
-1
lines changed
  • catalogs/iceberg-sql-catalog/src

1 file changed

+14
-1
lines changed

catalogs/iceberg-sql-catalog/src/lib.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl Catalog for SqlCatalog {
168168
// If no properties were provided, still create an entry to mark the namespace as existing
169169
if properties.is_empty() {
170170
sqlx::query(&format!(
171-
"insert into iceberg_namespace_properties (catalog_name, namespace, property_key, property_value) values ('{catalog_name}', '{namespace_str}', null, null);"
171+
"insert into iceberg_namespace_properties (catalog_name, namespace, property_key, property_value) values ('{catalog_name}', '{namespace_str}', 'exists', 'true');"
172172
))
173173
.execute(&self.pool)
174174
.await
@@ -863,6 +863,19 @@ pub mod tests {
863863

864864
ctx.register_catalog("warehouse", catalog);
865865

866+
let sql = &"CREATE SCHEMA warehouse.tpch;".to_string();
867+
868+
let plan = ctx.state().create_logical_plan(sql).await.unwrap();
869+
870+
let transformed = plan.transform(iceberg_transform).data().unwrap();
871+
872+
ctx.execute_logical_plan(transformed)
873+
.await
874+
.unwrap()
875+
.collect()
876+
.await
877+
.expect("Failed to execute query plan.");
878+
866879
let sql = "CREATE EXTERNAL TABLE lineitem (
867880
L_ORDERKEY BIGINT NOT NULL,
868881
L_PARTKEY BIGINT NOT NULL,

0 commit comments

Comments
 (0)