@@ -34,7 +34,7 @@ use datafusion_common::{
3434} ;
3535
3636/// Holds the state of evaluating a window function
37- #[ derive( Debug ) ]
37+ #[ derive( Debug , Clone ) ]
3838pub struct WindowAggState {
3939 /// The range that we calculate the window function
4040 pub window_frame_range : Range < usize > ,
@@ -112,7 +112,7 @@ impl WindowAggState {
112112}
113113
114114/// This object stores the window frame state for use in incremental calculations.
115- #[ derive( Debug ) ]
115+ #[ derive( Debug , Clone ) ]
116116pub enum WindowFrameContext {
117117 /// ROWS frames are inherently stateless.
118118 Rows ( Arc < WindowFrame > ) ,
@@ -240,7 +240,7 @@ impl WindowFrameContext {
240240}
241241
242242/// State for each unique partition determined according to PARTITION BY column(s)
243- #[ derive( Debug ) ]
243+ #[ derive( Debug , Clone , PartialEq ) ]
244244pub struct PartitionBatchState {
245245 /// The record batch belonging to current partition
246246 pub record_batch : RecordBatch ,
@@ -282,7 +282,7 @@ impl PartitionBatchState {
282282/// ranges of data while processing RANGE frames.
283283/// Attribute `sort_options` stores the column ordering specified by the ORDER
284284/// BY clause. This information is used to calculate the range.
285- #[ derive( Debug , Default ) ]
285+ #[ derive( Debug , Default , Clone ) ]
286286pub struct WindowFrameStateRange {
287287 sort_options : Vec < SortOptions > ,
288288}
@@ -454,7 +454,7 @@ impl WindowFrameStateRange {
454454
455455/// This structure encapsulates all the state information we require as we
456456/// scan groups of data while processing window frames.
457- #[ derive( Debug , Default ) ]
457+ #[ derive( Debug , Default , Clone ) ]
458458pub struct WindowFrameStateGroups {
459459 /// A tuple containing group values and the row index where the group ends.
460460 /// Example: [[1, 1], [1, 1], [2, 1], [2, 1], ...] would correspond to
0 commit comments