alamb commented on code in PR #25196:
URL: https://github.com/apache/datafusion/pull/25196#discussion_r4056695664
##########
datafusion/expr/src/utils.rs:
##########
@@ -1485,6 +1485,24 @@ pub fn format_state_name(name: &str, state_name: &str)
-> String {
format!("{name}[{state_name}]")
}
+/// Creates aggregate state fields for ordering expressions with unique names.
+///
+/// Each field is renamed using the aggregate name and its ordering position.
+pub fn ordering_state_fields(name: &str, ordering_fields: &[FieldRef]) ->
Vec<FieldRef> {
Review Comment:
You can avoid the Vec / allocation here by returning `impl Iterator<Item =
FieldRef>` -- I took the liberty of making that change as I was about to merge
this PR
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]