File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,11 +2,9 @@ pub mod connection;
22pub mod connection_pool;
33pub mod table;
44pub mod utils;
5- pub mod write;
65
76use crate :: mongodb:: connection_pool:: MongoDBConnectionPool ;
87use crate :: mongodb:: table:: MongoDBTable ;
9- use crate :: mongodb:: write:: MongoDBTableWriter ;
108use arrow_schema:: ArrowError ;
119use datafusion:: datasource:: TableProvider ;
1210use datafusion:: sql:: TableReference ;
@@ -92,11 +90,12 @@ impl MongoDBTableFactory {
9290 & self ,
9391 table_reference : TableReference ,
9492 ) -> Result < Arc < dyn TableProvider + ' static > , Box < dyn std:: error:: Error + Send + Sync > > {
95- let read_provider = self . table_provider ( table_reference. clone ( ) ) . await ?;
96- Ok ( MongoDBTableWriter :: create (
97- read_provider,
98- Arc :: clone ( & self . pool ) ,
99- table_reference,
100- ) )
93+ let pool = Arc :: clone ( & self . pool ) ;
94+ let table_provider = Arc :: new (
95+ MongoDBTable :: new_writeable ( & pool, table_reference)
96+ . await
97+ . map_err ( |e| Box :: new ( e) as Box < dyn std:: error:: Error + Send + Sync > ) ?,
98+ ) ;
99+ Ok ( table_provider)
101100 }
102101}
You can’t perform that action at this time.
0 commit comments