You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ja...@apache.org on 2023/05/26 16:05:26 UTC
[arrow-datafusion] branch main updated: Minor: remove dead code (#6460)
This is an automated email from the ASF dual-hosted git repository.
jakevin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 5c19eb17e5 Minor: remove dead code (#6460)
5c19eb17e5 is described below
commit 5c19eb17e56bd573296bcafcdb2e92ba9714cccc
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Fri May 26 12:05:20 2023 -0400
Minor: remove dead code (#6460)
---
datafusion/physical-expr/src/lib.rs | 2 +-
datafusion/physical-expr/src/utils.rs | 103 ----------------------------------
2 files changed, 1 insertion(+), 104 deletions(-)
diff --git a/datafusion/physical-expr/src/lib.rs b/datafusion/physical-expr/src/lib.rs
index b65a4e892f..5dd8192def 100644
--- a/datafusion/physical-expr/src/lib.rs
+++ b/datafusion/physical-expr/src/lib.rs
@@ -60,5 +60,5 @@ pub use sort_expr::{PhysicalSortExpr, PhysicalSortRequirement};
pub use utils::{
expr_list_eq_any_order, expr_list_eq_strict_order,
normalize_expr_with_equivalence_properties, normalize_out_expr_with_columns_map,
- sort_expr_list_eq_strict_order, split_conjunction,
+ split_conjunction,
};
diff --git a/datafusion/physical-expr/src/utils.rs b/datafusion/physical-expr/src/utils.rs
index 54a18a1573..d9009ca31e 100644
--- a/datafusion/physical-expr/src/utils.rs
+++ b/datafusion/physical-expr/src/utils.rs
@@ -69,19 +69,6 @@ pub fn expr_list_eq_strict_order(
list1.len() == list2.len() && list1.iter().zip(list2.iter()).all(|(e1, e2)| e1.eq(e2))
}
-/// Strictly compare the two sort expr lists in the given order.
-///
-/// For Physical Sort Exprs, the order matters:
-///
-/// SortExpr('a','b','c') != SortExpr('c','b','a')
-#[allow(dead_code)]
-pub fn sort_expr_list_eq_strict_order(
- list1: &[PhysicalSortExpr],
- list2: &[PhysicalSortExpr],
-) -> bool {
- list1.len() == list2.len() && list1.iter().zip(list2.iter()).all(|(e1, e2)| e1.eq(e2))
-}
-
/// Assume the predicate is in the form of CNF, split the predicate to a Vec of PhysicalExprs.
///
/// For example, split "a1 = a2 AND b1 <= b2 AND c1 != c2" into ["a1 = a2", "b1 <= b2", "c1 != c2"]
@@ -959,96 +946,6 @@ mod tests {
Ok(())
}
- #[test]
- fn sort_expr_list_eq_strict_order_test() -> Result<()> {
- let list1: Vec<PhysicalSortExpr> = vec![
- PhysicalSortExpr {
- expr: Arc::new(Column::new("a", 0)),
- options: SortOptions::default(),
- },
- PhysicalSortExpr {
- expr: Arc::new(Column::new("a", 0)),
- options: SortOptions::default(),
- },
- PhysicalSortExpr {
- expr: Arc::new(Column::new("b", 1)),
- options: SortOptions::default(),
- },
- ];
-
- let list2: Vec<PhysicalSortExpr> = vec![
- PhysicalSortExpr {
- expr: Arc::new(Column::new("b", 1)),
- options: SortOptions::default(),
- },
- PhysicalSortExpr {
- expr: Arc::new(Column::new("a", 0)),
- options: SortOptions::default(),
- },
- PhysicalSortExpr {
- expr: Arc::new(Column::new("a", 0)),
- options: SortOptions::default(),
- },
- ];
-
- assert!(!sort_expr_list_eq_strict_order(
- list1.as_slice(),
- list2.as_slice()
- ));
- assert!(!sort_expr_list_eq_strict_order(
- list2.as_slice(),
- list1.as_slice()
- ));
-
- let list3: Vec<PhysicalSortExpr> = vec![
- PhysicalSortExpr {
- expr: Arc::new(Column::new("a", 0)),
- options: SortOptions::default(),
- },
- PhysicalSortExpr {
- expr: Arc::new(Column::new("b", 1)),
- options: SortOptions::default(),
- },
- PhysicalSortExpr {
- expr: Arc::new(Column::new("c", 2)),
- options: SortOptions::default(),
- },
- ];
- let list4: Vec<PhysicalSortExpr> = vec![
- PhysicalSortExpr {
- expr: Arc::new(Column::new("a", 0)),
- options: SortOptions::default(),
- },
- PhysicalSortExpr {
- expr: Arc::new(Column::new("b", 1)),
- options: SortOptions::default(),
- },
- PhysicalSortExpr {
- expr: Arc::new(Column::new("c", 2)),
- options: SortOptions::default(),
- },
- ];
-
- assert!(sort_expr_list_eq_strict_order(
- list3.as_slice(),
- list4.as_slice()
- ));
- assert!(sort_expr_list_eq_strict_order(
- list4.as_slice(),
- list3.as_slice()
- ));
- assert!(sort_expr_list_eq_strict_order(
- list3.as_slice(),
- list3.as_slice()
- ));
- assert!(sort_expr_list_eq_strict_order(
- list4.as_slice(),
- list4.as_slice()
- ));
-
- Ok(())
- }
-
#[test]
fn test_ordering_satisfy() -> Result<()> {
let crude = vec![PhysicalSortExpr {