@@ -276,13 +276,31 @@ impl Catalog for GlueCatalog {
276276
277277 match metadata {
278278 TabularMetadata :: Table ( metadata) => Ok ( Tabular :: Table (
279- Table :: new ( identifier. clone ( ) , self . clone ( ) , metadata) . await ?,
279+ Table :: new (
280+ identifier. clone ( ) ,
281+ self . clone ( ) ,
282+ object_store. clone ( ) ,
283+ metadata,
284+ )
285+ . await ?,
280286 ) ) ,
281287 TabularMetadata :: View ( metadata) => Ok ( Tabular :: View (
282- View :: new ( identifier. clone ( ) , self . clone ( ) , metadata) . await ?,
288+ View :: new (
289+ identifier. clone ( ) ,
290+ self . clone ( ) ,
291+ object_store. clone ( ) ,
292+ metadata,
293+ )
294+ . await ?,
283295 ) ) ,
284296 TabularMetadata :: MaterializedView ( metadata) => Ok ( Tabular :: MaterializedView (
285- MaterializedView :: new ( identifier. clone ( ) , self . clone ( ) , metadata) . await ?,
297+ MaterializedView :: new (
298+ identifier. clone ( ) ,
299+ self . clone ( ) ,
300+ object_store. clone ( ) ,
301+ metadata,
302+ )
303+ . await ?,
286304 ) ) ,
287305 }
288306 }
@@ -354,7 +372,13 @@ impl Catalog for GlueCatalog {
354372 metadata. clone ( ) . into ( ) ,
355373 ) ,
356374 ) ;
357- Ok ( Table :: new ( identifier. clone ( ) , self . clone ( ) , metadata) . await ?)
375+ Ok ( Table :: new (
376+ identifier. clone ( ) ,
377+ self . clone ( ) ,
378+ object_store. clone ( ) ,
379+ metadata,
380+ )
381+ . await ?)
358382 }
359383
360384 async fn create_view (
@@ -424,7 +448,13 @@ impl Catalog for GlueCatalog {
424448 metadata. clone ( ) . into ( ) ,
425449 ) ,
426450 ) ;
427- Ok ( View :: new ( identifier. clone ( ) , self . clone ( ) , metadata) . await ?)
451+ Ok ( View :: new (
452+ identifier. clone ( ) ,
453+ self . clone ( ) ,
454+ object_store. clone ( ) ,
455+ metadata,
456+ )
457+ . await ?)
428458 }
429459
430460 async fn create_materialized_view (
@@ -527,7 +557,13 @@ impl Catalog for GlueCatalog {
527557 metadata. clone ( ) . into ( ) ,
528558 ) ,
529559 ) ;
530- Ok ( MaterializedView :: new ( identifier. clone ( ) , self . clone ( ) , metadata) . await ?)
560+ Ok ( MaterializedView :: new (
561+ identifier. clone ( ) ,
562+ self . clone ( ) ,
563+ object_store. clone ( ) ,
564+ metadata,
565+ )
566+ . await ?)
531567 }
532568
533569 async fn update_table ( self : Arc < Self > , commit : CommitTable ) -> Result < Table , IcebergError > {
@@ -636,7 +672,13 @@ impl Catalog for GlueCatalog {
636672 . unwrap ( )
637673 . insert ( identifier. clone ( ) , ( version_id, metadata. clone ( ) . into ( ) ) ) ;
638674
639- Ok ( Table :: new ( identifier. clone ( ) , self . clone ( ) , metadata) . await ?)
675+ Ok ( Table :: new (
676+ identifier. clone ( ) ,
677+ self . clone ( ) ,
678+ object_store. clone ( ) ,
679+ metadata,
680+ )
681+ . await ?)
640682 }
641683
642684 async fn update_view (
@@ -741,7 +783,13 @@ impl Catalog for GlueCatalog {
741783 . insert ( identifier. clone ( ) , ( version_id, metadata. clone ( ) ) ) ;
742784
743785 if let TabularMetadata :: View ( metadata) = metadata {
744- Ok ( View :: new ( identifier. clone ( ) , self . clone ( ) , metadata) . await ?)
786+ Ok ( View :: new (
787+ identifier. clone ( ) ,
788+ self . clone ( ) ,
789+ object_store. clone ( ) ,
790+ metadata,
791+ )
792+ . await ?)
745793 } else {
746794 Err ( IcebergError :: InvalidFormat (
747795 "Entity is not a view" . to_owned ( ) ,
@@ -849,7 +897,13 @@ impl Catalog for GlueCatalog {
849897 . unwrap ( )
850898 . insert ( identifier. clone ( ) , ( version_id, metadata. clone ( ) ) ) ;
851899 if let TabularMetadata :: MaterializedView ( metadata) = metadata {
852- Ok ( MaterializedView :: new ( identifier. clone ( ) , self . clone ( ) , metadata) . await ?)
900+ Ok ( MaterializedView :: new (
901+ identifier. clone ( ) ,
902+ self . clone ( ) ,
903+ object_store. clone ( ) ,
904+ metadata,
905+ )
906+ . await ?)
853907 } else {
854908 Err ( IcebergError :: InvalidFormat (
855909 "Entity is not a materialized view" . to_owned ( ) ,
@@ -920,7 +974,13 @@ impl Catalog for GlueCatalog {
920974 metadata. clone ( ) . into ( ) ,
921975 ) ,
922976 ) ;
923- Ok ( Table :: new ( identifier. clone ( ) , self . clone ( ) , metadata) . await ?)
977+ Ok ( Table :: new (
978+ identifier. clone ( ) ,
979+ self . clone ( ) ,
980+ object_store. clone ( ) ,
981+ metadata,
982+ )
983+ . await ?)
924984 }
925985}
926986
@@ -939,7 +999,7 @@ pub mod tests {
939999 } ;
9401000 use iceberg_rust:: {
9411001 catalog:: { namespace:: Namespace , Catalog } ,
942- object_store:: ObjectStoreBuilder ,
1002+ object_store:: { Bucket , ObjectStoreBuilder } ,
9431003 spec:: util:: strip_prefix,
9441004 } ;
9451005 use testcontainers_modules:: localstack:: LocalStack ;
@@ -1015,7 +1075,7 @@ pub mod tests {
10151075
10161076 // let object_store = ObjectStoreBuilder::memory();
10171077 let iceberg_catalog: Arc < dyn Catalog > =
1018- Arc :: new ( GlueCatalog :: new ( & config, "warehouse" , object_store) . unwrap ( ) ) ;
1078+ Arc :: new ( GlueCatalog :: new ( & config, "warehouse" , object_store. clone ( ) ) . unwrap ( ) ) ;
10191079
10201080 iceberg_catalog
10211081 . create_namespace ( & Namespace :: try_new ( & [ "tpch" . to_owned ( ) ] ) . unwrap ( ) , None )
@@ -1161,8 +1221,9 @@ pub mod tests {
11611221
11621222 assert ! ( once) ;
11631223
1164- let object_store = iceberg_catalog
1165- . default_object_store ( iceberg_rust:: object_store:: Bucket :: S3 ( "warehouse" ) ) ;
1224+ let object_store = object_store
1225+ . build ( Bucket :: from_path ( "s3://warehouse" ) . unwrap ( ) )
1226+ . unwrap ( ) ;
11661227
11671228 let version_hint = object_store
11681229 . get ( & strip_prefix ( "s3://warehouse/tpch/lineitem/metadata/version-hint.text" ) . into ( ) )
0 commit comments