diff --git a/Cargo.lock b/Cargo.lock index 6914aa0e..1a0047d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1331,29 +1331,31 @@ checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010" [[package]] name = "datafusion" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae420e7a5b0b7f1c39364cc76cbcd0f5fdc416b2514ae3847c2676bbd60702a" +checksum = "914e6f9525599579abbd90b0f7a55afcaaaa40350b9e9ed52563f126dfe45fd3" dependencies = [ "arrow", - "arrow-array", "arrow-ipc", "arrow-schema", - "async-compression", "async-trait", "bytes", "bzip2", "chrono", "datafusion-catalog", + "datafusion-catalog-listing", "datafusion-common", "datafusion-common-runtime", + "datafusion-datasource", "datafusion-execution", "datafusion-expr", + "datafusion-expr-common", "datafusion-functions", "datafusion-functions-aggregate", "datafusion-functions-nested", "datafusion-functions-table", "datafusion-functions-window", + "datafusion-macros", "datafusion-optimizer", "datafusion-physical-expr", "datafusion-physical-expr-common", @@ -1362,7 +1364,6 @@ dependencies = [ "datafusion-sql", "flate2", "futures", - "glob", "itertools 0.14.0", "log", "object_store", @@ -1370,10 +1371,10 @@ dependencies = [ "parquet", "rand 0.8.5", "regex", + "serde", "sqlparser", "tempfile", "tokio", - "tokio-util", "url", "uuid", "xz2", @@ -1382,9 +1383,9 @@ dependencies = [ [[package]] name = "datafusion-catalog" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f27987bc22b810939e8dfecc55571e9d50355d6ea8ec1c47af8383a76a6d0e1" +checksum = "998a6549e6ee4ee3980e05590b2960446a56b343ea30199ef38acd0e0b9036e2" dependencies = [ "arrow", "async-trait", @@ -1398,21 +1399,39 @@ dependencies = [ "itertools 0.14.0", "log", "parking_lot", - "sqlparser", +] + +[[package]] +name = "datafusion-catalog-listing" +version = "46.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5ac10096a5b3c0d8a227176c0e543606860842e943594ccddb45cf42a526e43" +dependencies = [ + "arrow", + "async-trait", + "datafusion-catalog", + "datafusion-common", + "datafusion-datasource", + "datafusion-execution", + "datafusion-expr", + "datafusion-physical-expr", + "datafusion-physical-expr-common", + "datafusion-physical-plan", + "futures", + "log", + "object_store", + "tokio", ] [[package]] name = "datafusion-common" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3f6d5b8c9408cc692f7c194b8aa0c0f9b253e065a8d960ad9cdc2a13e697602" +checksum = "1f53d7ec508e1b3f68bd301cee3f649834fad51eff9240d898a4b2614cfd0a7a" dependencies = [ "ahash 0.8.11", "arrow", - "arrow-array", - "arrow-buffer", "arrow-ipc", - "arrow-schema", "base64", "half", "hashbrown 0.14.5", @@ -1431,25 +1450,59 @@ dependencies = [ [[package]] name = "datafusion-common-runtime" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4603c8e8a4baf77660ab7074cc66fc15cc8a18f2ce9dfadb755fc6ee294e48" +checksum = "e0fcf41523b22e14cc349b01526e8b9f59206653037f2949a4adbfde5f8cb668" dependencies = [ "log", "tokio", ] +[[package]] +name = "datafusion-datasource" +version = "46.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf7f37ad8b6e88b46c7eeab3236147d32ea64b823544f498455a8d9042839c92" +dependencies = [ + "arrow", + "async-compression", + "async-trait", + "bytes", + "bzip2", + "chrono", + "datafusion-catalog", + "datafusion-common", + "datafusion-common-runtime", + "datafusion-execution", + "datafusion-expr", + "datafusion-physical-expr", + "datafusion-physical-expr-common", + "datafusion-physical-plan", + "flate2", + "futures", + "glob", + "itertools 0.14.0", + "log", + "object_store", + "rand 0.8.5", + "tokio", + "tokio-util", + "url", + "xz2", + "zstd", +] + [[package]] name = "datafusion-doc" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5bf4bc68623a5cf231eed601ed6eb41f46a37c4d15d11a0bff24cbc8396cd66" +checksum = "7db7a0239fd060f359dc56c6e7db726abaa92babaed2fb2e91c3a8b2fff8b256" [[package]] name = "datafusion-execution" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b491c012cdf8e051053426013429a76f74ee3c2db68496c79c323ca1084d27" +checksum = "0938f9e5b6bc5782be4111cdfb70c02b7b5451bf34fd57e4de062a7f7c4e31f1" dependencies = [ "arrow", "dashmap", @@ -1466,9 +1519,9 @@ dependencies = [ [[package]] name = "datafusion-expr" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a181408d4fc5dc22f9252781a8f39f2d0e5d1b33ec9bde242844980a2689c1" +checksum = "b36c28b00b00019a8695ad7f1a53ee1673487b90322ecbd604e2cf32894eb14f" dependencies = [ "arrow", "chrono", @@ -1487,21 +1540,22 @@ dependencies = [ [[package]] name = "datafusion-expr-common" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1129b48e8534d8c03c6543bcdccef0b55c8ac0c1272a15a56c67068b6eb1885" +checksum = "18f0a851a436c5a2139189eb4617a54e6a9ccb9edc96c4b3c83b3bb7c58b950e" dependencies = [ "arrow", "datafusion-common", + "indexmap 2.8.0", "itertools 0.14.0", "paste", ] [[package]] name = "datafusion-federation" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66502e54fb3e95becab87d1afcbea653036ff53823caef6499d4b4e9c7489d62" +checksum = "db96303adde1dff393be5f76377ce81f78d91aeacf8ed6836d66ace0ec8944a0" dependencies = [ "arrow-json", "async-stream", @@ -1512,14 +1566,12 @@ dependencies = [ [[package]] name = "datafusion-ffi" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff47a79d442207c168c6e3e1d970c248589c148e4800e5b285ac1b2cb1a230f8" +checksum = "d740dd9f32a4f4ed1b907e6934201bb059efe6c877532512c661771d973c7b21" dependencies = [ "abi_stable", "arrow", - "arrow-array", - "arrow-schema", "async-ffi", "async-trait", "datafusion", @@ -1533,9 +1585,9 @@ dependencies = [ [[package]] name = "datafusion-functions" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6125874e4856dfb09b59886784fcb74cde5cfc5930b3a80a1a728ef7a010df6b" +checksum = "e3196e37d7b65469fb79fee4f05e5bb58a456831035f9a38aa5919aeb3298d40" dependencies = [ "arrow", "arrow-buffer", @@ -1549,7 +1601,6 @@ dependencies = [ "datafusion-expr", "datafusion-expr-common", "datafusion-macros", - "hashbrown 0.14.5", "hex", "itertools 0.14.0", "log", @@ -1563,14 +1614,12 @@ dependencies = [ [[package]] name = "datafusion-functions-aggregate" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3add7b1d3888e05e7c95f2b281af900ca69ebdcb21069ba679b33bde8b3b9d6" +checksum = "adfc2d074d5ee4d9354fdcc9283d5b2b9037849237ddecb8942a29144b77ca05" dependencies = [ "ahash 0.8.11", "arrow", - "arrow-buffer", - "arrow-schema", "datafusion-common", "datafusion-doc", "datafusion-execution", @@ -1586,9 +1635,9 @@ dependencies = [ [[package]] name = "datafusion-functions-aggregate-common" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e18baa4cfc3d2f144f74148ed68a1f92337f5072b6dde204a0dbbdf3324989c" +checksum = "1cbceba0f98d921309a9121b702bcd49289d383684cccabf9a92cda1602f3bbb" dependencies = [ "ahash 0.8.11", "arrow", @@ -1599,15 +1648,12 @@ dependencies = [ [[package]] name = "datafusion-functions-nested" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec5ee8cecb0dc370291279673097ddabec03a011f73f30d7f1096457127e03e" +checksum = "170e27ce4baa27113ddf5f77f1a7ec484b0dbeda0c7abbd4bad3fc609c8ab71a" dependencies = [ "arrow", - "arrow-array", - "arrow-buffer", "arrow-ord", - "arrow-schema", "datafusion-common", "datafusion-doc", "datafusion-execution", @@ -1623,9 +1669,9 @@ dependencies = [ [[package]] name = "datafusion-functions-table" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c403ddd473bbb0952ba880008428b3c7febf0ed3ce1eec35a205db20efb2a36" +checksum = "7d3a06a7f0817ded87b026a437e7e51de7f59d48173b0a4e803aa896a7bd6bb5" dependencies = [ "arrow", "async-trait", @@ -1639,9 +1685,9 @@ dependencies = [ [[package]] name = "datafusion-functions-window" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab18c2fb835614d06a75f24a9e09136d3a8c12a92d97c95a6af316a1787a9c5" +checksum = "d6c608b66496a1e05e3d196131eb9bebea579eed1f59e88d962baf3dda853bc6" dependencies = [ "datafusion-common", "datafusion-doc", @@ -1656,9 +1702,9 @@ dependencies = [ [[package]] name = "datafusion-functions-window-common" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a77b73bc15e7d1967121fdc7a55d819bfb9d6c03766a6c322247dce9094a53a4" +checksum = "da2f9d83348957b4ad0cd87b5cb9445f2651863a36592fe5484d43b49a5f8d82" dependencies = [ "datafusion-common", "datafusion-physical-expr-common", @@ -1666,9 +1712,9 @@ dependencies = [ [[package]] name = "datafusion-macros" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09369b8d962291e808977cf94d495fd8b5b38647232d7ef562c27ac0f495b0af" +checksum = "4800e1ff7ecf8f310887e9b54c9c444b8e215ccbc7b21c2f244cfae373b1ece7" dependencies = [ "datafusion-expr", "quote", @@ -1677,9 +1723,9 @@ dependencies = [ [[package]] name = "datafusion-optimizer" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2403a7e4a84637f3de7d8d4d7a9ccc0cc4be92d89b0161ba3ee5be82f0531c54" +checksum = "971c51c54cd309001376fae752fb15a6b41750b6d1552345c46afbfb6458801b" dependencies = [ "arrow", "chrono", @@ -1696,15 +1742,12 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ff72ac702b62dbf2650c4e1d715ebd3e4aab14e3885e72e8549e250307347c" +checksum = "e1447c2c6bc8674a16be4786b4abf528c302803fafa186aa6275692570e64d85" dependencies = [ "ahash 0.8.11", "arrow", - "arrow-array", - "arrow-buffer", - "arrow-schema", "datafusion-common", "datafusion-expr", "datafusion-expr-common", @@ -1721,13 +1764,12 @@ dependencies = [ [[package]] name = "datafusion-physical-expr-common" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60982b7d684e25579ee29754b4333057ed62e2cc925383c5f0bd8cab7962f435" +checksum = "69f8c25dcd069073a75b3d2840a79d0f81e64bdd2c05f2d3d18939afb36a7dcb" dependencies = [ "ahash 0.8.11", "arrow", - "arrow-buffer", "datafusion-common", "datafusion-expr-common", "hashbrown 0.14.5", @@ -1736,12 +1778,11 @@ dependencies = [ [[package]] name = "datafusion-physical-optimizer" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac5e85c189d5238a5cf181a624e450c4cd4c66ac77ca551d6f3ff9080bac90bb" +checksum = "68da5266b5b9847c11d1b3404ee96b1d423814e1973e1ad3789131e5ec912763" dependencies = [ "arrow", - "arrow-schema", "datafusion-common", "datafusion-execution", "datafusion-expr", @@ -1749,23 +1790,19 @@ dependencies = [ "datafusion-physical-expr", "datafusion-physical-expr-common", "datafusion-physical-plan", - "futures", "itertools 0.14.0", "log", "recursive", - "url", ] [[package]] name = "datafusion-physical-plan" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c36bf163956d7e2542657c78b3383fdc78f791317ef358a359feffcdb968106f" +checksum = "88cc160df00e413e370b3b259c8ea7bfbebc134d32de16325950e9e923846b7f" dependencies = [ "ahash 0.8.11", "arrow", - "arrow-array", - "arrow-buffer", "arrow-ord", "arrow-schema", "async-trait", @@ -1790,9 +1827,9 @@ dependencies = [ [[package]] name = "datafusion-proto" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2db5d79f0c974041787b899d24dc91bdab2ff112d1942dd71356a4ce3b407e6c" +checksum = "6f6ef4c6eb52370cb48639e25e2331a415aac0b2b0a0a472b36e26603bdf184f" dependencies = [ "arrow", "chrono", @@ -1806,9 +1843,9 @@ dependencies = [ [[package]] name = "datafusion-proto-common" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de21bde1603aac0ff32cf478e47081be6e3583c6861fe8f57034da911efe7578" +checksum = "5faf4a9bbb0d0a305fea8a6db21ba863286b53e53a212e687d2774028dd6f03f" dependencies = [ "arrow", "datafusion-common", @@ -1817,13 +1854,11 @@ dependencies = [ [[package]] name = "datafusion-sql" -version = "45.0.0" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13caa4daede211ecec53c78b13c503b592794d125f9a3cc3afe992edf9e7f43" +checksum = "325a212b67b677c0eb91447bf9a11b630f9fc4f62d8e5d145bf859f5a6b29e64" dependencies = [ "arrow", - "arrow-array", - "arrow-schema", "bigdecimal", "datafusion-common", "datafusion-expr", @@ -5104,11 +5139,12 @@ dependencies = [ [[package]] name = "sqlparser" -version = "0.53.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05a528114c392209b3264855ad491fcce534b94a38771b0a0b97a79379275ce8" +checksum = "c66e3b7374ad4a6af849b08b3e7a6eda0edbd82f0fd59b57e22671bf16979899" dependencies = [ "log", + "recursive", "sqlparser_derive", ] @@ -5916,6 +5952,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" dependencies = [ "getrandom 0.3.1", + "js-sys", + "wasm-bindgen", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 0771ca06..7aec30d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } diff --git a/core/src/duckdb.rs b/core/src/duckdb.rs index 90a34d6b..261c025c 100644 --- a/core/src/duckdb.rs +++ b/core/src/duckdb.rs @@ -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()) @@ -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![], diff --git a/core/src/flight/exec.rs b/core/src/flight/exec.rs index 1d79a749..a3606b5e 100644 --- a/core/src/flight/exec.rs +++ b/core/src/flight/exec.rs @@ -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 diff --git a/core/tests/duckdb/mod.rs b/core/tests/duckdb/mod.rs index b3fc76c5..47e89893 100644 --- a/core/tests/duckdb/mod.rs +++ b/core/tests/duckdb/mod.rs @@ -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; @@ -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"); diff --git a/core/tests/integration.rs b/core/tests/integration.rs index 279c472b..d5a1abe1 100644 --- a/core/tests/integration.rs +++ b/core/tests/integration.rs @@ -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; diff --git a/core/tests/mysql/mod.rs b/core/tests/mysql/mod.rs index c853fe8b..14bdfa43 100644 --- a/core/tests/mysql/mod.rs +++ b/core/tests/mysql/mod.rs @@ -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, }; @@ -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; @@ -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"); diff --git a/core/tests/postgres/mod.rs b/core/tests/postgres/mod.rs index 06986226..b0b28a03 100644 --- a/core/tests/postgres/mod.rs +++ b/core/tests/postgres/mod.rs @@ -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; @@ -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");