@@ -22,40 +22,16 @@ use std::sync::Arc;
2222use datafusion_ffi:: proto:: logical_extension_codec:: FFI_LogicalExtensionCodec ;
2323use datafusion_ffi:: table_provider:: FFI_TableProvider ;
2424use iceberg:: TableIdent ;
25- use iceberg:: io:: { FileIOBuilder , StorageFactory } ;
25+ use iceberg:: io:: FileIOBuilder ;
2626use iceberg:: table:: StaticTable ;
2727use iceberg_datafusion:: table:: IcebergStaticTableProvider ;
28- use iceberg_storage_opendal:: OpenDalStorageFactory ;
28+ use iceberg_storage_opendal:: OpenDalResolvingStorageFactory ;
2929use pyo3:: exceptions:: { PyRuntimeError , PyValueError } ;
3030use pyo3:: prelude:: { PyAnyMethods , PyCapsuleMethods , * } ;
3131use pyo3:: types:: { PyAny , PyCapsule } ;
3232
3333use crate :: runtime:: runtime;
3434
35- /// Parse the scheme from a URL and return the appropriate StorageFactory.
36- fn storage_factory_from_path ( path : & str ) -> PyResult < Arc < dyn StorageFactory > > {
37- let scheme = path
38- . split ( "://" )
39- . next ( )
40- . ok_or_else ( || PyRuntimeError :: new_err ( format ! ( "Invalid path, missing scheme: {path}" ) ) ) ?;
41-
42- let factory: Arc < dyn StorageFactory > = match scheme {
43- "file" | "" => Arc :: new ( OpenDalStorageFactory :: Fs ) ,
44- "s3" | "s3a" => Arc :: new ( OpenDalStorageFactory :: S3 {
45- configured_scheme : scheme. to_string ( ) ,
46- customized_credential_load : None ,
47- } ) ,
48- "memory" => Arc :: new ( OpenDalStorageFactory :: Memory ) ,
49- _ => {
50- return Err ( PyRuntimeError :: new_err ( format ! (
51- "Unsupported storage scheme: {scheme}"
52- ) ) ) ;
53- }
54- } ;
55-
56- Ok ( factory)
57- }
58-
5935pub ( crate ) fn validate_pycapsule ( capsule : & Bound < PyCapsule > , name : & str ) -> PyResult < ( ) > {
6036 let capsule_name = capsule. name ( ) ?;
6137 if capsule_name. is_none ( ) {
@@ -110,7 +86,7 @@ impl PyIcebergDataFusionTable {
11086 let table_ident = TableIdent :: from_strs ( identifier)
11187 . map_err ( |e| PyRuntimeError :: new_err ( format ! ( "Invalid table identifier: {e}" ) ) ) ?;
11288
113- let factory = storage_factory_from_path ( & metadata_location ) ? ;
89+ let factory = Arc :: new ( OpenDalResolvingStorageFactory :: new ( ) ) ;
11490
11591 let mut builder = FileIOBuilder :: new ( factory) ;
11692
0 commit comments