comphead commented on code in PR #16970:
URL: https://github.com/apache/datafusion/pull/16970#discussion_r2245812112
##########
datafusion/optimizer/src/optimizer.rs:
##########
@@ -137,13 +137,15 @@ impl OptimizerContext {
Self {
query_execution_start_time: Utc::now(),
alias_generator: Arc::new(AliasGenerator::new()),
- options,
+ options: Arc::new(options),
}
}
/// Specify whether to enable the filter_null_keys rule
pub fn filter_null_keys(mut self, filter_null_keys: bool) -> Self {
- self.options.optimizer.filter_null_join_keys = filter_null_keys;
+ Arc::make_mut(&mut self.options)
Review Comment:
using `make_mut` can cause extra inner cloning if other Arcs already points
to the object https://doc.rust-lang.org/std/sync/struct.Arc.html#method.make_mut
--
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]