Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move sql tests from context.rs to corresponding test files in tests/sql #2329

Merged
merged 3 commits into from
Apr 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix clippy
WinkerDu committed Apr 24, 2022
commit 44b881243b92caab90f3e1b2f6e293dca7ce06ce
16 changes: 2 additions & 14 deletions datafusion/core/src/execution/context.rs
Original file line number Diff line number Diff line change
@@ -1602,7 +1602,6 @@ impl FunctionRegistry for TaskContext {
mod tests {
use super::*;
use crate::execution::context::QueryPlanner;
use crate::from_slice::FromSlice;
use crate::logical_plan::{binary_expr, lit, Operator};
use crate::physical_plan::functions::make_scalar_function;
use crate::test;
@@ -1612,14 +1611,10 @@ mod tests {
logical_plan::{col, create_udf, sum, Expr},
};
use crate::{
datasource::MemTable, logical_plan::create_udaf,
logical_plan::create_udaf,
physical_plan::expressions::AvgAccumulator,
};
use arrow::array::{
Array, ArrayRef, DictionaryArray, Float32Array, Float64Array, Int16Array,
Int32Array, Int64Array, Int8Array, LargeStringArray, UInt16Array, UInt32Array,
UInt64Array, UInt8Array,
};
use arrow::array::ArrayRef;
use arrow::datatypes::*;
use arrow::record_batch::RecordBatch;
use async_trait::async_trait;
@@ -2172,13 +2167,6 @@ mod tests {
ctx.sql(sql).await?.collect().await
}

/// Execute SQL and return results
async fn execute(sql: &str, partition_count: usize) -> Result<Vec<RecordBatch>> {
let tmp_dir = TempDir::new()?;
let ctx = create_ctx(&tmp_dir, partition_count).await?;
plan_and_collect(&ctx, sql).await
}

/// Generate CSV partitions within the supplied directory
fn populate_csv_partitions(
tmp_dir: &TempDir,