File tree Expand file tree Collapse file tree 3 files changed +38
-4
lines changed Expand file tree Collapse file tree 3 files changed +38
-4
lines changed Original file line number Diff line number Diff line change @@ -556,7 +556,7 @@ impl FileCatalog {
556
556
} ) ;
557
557
files
558
558
. into_iter ( )
559
- . last ( )
559
+ . next_back ( )
560
560
. ok_or ( IcebergError :: CatalogNotFound )
561
561
}
562
562
@@ -588,7 +588,7 @@ fn trim_start_path(path: &str) -> &str {
588
588
589
589
fn parse_version ( path : & str ) -> Result < u64 , IcebergError > {
590
590
path. split ( '/' )
591
- . last ( )
591
+ . next_back ( )
592
592
. ok_or ( IcebergError :: InvalidFormat ( "Metadata location" . to_owned ( ) ) ) ?
593
593
. trim_start_matches ( 'v' )
594
594
. trim_end_matches ( ".metadata.json" )
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ use iceberg_rust::{
20
20
identifier:: Identifier ,
21
21
namespace:: Namespace ,
22
22
tabular:: Tabular ,
23
- Catalog ,
23
+ Catalog , CatalogList ,
24
24
} ,
25
25
error:: Error as IcebergError ,
26
26
materialized_view:: MaterializedView ,
@@ -948,6 +948,40 @@ impl Catalog for GlueCatalog {
948
948
}
949
949
}
950
950
951
+ #[ derive( Debug , Clone ) ]
952
+ pub struct GlueCatalogList {
953
+ name : String ,
954
+ config : SdkConfig ,
955
+ object_store_builder : ObjectStoreBuilder ,
956
+ }
957
+
958
+ impl GlueCatalogList {
959
+ pub fn new ( name : & str , config : & SdkConfig , object_store_builder : ObjectStoreBuilder ) -> Self {
960
+ Self {
961
+ name : name. to_owned ( ) ,
962
+ config : config. to_owned ( ) ,
963
+ object_store_builder,
964
+ }
965
+ }
966
+ }
967
+
968
+ #[ async_trait]
969
+ impl CatalogList for GlueCatalogList {
970
+ fn catalog ( & self , name : & str ) -> Option < Arc < dyn Catalog > > {
971
+ if self . name == name {
972
+ Some ( Arc :: new (
973
+ GlueCatalog :: new ( & self . config , & self . name , self . object_store_builder . clone ( ) )
974
+ . unwrap ( ) ,
975
+ ) )
976
+ } else {
977
+ None
978
+ }
979
+ }
980
+ async fn list_catalogs ( & self ) -> Vec < String > {
981
+ vec ! [ self . name. clone( ) ]
982
+ }
983
+ }
984
+
951
985
#[ cfg( test) ]
952
986
pub mod tests {
953
987
use aws_config:: { BehaviorVersion , Region } ;
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ impl Table {
192
192
///
193
193
/// # Returns
194
194
/// * `Result<Vec<ManifestListEntry>, Error>` - Vector of manifest entries in the range,
195
- /// or an empty vector if no current snapshot exists
195
+ /// or an empty vector if no current snapshot exists
196
196
///
197
197
/// # Errors
198
198
/// Returns an error if:
You can’t perform that action at this time.
0 commit comments