|
1 | 1 | use std::path::Path; |
2 | 2 |
|
3 | | -use datafusion::logical_expr::{cast, lit}; |
4 | | -use datafusion::prelude::DataFrame; |
5 | | -use datafusion::prelude::ParquetReadOptions; |
| 3 | +use deltalake_core::datafusion::functions::expr_fn; |
6 | 4 | use deltalake_core::kernel::engine::arrow_conversion::TryIntoKernel; |
7 | 5 | use deltalake_core::kernel::{StructField, StructType}; |
8 | 6 | use deltalake_core::operations::merge::MergeBuilder; |
9 | | -use deltalake_core::DeltaResult; |
10 | | -use deltalake_core::{datafusion::prelude::SessionContext, DeltaOps, DeltaTable, DeltaTableError}; |
| 7 | +use deltalake_core::{arrow, DeltaResult}; |
| 8 | +use deltalake_core::{ |
| 9 | + datafusion::{ |
| 10 | + logical_expr::{cast, lit}, |
| 11 | + prelude::{DataFrame, ParquetReadOptions, SessionContext}, |
| 12 | + }, |
| 13 | + DeltaOps, DeltaTable, DeltaTableError, |
| 14 | +}; |
11 | 15 | use tempfile::TempDir; |
12 | 16 | use url::Url; |
13 | 17 |
|
@@ -164,16 +168,14 @@ pub async fn prepare_source_and_table( |
164 | 168 | // Split matched and not-matched portions |
165 | 169 | let matched = source |
166 | 170 | .clone() |
167 | | - .filter(datafusion::functions::expr_fn::random().lt_eq(lit(params.sample_matched_rows)))?; |
| 171 | + .filter(expr_fn::random().lt_eq(lit(params.sample_matched_rows)))?; |
168 | 172 |
|
169 | 173 | let rand = cast( |
170 | | - datafusion::functions::expr_fn::random() * lit(u32::MAX), |
171 | | - datafusion::arrow::datatypes::DataType::Int64, |
| 174 | + expr_fn::random() * lit(u32::MAX), |
| 175 | + arrow::datatypes::DataType::Int64, |
172 | 176 | ); |
173 | 177 | let not_matched = source |
174 | | - .filter( |
175 | | - datafusion::functions::expr_fn::random().lt_eq(lit(params.sample_not_matched_rows)), |
176 | | - )? |
| 178 | + .filter(expr_fn::random().lt_eq(lit(params.sample_not_matched_rows)))? |
177 | 179 | .with_column("wr_item_sk", rand.clone())? |
178 | 180 | .with_column("wr_order_number", rand)?; |
179 | 181 |
|
|
0 commit comments