Skip to content

Commit 8d74972

Browse files
author
Jan Kaul
committed
remove async catalog call
1 parent 13744e2 commit 8d74972

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

datafusion_iceberg/src/catalog/mirror.rs

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,15 @@ impl Mirror {
181181
.map_err(DataFusionError::from)
182182
}
183183
pub fn table_exists(&self, identifier: Identifier) -> bool {
184-
self.storage.get(&identifier.to_string()).map_or(false, |node| {
185-
matches!(node.value(), Node::Relation(_))
186-
})
184+
self.storage
185+
.get(&identifier.to_string())
186+
.map_or(false, |node| matches!(node.value(), Node::Relation(_)))
187187
}
188188

189189
pub fn schema_exists(&self, name: &str) -> bool {
190-
self.storage.get(name).map_or(false, |node| {
191-
matches!(node.value(), Node::Namespace(_))
192-
})
190+
self.storage
191+
.get(name)
192+
.map_or(false, |node| matches!(node.value(), Node::Namespace(_)))
193193
}
194194

195195
pub fn catalog(&self) -> Arc<dyn Catalog> {
@@ -213,21 +213,8 @@ impl Mirror {
213213
_ => None,
214214
});
215215

216-
let handle = Handle::current();
217-
handle.spawn({
218-
let catalog = self.catalog.clone();
219-
let storage = self.storage.clone();
220-
async move {
221-
catalog
222-
.clone()
223-
.create_namespace(&namespace, None)
224-
.await
225-
.map_err(|err| DataFusionError::External(Box::new(err)))
226-
.unwrap();
227-
228-
storage.insert(namespace.to_string(), Node::Namespace(HashSet::new()));
229-
}
230-
});
216+
self.storage
217+
.insert(namespace.to_string(), Node::Namespace(HashSet::new()));
231218
Ok(old_value)
232219
}
233220
}

0 commit comments

Comments
 (0)