File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
datafusion_iceberg/src/catalog Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ impl CatalogProvider for IcebergCatalog {
4343 }
4444 }
4545 fn schema ( & self , name : & str ) -> Option < Arc < dyn SchemaProvider > > {
46+ if !self . catalog . schema_exists ( name) {
47+ return None ;
48+ }
4649 Some ( Arc :: new ( IcebergSchema :: new (
4750 Namespace :: try_new (
4851 & name
Original file line number Diff line number Diff line change @@ -184,6 +184,12 @@ impl Mirror {
184184 self . storage . contains_key ( & identifier. to_string ( ) )
185185 }
186186
187+ pub fn schema_exists ( & self , name : & str ) -> bool {
188+ self . storage . get ( name) . map_or ( false , |node| {
189+ matches ! ( node. value( ) , Node :: Namespace ( _) )
190+ } )
191+ }
192+
187193 pub fn catalog ( & self ) -> Arc < dyn Catalog > {
188194 self . catalog . clone ( )
189195 }
You can’t perform that action at this time.
0 commit comments