corasaurus-hex commented on code in PR #18557:
URL: https://github.com/apache/datafusion/pull/18557#discussion_r2507366558


##########
datafusion/physical-expr/src/expressions/literal.rs:
##########
@@ -137,6 +137,7 @@ impl PhysicalExpr for Literal {
 }
 
 /// Create a literal expression
+#[allow(clippy::needless_pass_by_value)]

Review Comment:
   Changing this to be `&T` produced the following errors:
   
   ```
   ❯ ./ci/scripts/rust_clippy.sh 2>&1 | grep '^error\[' -A1 | grep '^  ' | sort 
| grep -o -E 'datafusion[^:]+' | uniq -c | sort -n | awk '{ print $1, 
"error(s)\t", $2}
   1 error(s)    datafusion/physical-expr/src/planner.rs
   2 error(s)    datafusion/physical-expr/src/expressions/literal.rs
   3 error(s)    datafusion/physical-expr/src/simplifier/mod.rs
   4 error(s)    datafusion/physical-expr/src/utils/mod.rs
   5 error(s)    datafusion/physical-expr/src/equivalence/class.rs
   6 error(s)    datafusion/physical-expr/src/expressions/dynamic_filters.rs
   18 error(s)   datafusion/physical-expr/src/simplifier/unwrap_cast.rs
   22 error(s)   datafusion/physical-expr/src/expressions/binary.rs
   62 error(s)   datafusion/physical-expr/src/expressions/in_list.rs
   79 error(s)   datafusion/physical-expr/src/expressions/case.rs
   82 error(s)   datafusion/physical-expr/src/expressions/in_list.rs
   
   ❯ ./ci/scripts/rust_clippy.sh 2>&1 | grep '^error\[' | sort | uniq -c | sort 
-n
      1 error[E0599]: the method `collect` exists for struct `Map<Range<i32>, 
fn(&_) -> Arc<dyn PhysicalExpr> {lit::<_>}>`, but its trait bounds were not 
satisfied
      1 error[E0631]: type mismatch in function arguments
      4 error[E0277]: the size for values of type `[{integer}]` cannot be known 
at compilation time
      4 error[E0277]: the trait bound `[{integer}]: datafusion_expr::Literal` 
is not satisfied
     39 error[E0277]: the size for values of type `str` cannot be known at 
compilation time
     39 error[E0277]: the trait bound `str: datafusion_expr::Literal` is not 
satisfied
    196 error[E0308]: mismatched types
   ```
   
   It's exposed publicly, too, and likely used in a lot of user code. 
Definitely not worth modifying.



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