Skip to content

Commit

Permalink
fix another deprecated usage that clippy warns about
Browse files Browse the repository at this point in the history
  • Loading branch information
Blizzara committed Mar 6, 2025
1 parent ce73e6c commit 5eb52df
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions datafusion/functions/benches/strpos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
extern crate criterion;

use arrow::array::{StringArray, StringViewArray};
use arrow::datatypes::DataType;
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use datafusion_expr::ColumnarValue;
use datafusion_expr::{ColumnarValue, ScalarFunctionArgs};
use rand::distributions::Alphanumeric;
use rand::prelude::StdRng;
use rand::{Rng, SeedableRng};
Expand Down Expand Up @@ -114,8 +115,11 @@ fn criterion_benchmark(c: &mut Criterion) {
&format!("strpos_StringArray_ascii_str_len_{}", str_len),
|b| {
b.iter(|| {
// TODO use invoke_with_args
black_box(strpos.invoke_batch(&args_string_ascii, n_rows))
black_box(strpos.invoke_with_args(ScalarFunctionArgs {
args: args_string_ascii.clone(),
number_rows: n_rows,
return_type: &DataType::Int32,
}))
})
},
);
Expand All @@ -126,8 +130,11 @@ fn criterion_benchmark(c: &mut Criterion) {
&format!("strpos_StringArray_utf8_str_len_{}", str_len),
|b| {
b.iter(|| {
// TODO use invoke_with_args
black_box(strpos.invoke_batch(&args_string_utf8, n_rows))
black_box(strpos.invoke_with_args(ScalarFunctionArgs {
args: args_string_utf8.clone(),
number_rows: n_rows,
return_type: &DataType::Int32,
}))
})
},
);
Expand All @@ -138,8 +145,11 @@ fn criterion_benchmark(c: &mut Criterion) {
&format!("strpos_StringViewArray_ascii_str_len_{}", str_len),
|b| {
b.iter(|| {
// TODO use invoke_with_args
black_box(strpos.invoke_batch(&args_string_view_ascii, n_rows))
black_box(strpos.invoke_with_args(ScalarFunctionArgs {
args: args_string_view_ascii.clone(),
number_rows: n_rows,
return_type: &DataType::Int32,
}))
})
},
);
Expand All @@ -150,8 +160,11 @@ fn criterion_benchmark(c: &mut Criterion) {
&format!("strpos_StringViewArray_utf8_str_len_{}", str_len),
|b| {
b.iter(|| {
// TODO use invoke_with_args
black_box(strpos.invoke_batch(&args_string_view_utf8, n_rows))
black_box(strpos.invoke_with_args(ScalarFunctionArgs {
args: args_string_view_utf8.clone(),
number_rows: n_rows,
return_type: &DataType::Int32,
}))
})
},
);
Expand Down

0 comments on commit 5eb52df

Please sign in to comment.