diff --git a/datafusion/catalog-listing/Cargo.toml b/datafusion/catalog-listing/Cargo.toml
index be1374b371485..388cdac71f3c0 100644
--- a/datafusion/catalog-listing/Cargo.toml
+++ b/datafusion/catalog-listing/Cargo.toml
@@ -20,7 +20,7 @@ name = "datafusion-catalog-listing"
description = "datafusion-catalog-listing"
readme = "README.md"
authors.workspace = true
-edition.workspace = true
+edition = "2024"
homepage.workspace = true
license.workspace = true
repository.workspace = true
diff --git a/datafusion/catalog-listing/src/config.rs b/datafusion/catalog-listing/src/config.rs
index 3370d2ea75535..e3cd01a191924 100644
--- a/datafusion/catalog-listing/src/config.rs
+++ b/datafusion/catalog-listing/src/config.rs
@@ -19,9 +19,9 @@ use crate::options::ListingOptions;
use arrow::datatypes::{DataType, Schema, SchemaRef};
use datafusion_catalog::Session;
use datafusion_common::{config_err, internal_err};
+use datafusion_datasource::ListingTableUrl;
use datafusion_datasource::file_compression_type::FileCompressionType;
use datafusion_datasource::schema_adapter::SchemaAdapterFactory;
-use datafusion_datasource::ListingTableUrl;
use datafusion_physical_expr_adapter::PhysicalExprAdapterFactory;
use std::str::FromStr;
use std::sync::Arc;
diff --git a/datafusion/catalog-listing/src/helpers.rs b/datafusion/catalog-listing/src/helpers.rs
index 34073338fbd7e..ea016015cebd3 100644
--- a/datafusion/catalog-listing/src/helpers.rs
+++ b/datafusion/catalog-listing/src/helpers.rs
@@ -21,10 +21,10 @@ use std::mem;
use std::sync::Arc;
use datafusion_catalog::Session;
-use datafusion_common::{assert_or_internal_err, HashMap, Result, ScalarValue};
+use datafusion_common::{HashMap, Result, ScalarValue, assert_or_internal_err};
use datafusion_datasource::ListingTableUrl;
use datafusion_datasource::PartitionedFile;
-use datafusion_expr::{lit, utils, BinaryExpr, Operator};
+use datafusion_expr::{BinaryExpr, Operator, lit, utils};
use arrow::{
array::AsArray,
@@ -33,7 +33,7 @@ use arrow::{
};
use datafusion_expr::execution_props::ExecutionProps;
use futures::stream::FuturesUnordered;
-use futures::{stream::BoxStream, StreamExt, TryStreamExt};
+use futures::{StreamExt, TryStreamExt, stream::BoxStream};
use log::{debug, trace};
use datafusion_common::tree_node::{TreeNode, TreeNodeRecursion};
@@ -51,7 +51,7 @@ use object_store::{ObjectMeta, ObjectStore};
pub fn expr_applicable_for_cols(col_names: &[&str], expr: &Expr) -> bool {
let mut is_applicable = true;
expr.apply(|expr| match expr {
- Expr::Column(Column { ref name, .. }) => {
+ Expr::Column(Column { name, .. }) => {
is_applicable &= col_names.contains(&name.as_str());
if is_applicable {
Ok(TreeNodeRecursion::Jump)
@@ -247,16 +247,11 @@ fn populate_partition_values<'a>(
partition_values: &mut HashMap<&'a str, PartitionValue>,
filter: &'a Expr,
) {
- if let Expr::BinaryExpr(BinaryExpr {
- ref left,
- op,
- ref right,
- }) = filter
- {
+ if let Expr::BinaryExpr(BinaryExpr { left, op, right }) = filter {
match op {
Operator::Eq => match (left.as_ref(), right.as_ref()) {
- (Expr::Column(Column { ref name, .. }), Expr::Literal(val, _))
- | (Expr::Literal(val, _), Expr::Column(Column { ref name, .. })) => {
+ (Expr::Column(Column { name, .. }), Expr::Literal(val, _))
+ | (Expr::Literal(val, _), Expr::Column(Column { name, .. })) => {
if partition_values
.insert(name, PartitionValue::Single(val.to_string()))
.is_some()
@@ -466,7 +461,7 @@ mod tests {
use std::ops::Not;
use super::*;
- use datafusion_expr::{case, col, lit, Expr};
+ use datafusion_expr::{Expr, case, col, lit};
#[test]
fn test_split_files() {
diff --git a/datafusion/catalog-listing/src/options.rs b/datafusion/catalog-listing/src/options.rs
index 7da8005f90ec2..146f98d62335e 100644
--- a/datafusion/catalog-listing/src/options.rs
+++ b/datafusion/catalog-listing/src/options.rs
@@ -18,12 +18,12 @@
use arrow::datatypes::{DataType, SchemaRef};
use datafusion_catalog::Session;
use datafusion_common::plan_err;
-use datafusion_datasource::file_format::FileFormat;
use datafusion_datasource::ListingTableUrl;
+use datafusion_datasource::file_format::FileFormat;
use datafusion_execution::config::SessionConfig;
use datafusion_expr::SortExpr;
use futures::StreamExt;
-use futures::{future, TryStreamExt};
+use futures::{TryStreamExt, future};
use itertools::Itertools;
use std::sync::Arc;
diff --git a/datafusion/catalog-listing/src/table.rs b/datafusion/catalog-listing/src/table.rs
index 2e7453e4ff4d8..3f2860947177c 100644
--- a/datafusion/catalog-listing/src/table.rs
+++ b/datafusion/catalog-listing/src/table.rs
@@ -23,8 +23,8 @@ use async_trait::async_trait;
use datafusion_catalog::{ScanArgs, ScanResult, Session, TableProvider};
use datafusion_common::stats::Precision;
use datafusion_common::{
- internal_datafusion_err, plan_err, project_schema, Constraints, DataFusionError,
- SchemaExt, Statistics,
+ Constraints, DataFusionError, SchemaExt, Statistics, internal_datafusion_err,
+ plan_err, project_schema,
};
use datafusion_datasource::file::FileSource;
use datafusion_datasource::file_groups::FileGroup;
@@ -34,7 +34,7 @@ use datafusion_datasource::schema_adapter::{
DefaultSchemaAdapterFactory, SchemaAdapter, SchemaAdapterFactory,
};
use datafusion_datasource::{
- compute_all_files_statistics, ListingTableUrl, PartitionedFile, TableSchema,
+ ListingTableUrl, PartitionedFile, TableSchema, compute_all_files_statistics,
};
use datafusion_execution::cache::cache_manager::FileStatisticsCache;
use datafusion_execution::cache::cache_unit::DefaultFileStatisticsCache;
@@ -44,9 +44,9 @@ use datafusion_expr::{Expr, TableProviderFilterPushDown, TableType};
use datafusion_physical_expr::create_lex_ordering;
use datafusion_physical_expr_adapter::PhysicalExprAdapterFactory;
use datafusion_physical_expr_common::sort_expr::LexOrdering;
-use datafusion_physical_plan::empty::EmptyExec;
use datafusion_physical_plan::ExecutionPlan;
-use futures::{future, stream, Stream, StreamExt, TryStreamExt};
+use datafusion_physical_plan::empty::EmptyExec;
+use futures::{Stream, StreamExt, TryStreamExt, future, stream};
use object_store::ObjectStore;
use std::any::Any;
use std::collections::HashMap;
@@ -493,7 +493,9 @@ impl TableProvider for ListingTable {
if new_groups.len() <= self.options.target_partitions {
partitioned_file_lists = new_groups;
} else {
- log::debug!("attempted to split file groups by statistics, but there were more file groups than target_partitions; falling back to unordered")
+ log::debug!(
+ "attempted to split file groups by statistics, but there were more file groups than target_partitions; falling back to unordered"
+ )
}
}
None => {} // no ordering required
@@ -817,28 +819,25 @@ async fn get_files_with_limit(
let file = file_result?;
// Update file statistics regardless of state
- if collect_stats {
- if let Some(file_stats) = &file.statistics {
- num_rows = if file_group.is_empty() {
- // For the first file, just take its row count
- file_stats.num_rows
- } else {
- // For subsequent files, accumulate the counts
- num_rows.add(&file_stats.num_rows)
- };
- }
+ if collect_stats && let Some(file_stats) = &file.statistics {
+ num_rows = if file_group.is_empty() {
+ // For the first file, just take its row count
+ file_stats.num_rows
+ } else {
+ // For subsequent files, accumulate the counts
+ num_rows.add(&file_stats.num_rows)
+ };
}
// Always add the file to our group
file_group.push(file);
// Check if we've hit the limit (if one was specified)
- if let Some(limit) = limit {
- if let Precision::Exact(row_count) = num_rows {
- if row_count > limit {
- state = ProcessingState::ReachedLimit;
- }
- }
+ if let Some(limit) = limit
+ && let Precision::Exact(row_count) = num_rows
+ && row_count > limit
+ {
+ state = ProcessingState::ReachedLimit;
}
}
// If we still have files in the stream, it means that the limit kicked
diff --git a/datafusion/catalog/Cargo.toml b/datafusion/catalog/Cargo.toml
index 1009e9aee477b..2d9f26ea50806 100644
--- a/datafusion/catalog/Cargo.toml
+++ b/datafusion/catalog/Cargo.toml
@@ -20,7 +20,7 @@ name = "datafusion-catalog"
description = "datafusion-catalog"
readme = "README.md"
authors.workspace = true
-edition.workspace = true
+edition = "2024"
homepage.workspace = true
license.workspace = true
repository.workspace = true
diff --git a/datafusion/catalog/src/async.rs b/datafusion/catalog/src/async.rs
index c2e760deab00c..1b8039d828fdb 100644
--- a/datafusion/catalog/src/async.rs
+++ b/datafusion/catalog/src/async.rs
@@ -18,7 +18,7 @@
use std::sync::Arc;
use async_trait::async_trait;
-use datafusion_common::{error::Result, not_impl_err, HashMap, TableReference};
+use datafusion_common::{HashMap, TableReference, error::Result, not_impl_err};
use datafusion_execution::config::SessionConfig;
use crate::{CatalogProvider, CatalogProviderList, SchemaProvider, TableProvider};
@@ -60,7 +60,9 @@ impl SchemaProvider for ResolvedSchemaProvider {
}
fn deregister_table(&self, name: &str) -> Result