File tree Expand file tree Collapse file tree
datafusion/functions-window/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ impl WindowUDFImpl for WindowShift {
264264 ) -> Result < Box < dyn PartitionEvaluator > > {
265265 let shift_offset =
266266 get_scalar_value_from_args ( partition_evaluator_args. input_exprs ( ) , 1 ) ?
267- . map ( get_signed_integer)
267+ . map ( |v| get_signed_integer ( & v ) )
268268 . map_or ( Ok ( None ) , |v| v. map ( Some ) )
269269 . map ( |n| self . kind . shift_offset ( n) )
270270 . map ( |offset| {
Original file line number Diff line number Diff line change 1515// specific language governing permissions and limitations
1616// under the License.
1717
18+ // https://github.com/apache/datafusion/issues/18503
19+ #![ deny( clippy:: needless_pass_by_value) ]
20+ #![ cfg_attr( test, allow( clippy:: needless_pass_by_value) ) ]
1821#![ doc(
1922 html_logo_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" ,
2023 html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg"
Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ impl WindowUDFImpl for NthValue {
282282 exec_datafusion_err ! (
283283 "Expected a signed integer literal for the second argument of nth_value" )
284284 } ) ?
285- . map ( get_signed_integer)
285+ . map ( |v| get_signed_integer ( & v ) )
286286 {
287287 Some ( Ok ( n) ) => {
288288 if partition_evaluator_args. is_reversed ( ) {
Original file line number Diff line number Diff line change @@ -135,10 +135,10 @@ impl WindowUDFImpl for Ntile {
135135 }
136136
137137 if scalar_n. is_unsigned ( ) {
138- let n = get_unsigned_integer ( scalar_n) ?;
138+ let n = get_unsigned_integer ( & scalar_n) ?;
139139 Ok ( Box :: new ( NtileEvaluator { n } ) )
140140 } else {
141- let n: i64 = get_signed_integer ( scalar_n) ?;
141+ let n: i64 = get_signed_integer ( & scalar_n) ?;
142142 if n <= 0 {
143143 return exec_err ! ( "NTILE requires a positive integer" ) ;
144144 }
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ use datafusion_physical_expr::expressions::Literal;
2121use datafusion_physical_expr_common:: physical_expr:: PhysicalExpr ;
2222use std:: sync:: Arc ;
2323
24- pub ( crate ) fn get_signed_integer ( value : ScalarValue ) -> Result < i64 > {
24+ pub ( crate ) fn get_signed_integer ( value : & ScalarValue ) -> Result < i64 > {
2525 if value. is_null ( ) {
2626 return Ok ( 0 ) ;
2727 }
@@ -52,7 +52,7 @@ pub(crate) fn get_scalar_value_from_args(
5252 } )
5353}
5454
55- pub ( crate ) fn get_unsigned_integer ( value : ScalarValue ) -> Result < u64 > {
55+ pub ( crate ) fn get_unsigned_integer ( value : & ScalarValue ) -> Result < u64 > {
5656 if value. is_null ( ) {
5757 return Ok ( 0 ) ;
5858 }
You can’t perform that action at this time.
0 commit comments