Skip to content

Commit 607cdbf

Browse files
authored
Upgrade to datafusion 51, arrow 57 (#497)
* Upgrade to datafusion 51, arrow 57 * Bump duckdb and r2d2_adbc * Fix clippy * Bump r2d2_adbc to 0.2.0
1 parent 6140a7e commit 607cdbf

19 files changed

Lines changed: 315 additions & 602 deletions

Cargo.lock

Lines changed: 265 additions & 265 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,24 @@ license = "Apache-2.0"
2828
description = "Extend the capabilities of DataFusion to support additional data sources via implementations of the `TableProvider` trait."
2929

3030
[workspace.dependencies]
31-
arrow = "56.0.0"
32-
arrow-array = { version = "56.0.0" }
33-
arrow-flight = { version = "56.0.0", features = [
31+
arrow = "57.0.0"
32+
arrow-array = { version = "57.0.0" }
33+
arrow-flight = { version = "57.0.0", features = [
3434
"flight-sql-experimental",
3535
"tls-ring",
3636
] }
37-
arrow-ipc = { version = "56.0.0" }
38-
arrow-schema = { version = "56.0.0", features = ["serde"] }
39-
arrow-json = "56.0.0"
40-
arrow-odbc = { version = "20.0.0" }
41-
datafusion = { version = "50", default-features = false }
42-
datafusion-expr = { version = "50" }
43-
datafusion-federation = { version = "0.4.10" }
44-
datafusion-ffi = { version = "50" }
45-
datafusion-proto = { version = "50" }
46-
datafusion-physical-expr = { version = "50" }
47-
datafusion-physical-plan = { version = "50" }
37+
arrow-ipc = { version = "57.0.0" }
38+
arrow-schema = { version = "57.0.0", features = ["serde"] }
39+
arrow-json = "57.0.0"
40+
arrow-odbc = { version = "21.0.0" }
41+
datafusion = { version = "51", default-features = false }
42+
datafusion-expr = { version = "51" }
43+
datafusion-federation = { version = "0.4.11" }
44+
datafusion-ffi = { version = "51" }
45+
datafusion-proto = { version = "51" }
46+
datafusion-physical-expr = { version = "51" }
47+
datafusion-physical-plan = { version = "51" }
4848
datafusion-table-providers = { path = "core" }
49-
duckdb = { version = "=1.3.1", package = "spiceai_duckdb_fork" } # Forked to add support for duckdb_scan_arrow, pending: https://github.com/duckdb/duckdb-rs/pull/488
50-
adbc_core = { version = "0.20.0" }
51-
adbc_driver_manager = { version = "0.20.0" }
49+
duckdb = { version = "=1.3.2", package = "spiceai_duckdb_fork" } # Forked to add support for duckdb_scan_arrow, pending: https://github.com/duckdb/duckdb-rs/pull/488
50+
adbc_core = { version = "0.21.0" }
51+
adbc_driver_manager = { version = "0.21.0" }

benches/sqlite_insert_benchmark.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ async fn run_benchmark(
179179
constraints: Constraints::new_unverified(vec![]),
180180
column_defaults: std::collections::HashMap::default(),
181181
temporary: false,
182+
or_replace: false,
182183
};
183184

184185
let ctx = SessionContext::new();

core/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ byte-unit = { version = "5.1.4", optional = true }
3030
chrono = "0.4"
3131
clickhouse = { version = "0.13.3", optional = true }
3232
dashmap = "6.1.0"
33-
datafusion = { workspace = true, default-features = false }
33+
datafusion = { workspace = true, default-features = false, features = ["sql"]}
3434
datafusion-expr = { workspace = true, optional = true }
3535
datafusion-federation = { workspace = true, features = [
3636
"sql",
@@ -63,7 +63,7 @@ num-bigint = "0.4"
6363
odbc-api = { version = "19.0", optional = true }
6464
pem = { version = "3.0.4", optional = true }
6565
postgres-native-tls = { version = "0.5.0", optional = true }
66-
prost = { version = "0.14.1", optional = true }
66+
prost = { version = "=0.14.1", optional = true }
6767
rand = { version = "0.9" }
6868
regex = { version = "1" }
6969
r2d2 = { version = "0.8", optional = true }
@@ -91,7 +91,7 @@ tokio-postgres = { version = "0.7", features = [
9191
"with-geo-types-0_7",
9292
], optional = true }
9393
tokio-rusqlite = { version = "0.7.0", optional = true }
94-
tonic = { version = "0.13", optional = true, features = [
94+
tonic = { version = "0.14", optional = true, features = [
9595
"tls-native-roots",
9696
"tls-webpki-roots",
9797
] }
@@ -100,16 +100,16 @@ trust-dns-resolver = "0.23.2"
100100
url = "2.5.4"
101101
uuid = { version = "1.18", optional = true }
102102
rust_decimal = { version = "1.38.0", features = ["db-postgres"] }
103-
adbc_driver_manager = { workspace = true, version = "0.20.0", optional = true }
104-
adbc_core = { workspace = true, version = "0.20.0", optional = true }
105-
r2d2_adbc = { version = "0.1.0", optional = true }
103+
adbc_driver_manager = { workspace = true, optional = true }
104+
adbc_core = { workspace = true, optional = true }
105+
r2d2_adbc = { version = "0.2.0", optional = true }
106106

107107
[dev-dependencies]
108108
anyhow = "1.0"
109109
bollard = "0.19"
110110
geozero = { version = "0.14.0", features = ["with-wkb"] }
111111
insta = { version = "1.43.2", features = ["filters"] }
112-
prost = { version = "=0.13.5" }
112+
prost = { version = "=0.14.1" }
113113
rand = "0.9"
114114
reqwest = "0.12"
115115
rstest = "0.26.1"

core/src/duckdb.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ impl TableProviderFactory for DuckDBTableProviderFactory {
417417

418418
let read_pool = read_pool.with_connection_setup_queries(local_settings);
419419

420-
let schema: SchemaRef = Arc::new(cmd.schema.as_ref().into());
420+
let schema: SchemaRef = Arc::new(cmd.schema.as_ref().as_arrow().clone());
421421

422422
let table_definition =
423423
TableDefinition::new(RelationName::new(name.clone()), Arc::clone(&schema))
@@ -722,6 +722,7 @@ pub(crate) mod tests {
722722
constraints: Constraints::default(),
723723
column_defaults: HashMap::new(),
724724
temporary: false,
725+
or_replace: false,
725726
};
726727

727728
let table_provider = factory
@@ -783,6 +784,7 @@ pub(crate) mod tests {
783784
constraints: Constraints::default(),
784785
column_defaults: HashMap::new(),
785786
temporary: false,
787+
or_replace: false,
786788
};
787789

788790
let table_provider = factory
@@ -840,6 +842,7 @@ pub(crate) mod tests {
840842
constraints: Constraints::default(),
841843
column_defaults: HashMap::new(),
842844
temporary: false,
845+
or_replace: false,
843846
};
844847

845848
let table_provider = factory
@@ -895,6 +898,7 @@ pub(crate) mod tests {
895898
constraints: Constraints::default(),
896899
column_defaults: HashMap::new(),
897900
temporary: false,
901+
or_replace: false,
898902
};
899903

900904
let table_provider = factory
@@ -953,6 +957,7 @@ pub(crate) mod tests {
953957
constraints: Constraints::default(),
954958
column_defaults: HashMap::new(),
955959
temporary: false,
960+
or_replace: false,
956961
};
957962

958963
let result = factory.create(&ctx.state(), &cmd).await;

core/src/flight/codec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use std::sync::Arc;
2222
use crate::flight::exec::{FlightConfig, FlightExec};
2323
use crate::flight::to_df_err;
2424
use datafusion::common::DataFusionError;
25-
use datafusion::logical_expr::registry::FunctionRegistry;
25+
use datafusion::execution::TaskContext;
2626
use datafusion::physical_plan::ExecutionPlan;
2727
use datafusion_proto::physical_plan::PhysicalExtensionCodec;
2828

@@ -35,7 +35,7 @@ impl PhysicalExtensionCodec for FlightPhysicalCodec {
3535
&self,
3636
buf: &[u8],
3737
inputs: &[Arc<dyn ExecutionPlan>],
38-
_registry: &dyn FunctionRegistry,
38+
_registry: &TaskContext,
3939
) -> datafusion::common::Result<Arc<dyn ExecutionPlan>> {
4040
if inputs.is_empty() {
4141
let config: FlightConfig = serde_json::from_slice(buf).map_err(to_df_err)?;

core/src/mysql.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl TableProviderFactory for MySQLTableProviderFactory {
188188
) -> datafusion::common::Result<Arc<dyn TableProvider>> {
189189
let name = cmd.name.to_string();
190190
let mut options = cmd.options.clone();
191-
let schema: Schema = cmd.schema.as_ref().into();
191+
let schema: Schema = cmd.schema.as_ref().as_arrow().clone();
192192

193193
let indexes_option_str = options.remove("indexes");
194194
let unparsed_indexes: HashMap<String, IndexType> = match indexes_option_str {

core/src/postgres.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl TableProviderFactory for PostgresTableProviderFactory {
219219

220220
let name = cmd.name.clone();
221221
let mut options = cmd.options.clone();
222-
let schema: Schema = cmd.schema.as_ref().into();
222+
let schema: Schema = cmd.schema.as_ref().as_arrow().clone();
223223

224224
let indexes_option_str = options.remove("indexes");
225225
let unparsed_indexes: HashMap<String, IndexType> = match indexes_option_str {

core/src/sqlite.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ impl TableProviderFactory for SqliteTableProviderFactory {
311311
)
312312
};
313313

314-
let schema: SchemaRef = Arc::new(cmd.schema.as_ref().into());
314+
let schema: SchemaRef = Arc::new(cmd.schema.as_ref().as_arrow().clone());
315315
let schema: SchemaRef =
316316
SqliteConnection::handle_unsupported_schema(&schema, UnsupportedTypeAction::Error)
317317
.map_err(|e| DataFusionError::External(e.into()))?;
@@ -1282,6 +1282,7 @@ pub(crate) mod tests {
12821282
constraints: primary_keys_constraints,
12831283
column_defaults: HashMap::default(),
12841284
temporary: false,
1285+
or_replace: false,
12851286
};
12861287
let ctx = SessionContext::new();
12871288
let table = SqliteTableProviderFactory::default()

core/src/sqlite/write.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ mod tests {
324324
constraints: Constraints::default(),
325325
column_defaults: HashMap::default(),
326326
temporary: false,
327+
or_replace: false,
327328
};
328329
let ctx = SessionContext::new();
329330
let table = SqliteTableProviderFactory::default()
@@ -466,6 +467,7 @@ mod tests {
466467
constraints: Constraints::default(),
467468
column_defaults: HashMap::default(),
468469
temporary: false,
470+
or_replace: false,
469471
};
470472

471473
let ctx = SessionContext::new();
@@ -772,6 +774,7 @@ mod tests {
772774
constraints: Constraints::default(),
773775
column_defaults: HashMap::default(),
774776
temporary: false,
777+
or_replace: false,
775778
};
776779
let ctx = SessionContext::new();
777780
let table = SqliteTableProviderFactory::default()
@@ -816,6 +819,7 @@ mod tests {
816819
constraints: Constraints::default(),
817820
column_defaults: HashMap::default(),
818821
temporary: false,
822+
or_replace: false,
819823
};
820824

821825
let ctx = SessionContext::new();

0 commit comments

Comments
 (0)