From bc3f4bf98451a10292756f690b9f5ca0d4395342 Mon Sep 17 00:00:00 2001 From: Duong Cong Toai Date: Sun, 22 Sep 2024 13:19:54 +0200 Subject: [PATCH] chore: add partialord to new types --- datafusion/expr/src/logical_plan/plan.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/datafusion/expr/src/logical_plan/plan.rs b/datafusion/expr/src/logical_plan/plan.rs index 3ad200b68f46..443d23804adb 100644 --- a/datafusion/expr/src/logical_plan/plan.rs +++ b/datafusion/expr/src/logical_plan/plan.rs @@ -3306,7 +3306,7 @@ pub enum Partitioning { /// The inferred unnesting type works for both struct and list column, but the unnesting /// will only be done once (depth = 1). In case recursion is needed on a multi-dimensional /// list type, use [`ColumnUnnestList`] -#[derive(Debug, Clone, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd)] pub enum ColumnUnnestType { // Unnesting a list column, a vector of ColumnUnnestList is used because // a column can be unnested at different levels, resulting different output columns @@ -3352,7 +3352,7 @@ impl fmt::Display for ColumnUnnestType { /// │ 5 │ /// └─────────┘ /// ``` -#[derive(Debug, Clone, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd)] pub struct ColumnUnnestList { pub output_column: Column, pub depth: usize, @@ -3395,10 +3395,10 @@ impl PartialOrd for Unnest { /// The incoming logical plan pub input: &'a Arc, /// Columns to run unnest on, can be a list of (List/Struct) columns - pub exec_columns: &'a Vec, + pub exec_columns: &'a Vec<(Column, ColumnUnnestType)>, /// refer to the indices(in the input schema) of columns /// that have type list to run unnest on - pub list_type_columns: &'a Vec, + pub list_type_columns: &'a Vec<(usize, ColumnUnnestList)>, /// refer to the indices (in the input schema) of columns /// that have type struct to run unnest on pub struct_type_columns: &'a Vec,