diff --git a/datafusion/core/src/physical_plan/file_format/parquet.rs b/datafusion/core/src/physical_plan/file_format/parquet.rs index 5ac9a54f9c24..9843ecc22e4c 100644 --- a/datafusion/core/src/physical_plan/file_format/parquet.rs +++ b/datafusion/core/src/physical_plan/file_format/parquet.rs @@ -581,7 +581,10 @@ fn should_enable_page_index( ) -> bool { enable_page_index && page_pruning_predicate.is_some() - && page_pruning_predicate.as_ref().unwrap().filter_number() > 0 + && page_pruning_predicate + .as_ref() + .map(|p| p.filter_number() > 0) + .unwrap_or(false) } /// Factory of parquet file readers.