@@ -24,9 +24,7 @@ use std::{any::Any, str::FromStr, sync::Arc};
2424
2525use crate :: datasource:: {
2626 create_ordering,
27- file_format:: {
28- file_compression_type:: FileCompressionType , FileFormat , FilePushdownSupport ,
29- } ,
27+ file_format:: { file_compression_type:: FileCompressionType , FileFormat } ,
3028 physical_plan:: FileSinkConfig ,
3129} ;
3230use crate :: execution:: context:: SessionState ;
@@ -35,22 +33,19 @@ use datafusion_common::{config_err, DataFusionError, Result};
3533use datafusion_datasource:: file_scan_config:: { FileScanConfig , FileScanConfigBuilder } ;
3634use datafusion_datasource:: schema_adapter:: DefaultSchemaAdapterFactory ;
3735use datafusion_expr:: dml:: InsertOp ;
38- use datafusion_expr:: { utils :: conjunction , Expr , TableProviderFilterPushDown } ;
36+ use datafusion_expr:: { Expr , TableProviderFilterPushDown } ;
3937use datafusion_expr:: { SortExpr , TableType } ;
4038use datafusion_physical_plan:: empty:: EmptyExec ;
4139use datafusion_physical_plan:: { ExecutionPlan , Statistics } ;
4240
4341use arrow:: datatypes:: { DataType , Field , Schema , SchemaBuilder , SchemaRef } ;
4442use datafusion_common:: {
45- config_datafusion_err, internal_err, plan_err, project_schema, Constraints ,
46- SchemaExt , ToDFSchema ,
43+ config_datafusion_err, internal_err, plan_err, project_schema, Constraints , SchemaExt ,
4744} ;
4845use datafusion_execution:: cache:: {
4946 cache_manager:: FileStatisticsCache , cache_unit:: DefaultFileStatisticsCache ,
5047} ;
51- use datafusion_physical_expr:: {
52- create_physical_expr, LexOrdering , PhysicalSortRequirement ,
53- } ;
48+ use datafusion_physical_expr:: { LexOrdering , PhysicalSortRequirement } ;
5449
5550use async_trait:: async_trait;
5651use datafusion_catalog:: Session ;
@@ -941,19 +936,6 @@ impl TableProvider for ListingTable {
941936 None => { } // no ordering required
942937 } ;
943938
944- let filters = match conjunction ( filters. to_vec ( ) ) {
945- Some ( expr) => {
946- let table_df_schema = self . table_schema . as_ref ( ) . clone ( ) . to_dfschema ( ) ?;
947- let filters = create_physical_expr (
948- & expr,
949- & table_df_schema,
950- state. execution_props ( ) ,
951- ) ?;
952- Some ( filters)
953- }
954- None => None ,
955- } ;
956-
957939 let Some ( object_store_url) =
958940 self . table_paths . first ( ) . map ( ListingTableUrl :: object_store)
959941 else {
@@ -978,7 +960,6 @@ impl TableProvider for ListingTable {
978960 . with_output_ordering ( output_ordering)
979961 . with_table_partition_cols ( table_partition_cols)
980962 . build ( ) ,
981- filters. as_ref ( ) ,
982963 )
983964 . await
984965 }
@@ -1002,18 +983,6 @@ impl TableProvider for ListingTable {
1002983 return Ok ( TableProviderFilterPushDown :: Exact ) ;
1003984 }
1004985
1005- // if we can't push it down completely with only the filename-based/path-based
1006- // column names, then we should check if we can do parquet predicate pushdown
1007- let supports_pushdown = self . options . format . supports_filters_pushdown (
1008- & self . file_schema ,
1009- & self . table_schema ,
1010- & [ filter] ,
1011- ) ?;
1012-
1013- if supports_pushdown == FilePushdownSupport :: Supported {
1014- return Ok ( TableProviderFilterPushDown :: Exact ) ;
1015- }
1016-
1017986 Ok ( TableProviderFilterPushDown :: Inexact )
1018987 } )
1019988 . collect ( )
0 commit comments