Skip to content

Commit 3df74b6

Browse files
authored
rm downcast (apache#15575)
1 parent 0d111c4 commit 3df74b6

File tree

1 file changed

+4
-8
lines changed
  • datafusion/core/src/datasource/listing

1 file changed

+4
-8
lines changed

datafusion/core/src/datasource/listing/table.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -875,15 +875,13 @@ impl TableProvider for ListingTable {
875875
filters.iter().cloned().partition(|filter| {
876876
can_be_evaluted_for_partition_pruning(&table_partition_col_names, filter)
877877
});
878-
// TODO (https://github.com/apache/datafusion/issues/11600) remove downcast_ref from here?
879-
let session_state = state.as_any().downcast_ref::<SessionState>().unwrap();
880878

881879
// We should not limit the number of partitioned files to scan if there are filters and limit
882880
// at the same time. This is because the limit should be applied after the filters are applied.
883881
let statistic_file_limit = if filters.is_empty() { limit } else { None };
884882

885883
let (mut partitioned_file_lists, statistics) = self
886-
.list_files_for_scan(session_state, &partition_filters, statistic_file_limit)
884+
.list_files_for_scan(state, &partition_filters, statistic_file_limit)
887885
.await?;
888886

889887
// if no files need to be read, return an `EmptyExec`
@@ -942,7 +940,7 @@ impl TableProvider for ListingTable {
942940
self.options
943941
.format
944942
.create_physical_plan(
945-
session_state,
943+
state,
946944
FileScanConfigBuilder::new(
947945
object_store_url,
948946
Arc::clone(&self.file_schema),
@@ -1022,10 +1020,8 @@ impl TableProvider for ListingTable {
10221020
// Get the object store for the table path.
10231021
let store = state.runtime_env().object_store(table_path)?;
10241022

1025-
// TODO (https://github.com/apache/datafusion/issues/11600) remove downcast_ref from here?
1026-
let session_state = state.as_any().downcast_ref::<SessionState>().unwrap();
10271023
let file_list_stream = pruned_partition_list(
1028-
session_state,
1024+
state,
10291025
store.as_ref(),
10301026
table_path,
10311027
&[],
@@ -1073,7 +1069,7 @@ impl TableProvider for ListingTable {
10731069

10741070
self.options()
10751071
.format
1076-
.create_writer_physical_plan(input, session_state, config, order_requirements)
1072+
.create_writer_physical_plan(input, state, config, order_requirements)
10771073
.await
10781074
}
10791075

0 commit comments

Comments
 (0)