File tree Expand file tree Collapse file tree
catalogs/iceberg-rest-catalog/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -514,6 +514,45 @@ impl CatalogList for RestCatalogList {
514514 }
515515}
516516
517+ #[ derive( Debug , Clone ) ]
518+ pub struct RestNoPrefixCatalogList {
519+ name : String ,
520+ configuration : Configuration ,
521+ object_store_builder : ObjectStoreBuilder ,
522+ }
523+
524+ impl RestNoPrefixCatalogList {
525+ pub fn new (
526+ name : & str ,
527+ configuration : Configuration ,
528+ object_store_builder : ObjectStoreBuilder ,
529+ ) -> Self {
530+ Self {
531+ name : name. to_owned ( ) ,
532+ configuration,
533+ object_store_builder,
534+ }
535+ }
536+ }
537+
538+ #[ async_trait]
539+ impl CatalogList for RestNoPrefixCatalogList {
540+ fn catalog ( & self , name : & str ) -> Option < Arc < dyn Catalog > > {
541+ if self . name == name {
542+ Some ( Arc :: new ( RestCatalog :: new (
543+ None ,
544+ self . configuration . clone ( ) ,
545+ self . object_store_builder . clone ( ) ,
546+ ) ) )
547+ } else {
548+ None
549+ }
550+ }
551+ async fn list_catalogs ( & self ) -> Vec < String > {
552+ vec ! [ self . name. clone( ) ]
553+ }
554+ }
555+
517556#[ cfg( test) ]
518557pub mod tests {
519558 use datafusion:: {
You can’t perform that action at this time.
0 commit comments