From 2104a4626e98bf86641c1ee5db904d7497989634 Mon Sep 17 00:00:00 2001 From: Gabriel Musat Mestre Date: Mon, 21 Apr 2025 11:18:20 +0200 Subject: [PATCH] Revert "Bump MSRV to 1.82, toolchain to 1.85 (apache#14811)" --- Cargo.toml | 2 +- datafusion/common/src/table_reference.rs | 7 ++++--- datafusion/functions-aggregate/src/first_last.rs | 4 ++-- datafusion/physical-expr-common/src/sort_expr.rs | 8 +++++--- .../physical-expr/src/equivalence/properties/mod.rs | 2 +- rust-toolchain.toml | 2 +- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4f8cfa8baa871..0d7c644d8366c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,7 +73,7 @@ license = "Apache-2.0" readme = "README.md" repository = "https://github.com/apache/datafusion" # Define Minimum Supported Rust Version (MSRV) -rust-version = "1.82.0" +rust-version = "1.81.0" # Define DataFusion version version = "47.0.0" diff --git a/datafusion/common/src/table_reference.rs b/datafusion/common/src/table_reference.rs index 9b6f9696c00bb..bb53a30dcb234 100644 --- a/datafusion/common/src/table_reference.rs +++ b/datafusion/common/src/table_reference.rs @@ -193,7 +193,8 @@ impl TableReference { match self { TableReference::Bare { table } => **table == *other.table(), TableReference::Partial { schema, table } => { - **table == *other.table() && other.schema().is_none_or(|s| *s == **schema) + **table == *other.table() + && other.schema().map_or(true, |s| *s == **schema) } TableReference::Full { catalog, @@ -201,8 +202,8 @@ impl TableReference { table, } => { **table == *other.table() - && other.schema().is_none_or(|s| *s == **schema) - && other.catalog().is_none_or(|c| *c == **catalog) + && other.schema().map_or(true, |s| *s == **schema) + && other.catalog().map_or(true, |c| *c == **catalog) } } } diff --git a/datafusion/functions-aggregate/src/first_last.rs b/datafusion/functions-aggregate/src/first_last.rs index ec8c440b77e5f..26fd48ce2cb84 100644 --- a/datafusion/functions-aggregate/src/first_last.rs +++ b/datafusion/functions-aggregate/src/first_last.rs @@ -571,9 +571,9 @@ where for (idx_in_val, group_idx) in group_indices.iter().enumerate() { let group_idx = *group_idx; - let passed_filter = opt_filter.is_none_or(|x| x.value(idx_in_val)); + let passed_filter = opt_filter.map_or(true, |x| x.value(idx_in_val)); - let is_set = is_set_arr.is_none_or(|x| x.value(idx_in_val)); + let is_set = is_set_arr.map_or(true, |x| x.value(idx_in_val)); if !passed_filter || !is_set { continue; diff --git a/datafusion/physical-expr-common/src/sort_expr.rs b/datafusion/physical-expr-common/src/sort_expr.rs index 3a54b5b403995..a4481e5798f15 100644 --- a/datafusion/physical-expr-common/src/sort_expr.rs +++ b/datafusion/physical-expr-common/src/sort_expr.rs @@ -183,11 +183,13 @@ impl PhysicalSortExpr { let nullable = self.expr.nullable(schema).unwrap_or(true); self.expr.eq(&requirement.expr) && if nullable { - requirement.options.is_none_or(|opts| self.options == opts) + requirement + .options + .map_or(true, |opts| self.options == opts) } else { requirement .options - .is_none_or(|opts| self.options.descending == opts.descending) + .map_or(true, |opts| self.options.descending == opts.descending) } } } @@ -302,7 +304,7 @@ impl PhysicalSortRequirement { self.expr.eq(&other.expr) && other .options - .is_none_or(|other_opts| self.options == Some(other_opts)) + .map_or(true, |other_opts| self.options == Some(other_opts)) } #[deprecated(since = "43.0.0", note = "use LexRequirement::from_lex_ordering")] diff --git a/datafusion/physical-expr/src/equivalence/properties/mod.rs b/datafusion/physical-expr/src/equivalence/properties/mod.rs index 5b34a02a91424..19de773699f3b 100644 --- a/datafusion/physical-expr/src/equivalence/properties/mod.rs +++ b/datafusion/physical-expr/src/equivalence/properties/mod.rs @@ -680,7 +680,7 @@ impl EquivalenceProperties { req.expr.eq(&existing.expr) && req .options - .is_none_or(|req_opts| req_opts == existing.options) + .map_or(true, |req_opts| req_opts == existing.options) }, ) }) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index a85e6fa54299d..bd764d2010186 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -19,5 +19,5 @@ # to compile this workspace and run CI jobs. [toolchain] -channel = "1.86.0" +channel = "1.84.1" components = ["rustfmt", "clippy"]