asolimando commented on code in PR #25311:
URL: https://github.com/apache/datafusion/pull/25311#discussion_r4016163224
##########
datafusion/pruning/src/pruning_predicate.rs:
##########
@@ -1792,8 +1792,9 @@ fn build_predicate_expression(
} else {
Operator::Or
};
- let change_expr = in_list
- .list()
+ let mut sorted_list: Vec<_> = in_list.list().to_vec();
+ sorted_list.sort_by_key(|a| a.to_string());
Review Comment:
The `to_string` part can be costly, is there a cheaper alternative maybe?
Anyway the ordering doesn't really matter, anything stable that is cheaper
would do, like hashing.
In case we want to keep it, we should probably be using
[sort_by_cached_key](https://doc.rust-lang.org/std/primitive.slice.html#method.sort_by_cached_key)
if the `to_string` part is finally expensive.
--
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]