From fa423d8207b0952d4953d09cd7a5b8a5df271077 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Mon, 16 Dec 2024 18:54:05 +0100 Subject: [PATCH] Fix re assemble the groups after each window function execution --- crates/gitql-engine/src/engine_window_functions.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/gitql-engine/src/engine_window_functions.rs b/crates/gitql-engine/src/engine_window_functions.rs index ffc6a89..5caa492 100644 --- a/crates/gitql-engine/src/engine_window_functions.rs +++ b/crates/gitql-engine/src/engine_window_functions.rs @@ -57,7 +57,6 @@ pub(crate) fn execute_window_functions_statement( for argument in function.arguments.iter() { let argument = evaluate_expression(env, argument, &gitql_object.titles, &row.values)?; - row_selected_values.push(argument); } @@ -74,7 +73,6 @@ pub(crate) fn execute_window_functions_statement( let aggregation_function = env.aggregation_function(&function.function_name).unwrap(); let aggregated_value = aggregation_function(&frame_values); - for row in frame.rows.iter_mut() { row.values[column_index] = aggregated_value.clone(); } @@ -89,6 +87,7 @@ pub(crate) fn execute_window_functions_statement( }; } } + gitql_object.flat(); } // Evaluate Expressions that depend on Window Functions evaluation @@ -110,10 +109,9 @@ pub(crate) fn execute_window_functions_statement( } } } + gitql_object.flat(); } - gitql_object.flat(); - Ok(()) }