You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve performance of first_value by implementing special GroupsAccumulator (#15266)
* Improve speed of first_value by implementing special GroupsAccumulator
* rename and other improvements
* `append_n` -> `resize`
* address comment
* use HashMap::entry
* remove hashMap in get_filtered_min_of_each_group
let distinct = if*is_distinct {"DISTINCT "}else{""};
491
504
alias_gen += 1;
492
-
let function = format!("{function_name}({distinct}{argument}) as {alias}");
505
+
506
+
let(order_by, null_opt) = if function_name.eq("first_value"){
507
+
(
508
+
self.order_by(&order_by_black_list),/* Among the order by columns, at most one group by column can be included to avoid all order by column values being identical */
509
+
self.null_opt(),
510
+
)
511
+
}else{
512
+
("".to_string(),"".to_string())
513
+
};
514
+
515
+
let function = format!(
516
+
"{function_name}({distinct}{argument}{order_by}) {null_opt} as {alias}"
0 commit comments