Skip to content

Commit 585bc3a

Browse files
authored
Remove ObjectStore from FileScanConfig and ListingTableConfig (#2668)
* Remove ObjectStore from FileScanConfig and ListingTableConfig * Update ballista pin
1 parent 45a975d commit 585bc3a

File tree

20 files changed

+152
-176
lines changed

20 files changed

+152
-176
lines changed

benchmarks/src/bin/tpch.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ use datafusion::{
4444
};
4545
use datafusion::{
4646
arrow::util::pretty,
47-
datafusion_data_access::object_store::local::LocalFileSystem,
4847
datasource::listing::{ListingOptions, ListingTable, ListingTableConfig},
4948
};
5049

@@ -427,7 +426,7 @@ fn get_table(
427426
};
428427

429428
let table_path = ListingTableUrl::parse(path)?;
430-
let config = ListingTableConfig::new(Arc::new(LocalFileSystem {}), table_path)
429+
let config = ListingTableConfig::new(table_path)
431430
.with_listing_options(options)
432431
.with_schema(schema);
433432

datafusion-examples/examples/flight_server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use std::pin::Pin;
1919
use std::sync::Arc;
2020

2121
use arrow_flight::SchemaAsIpc;
22-
use datafusion::datafusion_data_access::object_store::local::LocalFileSystem;
2322
use datafusion::datasource::file_format::parquet::ParquetFormat;
2423
use datafusion::datasource::listing::{ListingOptions, ListingTableUrl};
2524
use futures::Stream;
@@ -71,8 +70,9 @@ impl FlightService for FlightServiceImpl {
7170
let table_path =
7271
ListingTableUrl::parse(&request.path[0]).map_err(to_tonic_err)?;
7372

73+
let ctx = SessionContext::new();
7474
let schema = listing_options
75-
.infer_schema(Arc::new(LocalFileSystem {}), &table_path)
75+
.infer_schema(&ctx.state(), &table_path)
7676
.await
7777
.unwrap();
7878

datafusion/core/benches/sort_limit_query_sql.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#[macro_use]
1919
extern crate criterion;
2020
use criterion::Criterion;
21-
use datafusion::datafusion_data_access::object_store::local::LocalFileSystem;
2221
use datafusion::datasource::file_format::csv::CsvFormat;
2322
use datafusion::datasource::listing::{
2423
ListingOptions, ListingTable, ListingTableConfig, ListingTableUrl,
@@ -71,7 +70,7 @@ fn create_context() -> Arc<Mutex<SessionContext>> {
7170
// create CSV data source
7271
let listing_options = ListingOptions::new(Arc::new(CsvFormat::default()));
7372

74-
let config = ListingTableConfig::new(Arc::new(LocalFileSystem {}), table_path)
73+
let config = ListingTableConfig::new(table_path)
7574
.with_listing_options(listing_options)
7675
.with_schema(schema);
7776

datafusion/core/src/catalog/schema.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,10 @@ mod tests {
171171

172172
let ctx = SessionContext::new();
173173
let store = Arc::new(LocalFileSystem {});
174-
ctx.runtime_env()
175-
.register_object_store("file", store.clone());
174+
ctx.runtime_env().register_object_store("file", store);
176175

177-
let config = ListingTableConfig::new(store, table_path)
178-
.infer()
176+
let config = ListingTableConfig::new(table_path)
177+
.infer(&ctx.state())
179178
.await
180179
.unwrap();
181180
let table = ListingTable::try_new(config).unwrap();

datafusion/core/src/datasource/file_format/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ pub(crate) mod test_util {
115115
let exec = format
116116
.create_physical_plan(
117117
FileScanConfig {
118-
object_store: store,
119118
object_store_url: ObjectStoreUrl::local_filesystem(),
120119
file_schema,
121120
file_groups,

0 commit comments

Comments
 (0)