Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
200 changes: 119 additions & 81 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ arrow-flight = { version = "54.2.1", features = [
arrow-schema = { version = "54.2.1", features = ["serde"] }
arrow-json = "54.2.1"
arrow-odbc = { version = "=15.1.1" }
datafusion = { version = "45", default-features = false }
datafusion-expr = { version = "45" }
datafusion-federation = { version = "=0.3.6" }
datafusion-ffi = { version = "45" }
datafusion-proto = { version = "45" }
datafusion-physical-expr = { version = "45" }
datafusion-physical-plan = { version = "45" }
datafusion = { version = "46", default-features = false }
datafusion-expr = { version = "46" }
datafusion-federation = { version = "=0.3.7" }
datafusion-ffi = { version = "46" }
datafusion-proto = { version = "46" }
datafusion-physical-expr = { version = "46" }
datafusion-physical-plan = { version = "46" }
datafusion-table-providers = { path = "core" }
duckdb = { version = "=1.2.1" }
12 changes: 6 additions & 6 deletions core/src/duckdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,12 +616,12 @@ impl DuckDB {
);
}
if !extra_in_actual.is_empty() {
tracing::warn!(
"Unexpected index(es) detected in table '{name}': {}.\n\
tracing::warn!(
"Unexpected index(es) detected in table '{name}': {}.\n\
These indexes are not defined in the configuration.",
extra_in_actual.iter().join(", "),
name = self.table_name
);
extra_in_actual.iter().join(", "),
name = self.table_name
);
}

Ok(missing_in_actual.is_empty() && extra_in_actual.is_empty())
Expand Down Expand Up @@ -785,7 +785,7 @@ pub(crate) mod tests {
let ctx = SessionContext::new();
let cmd = CreateExternalTable {
schema: Arc::new(schema.to_dfschema().expect("to df schema")),
name: table_name.into(),
name: table_name,
location: "".to_string(),
file_type: "".to_string(),
table_partition_cols: vec![],
Expand Down
2 changes: 1 addition & 1 deletion core/src/flight/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ async fn flight_stream(
Err(e) => errors.push(Box::new(e)),
}
}
let err = errors.into_iter().last().unwrap_or_else(|| {
let err = errors.into_iter().next_back().unwrap_or_else(|| {
Box::new(FlightError::ProtocolError(format!(
"No available location for endpoint {:?}",
partition.locations
Expand Down
12 changes: 8 additions & 4 deletions core/tests/duckdb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ use datafusion::arrow::array::RecordBatch;
use datafusion::arrow::datatypes::SchemaRef;
use datafusion::catalog::TableProviderFactory;
use datafusion::common::{Constraints, ToDFSchema};
use datafusion::datasource::memory::MemorySourceConfig;
use datafusion::execution::context::SessionContext;
use datafusion::logical_expr::dml::InsertOp;
use datafusion::logical_expr::CreateExternalTable;
use datafusion::physical_plan::collect;
use datafusion::physical_plan::memory::MemoryExec;
use datafusion_federation::schema_cast::record_convert::try_cast_to;
use datafusion_table_providers::duckdb::DuckDBTableProviderFactory;
use rstest::rstest;
Expand Down Expand Up @@ -43,10 +43,14 @@ async fn arrow_duckdb_round_trip(

let ctx = SessionContext::new();

let mem_exec = MemoryExec::try_new(&[vec![arrow_record.clone()]], arrow_record.schema(), None)
.expect("memory exec created");
let mem_exec = MemorySourceConfig::try_new_exec(
&[vec![arrow_record.clone()]],
arrow_record.schema(),
None,
)
.expect("memory exec created");
let insert_plan = table_provider
.insert_into(&ctx.state(), Arc::new(mem_exec), InsertOp::Append)
.insert_into(&ctx.state(), mem_exec, InsertOp::Append)
.await
.expect("insert plan created");

Expand Down
2 changes: 1 addition & 1 deletion core/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use rand::Rng;

mod arrow_record_batch_gen;
mod docker;
#[cfg(feature = "duckdb")]
#[cfg(all(feature = "duckdb", feature = "federation"))]
mod duckdb;
#[cfg(feature = "flight")]
mod flight;
Expand Down
13 changes: 8 additions & 5 deletions core/tests/mysql/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::arrow_record_batch_gen::*;
use datafusion::execution::context::SessionContext;
use datafusion::{datasource::memory::MemorySourceConfig, execution::context::SessionContext};
use datafusion_table_providers::{
mysql::DynMySQLConnectionPool, sql::sql_provider_datafusion::SqlTable,
};
Expand All @@ -20,7 +20,6 @@ use datafusion::common::{Constraints, ToDFSchema};
use datafusion::logical_expr::dml::InsertOp;
use datafusion::logical_expr::CreateExternalTable;
use datafusion::physical_plan::collect;
use datafusion::physical_plan::memory::MemoryExec;
#[cfg(feature = "mysql-federation")]
use datafusion_federation::schema_cast::record_convert::try_cast_to;
use datafusion_table_providers::mysql::MySQLTableProviderFactory;
Expand Down Expand Up @@ -708,10 +707,14 @@ async fn arrow_mysql_round_trip(
.expect("table provider created");

let ctx = SessionContext::new();
let mem_exec = MemoryExec::try_new(&[vec![arrow_record.clone()]], arrow_record.schema(), None)
.expect("memory exec created");
let mem_exec = MemorySourceConfig::try_new_exec(
&[vec![arrow_record.clone()]],
arrow_record.schema(),
None,
)
.expect("memory exec created");
let insert_plan = table_provider
.insert_into(&ctx.state(), Arc::new(mem_exec), InsertOp::Overwrite)
.insert_into(&ctx.state(), mem_exec, InsertOp::Overwrite)
.await
.expect("insert plan created");

Expand Down
16 changes: 11 additions & 5 deletions core/tests/postgres/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ use arrow::{
array::{Decimal128Array, RecordBatch},
datatypes::{DataType, Field, Schema, SchemaRef},
};
use datafusion::common::{Constraints, ToDFSchema};
use datafusion::execution::context::SessionContext;
use datafusion::logical_expr::CreateExternalTable;
use datafusion::physical_plan::collect;
use datafusion::physical_plan::memory::MemoryExec;
use datafusion::{catalog::TableProviderFactory, logical_expr::dml::InsertOp};
use datafusion::{
common::{Constraints, ToDFSchema},
datasource::memory::MemorySourceConfig,
};
#[cfg(feature = "postgres-federation")]
use datafusion_federation::schema_cast::record_convert::try_cast_to;

Expand Down Expand Up @@ -55,10 +57,14 @@ async fn arrow_postgres_round_trip(
.expect("table provider created");

let ctx = SessionContext::new();
let mem_exec = MemoryExec::try_new(&[vec![arrow_record.clone()]], arrow_record.schema(), None)
.expect("memory exec created");
let mem_exec = MemorySourceConfig::try_new_exec(
&[vec![arrow_record.clone()]],
arrow_record.schema(),
None,
)
.expect("memory exec created");
let insert_plan = table_provider
.insert_into(&ctx.state(), Arc::new(mem_exec), InsertOp::Append)
.insert_into(&ctx.state(), mem_exec, InsertOp::Append)
.await
.expect("insert plan created");

Expand Down