alamb commented on issue #22189:
URL: https://github.com/apache/datafusion/issues/22189#issuecomment-4500664620

   And instead of 
   
   ```rust
           let row_groups_pruned_bloom_filter = MetricBuilder::new(metrics)
               .with_new_label("filename", filename.to_string())
               .with_type(MetricType::Summary)
               .pruning_metrics("row_groups_pruned_bloom_filter", partition);
   
           let limit_pruned_row_groups = MetricBuilder::new(metrics)
               .with_new_label("filename", filename.to_string())
               .with_type(MetricType::Summary)
               .pruning_metrics("limit_pruned_row_groups", partition);
   ```
   
   It could look something like
   
   ```rust
           // Allocate a single copy of the filename
           let shared_filename = Arc::from(filename.as_str());
   
           let row_groups_pruned_bloom_filter = MetricBuilder::new(metrics)
               .with_new_label("filename", Arc::clone(&shared_filename))     // 
<---- Only copy Arc here, not new string
               .with_type(MetricType::Summary)
               .pruning_metrics("row_groups_pruned_bloom_filter", partition); 
   
           let limit_pruned_row_groups = MetricBuilder::new(metrics)
               .with_new_label("filename", Arc::clone(&shared_filename))     // 
<---- Only copy Arc here, not new string
               .with_type(MetricType::Summary)
               .pruning_metrics("limit_pruned_row_groups", partition);
   ```


-- 
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]

Reply via email to