From f1d68b7070319047f3ecb9ec6e746a86c62fffc5 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 7 Jun 2023 12:32:10 -0400 Subject: [PATCH] Fix up more stragglers --- datafusion/core/benches/data_utils/mod.rs | 3 +-- datafusion/core/benches/filter_query_sql.rs | 5 ++--- datafusion/core/benches/math_query_sql.rs | 5 ++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/datafusion/core/benches/data_utils/mod.rs b/datafusion/core/benches/data_utils/mod.rs index 575e1831c8380..9169c3dda48ed 100644 --- a/datafusion/core/benches/data_utils/mod.rs +++ b/datafusion/core/benches/data_utils/mod.rs @@ -27,7 +27,6 @@ use arrow::{ }; use datafusion::datasource::MemTable; use datafusion::error::Result; -use datafusion::from_slice::FromSlice; use rand::rngs::StdRng; use rand::seq::SliceRandom; use rand::{Rng, SeedableRng}; @@ -131,7 +130,7 @@ fn create_record_batch( schema, vec![ Arc::new(StringArray::from(keys)), - Arc::new(Float32Array::from_slice(vec![i as f32; batch_size])), + Arc::new(Float32Array::from(vec![i as f32; batch_size])), Arc::new(Float64Array::from(values)), Arc::new(UInt64Array::from(integer_values_wide)), Arc::new(UInt64Array::from(integer_values_narrow)), diff --git a/datafusion/core/benches/filter_query_sql.rs b/datafusion/core/benches/filter_query_sql.rs index 8b0142078d90b..01adc357b39af 100644 --- a/datafusion/core/benches/filter_query_sql.rs +++ b/datafusion/core/benches/filter_query_sql.rs @@ -21,7 +21,6 @@ use arrow::{ record_batch::RecordBatch, }; use criterion::{criterion_group, criterion_main, Criterion}; -use datafusion::from_slice::FromSlice; use datafusion::prelude::SessionContext; use datafusion::{datasource::MemTable, error::Result}; use futures::executor::block_on; @@ -49,8 +48,8 @@ fn create_context(array_len: usize, batch_size: usize) -> Result RecordBatch::try_new( schema.clone(), vec![ - Arc::new(Float32Array::from_slice(vec![i as f32; batch_size])), - Arc::new(Float64Array::from_slice(vec![i as f64; batch_size])), + Arc::new(Float32Array::from(vec![i as f32; batch_size])), + Arc::new(Float64Array::from(vec![i as f64; batch_size])), ], ) .unwrap() diff --git a/datafusion/core/benches/math_query_sql.rs b/datafusion/core/benches/math_query_sql.rs index 87c7a363efc05..92c59d5066401 100644 --- a/datafusion/core/benches/math_query_sql.rs +++ b/datafusion/core/benches/math_query_sql.rs @@ -35,7 +35,6 @@ use arrow::{ use datafusion::datasource::MemTable; use datafusion::error::Result; use datafusion::execution::context::SessionContext; -use datafusion::from_slice::FromSlice; fn query(ctx: Arc>, sql: &str) { let rt = Runtime::new().unwrap(); @@ -61,8 +60,8 @@ fn create_context( RecordBatch::try_new( schema.clone(), vec![ - Arc::new(Float32Array::from_slice(vec![i as f32; batch_size])), - Arc::new(Float64Array::from_slice(vec![i as f64; batch_size])), + Arc::new(Float32Array::from(vec![i as f32; batch_size])), + Arc::new(Float64Array::from(vec![i as f64; batch_size])), ], ) .unwrap()