Skip to content

Commit e7838c3

Browse files
chore: upgrade datafusion and and some other crates (#219)
* chore: upgrade datafusion and and some other crates * Exclude odbc from PR checks * Install ODBC & sqlite packages --------- Co-authored-by: Phillip LeBlanc <phillip@leblanc.tech>
1 parent aae31d2 commit e7838c3

8 files changed

Lines changed: 64 additions & 42 deletions

File tree

.github/workflows/pr.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
google-cloud-sdk imagemagick \
8686
libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \
8787
mercurial apt-transport-https mono-complete libmysqlclient \
88-
unixodbc-dev yarn chrpath libssl-dev libxft-dev \
88+
yarn chrpath libssl-dev libxft-dev \
8989
libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \
9090
snmp pollinate libpq-dev postgresql-client powershell ruby-full \
9191
sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \
@@ -100,5 +100,10 @@ jobs:
100100
echo "some packages purged"
101101
df -h
102102
103+
- name: Install ODBC & Sqlite
104+
run: |
105+
sudo apt-get install -y unixodbc-dev
106+
sudo apt-get install -y libsqlite3-dev
107+
103108
- name: Run tests
104109
run: make test

Cargo.toml

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ arrow-flight = { version = "53", optional = true, features = [
1313
"tls",
1414
] }
1515
arrow-odbc = { version = "=14.0.1", optional = true }
16-
async-stream = { version = "0.3.6", optional = true }
16+
async-stream = { version = "0.3", optional = true }
1717
async-trait = "0.1"
18-
bb8 = { version = "0.8", optional = true }
19-
bb8-postgres = { version = "0.8", optional = true }
20-
bigdecimal = "0.4.6"
18+
bb8 = { version = "0.9", optional = true }
19+
bb8-postgres = { version = "0.9", optional = true }
20+
bigdecimal = "0.4"
2121
byteorder = "1.5.0"
22-
chrono = "0.4.38"
22+
chrono = "0.4"
2323
dashmap = "6.1.0"
24-
datafusion = { version = "43", default-features = false }
25-
datafusion-federation = { version = "0.3.1", features = [
24+
datafusion = { version = "44", default-features = false }
25+
datafusion-federation = { version = "=0.3.4", features = [
2626
"sql",
2727
], optional = true }
28-
datafusion-proto = { version = "43", optional = true }
28+
datafusion-proto = { version = "44", optional = true }
2929
duckdb = { version = "1.1.1", features = [
3030
"bundled",
3131
"r2d2",
@@ -38,20 +38,22 @@ fallible-iterator = "0.3.0"
3838
fundu = "2.0.1"
3939
futures = "0.3"
4040
geo-types = "0.7"
41-
itertools = "0.13.0"
42-
mysql_async = { version = "0.34", features = [
41+
itertools = "0.14.0"
42+
mysql_async = { version = "0.35", features = [
4343
"native-tls-tls",
4444
"chrono",
45+
"time",
46+
"bigdecimal",
4547
], optional = true }
46-
native-tls = { version = "0.2.12", optional = true }
48+
native-tls = { version = "0.2", optional = true }
4749
num-bigint = "0.4"
48-
odbc-api = { version = "10.0.0", optional = true }
50+
odbc-api = { version = "10.1", optional = true }
4951
pem = { version = "3.0.4", optional = true }
5052
postgres-native-tls = { version = "0.5.0", optional = true }
5153
prost = { version = "0.13", optional = true }
52-
r2d2 = { version = "0.8.10", optional = true }
53-
rusqlite = { version = "0.32.1", optional = true }
54-
sea-query = { version = "0.32.0", features = [
54+
r2d2 = { version = "0.8", optional = true }
55+
rusqlite = { version = "0.32", optional = true }
56+
sea-query = { version = "0.32", features = [
5557
"backend-sqlite",
5658
"backend-postgres",
5759
"postgres-array",
@@ -63,11 +65,11 @@ sea-query = { version = "0.32.0", features = [
6365
secrecy = "0.8.0"
6466
serde = { version = "1.0", optional = true }
6567
serde_json = "1.0"
66-
sha2 = "0.10.8"
67-
snafu = "0.8.5"
68-
time = "0.3.36"
69-
tokio = { version = "1.41", features = ["macros", "fs"] }
70-
tokio-postgres = { version = "0.7.12", features = [
68+
sha2 = "0.10"
69+
snafu = "0.8"
70+
time = "0.3"
71+
tokio = { version = "1.43", features = ["macros", "fs"] }
72+
tokio-postgres = { version = "0.7", features = [
7173
"with-chrono-0_4",
7274
"with-uuid-1",
7375
"with-serde_json-1",
@@ -78,23 +80,23 @@ tonic = { version = "0.12", optional = true, features = [
7880
"tls-native-roots",
7981
"tls-webpki-roots",
8082
] }
81-
tracing = "0.1.40"
83+
tracing = "0.1"
8284
trust-dns-resolver = "0.23.2"
8385
url = "2.5.4"
84-
uuid = { version = "1.11.0", optional = true }
86+
uuid = { version = "1.11", optional = true }
8587

8688
[dev-dependencies]
8789
anyhow = "1.0"
8890
bollard = "0.18.1"
8991
geozero = { version = "0.14.0", features = ["with-wkb"] }
90-
insta = { version = "1.41.1", features = ["filters"] }
92+
insta = { version = "1.42.0", features = ["filters"] }
9193
prost = { version = "0.13" }
92-
rand = "0.8.5"
93-
reqwest = "0.12.9"
94-
rstest = "0.23.0"
95-
test-log = { version = "0.2.16", features = ["trace"] }
96-
tokio-stream = { version = "0.1.16", features = ["net"] }
97-
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
94+
rand = "0.8"
95+
reqwest = "0.12"
96+
rstest = "0.24.0"
97+
test-log = { version = "0.2", features = ["trace"] }
98+
tokio-stream = { version = "0.1", features = ["net"] }
99+
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
98100

99101
[features]
100102
duckdb = [
@@ -130,3 +132,8 @@ postgres = [
130132
postgres-federation = ["postgres", "federation"]
131133
sqlite = ["dep:rusqlite", "dep:tokio-rusqlite"]
132134
sqlite-federation = ["sqlite", "federation"]
135+
136+
[[example]]
137+
name = "odbc_sqlite"
138+
path = "examples/odbc_sqlite.rs"
139+
required-features = ["sqlite", "odbc"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ all:
33

44
.PHONY: test
55
test:
6-
cargo test --all-features
6+
cargo test --features duckdb-federation,flight,mysql-federation,postgres-federation,sqlite-federation
77

88
.PHONY: lint
99
lint:

src/flight/exec.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ use datafusion::common::Result;
3636
use datafusion::common::{project_schema, DataFusionError};
3737
use datafusion::execution::{SendableRecordBatchStream, TaskContext};
3838
use datafusion::physical_expr::{EquivalenceProperties, Partitioning};
39+
use datafusion::physical_plan::execution_plan::{Boundedness, EmissionType};
3940
use datafusion::physical_plan::stream::RecordBatchStreamAdapter;
40-
use datafusion::physical_plan::{
41-
DisplayAs, DisplayFormatType, ExecutionMode, ExecutionPlan, PlanProperties,
42-
};
41+
use datafusion::physical_plan::{DisplayAs, DisplayFormatType, ExecutionPlan, PlanProperties};
4342
use futures::{StreamExt, TryStreamExt};
4443
use serde::{Deserialize, Serialize};
4544
use tonic::metadata::{AsciiMetadataKey, MetadataMap};
@@ -84,13 +83,16 @@ impl FlightExec {
8483
impl From<FlightConfig> for FlightExec {
8584
fn from(config: FlightConfig) -> Self {
8685
let exec_mode = if config.properties.unbounded_streams {
87-
ExecutionMode::Unbounded
86+
Boundedness::Unbounded {
87+
requires_infinite_memory: false,
88+
}
8889
} else {
89-
ExecutionMode::Bounded
90+
Boundedness::Bounded
9091
};
9192
let plan_properties = PlanProperties::new(
9293
EquivalenceProperties::new(config.schema.clone()),
9394
Partitioning::UnknownPartitioning(config.partitions.len()),
95+
EmissionType::Incremental,
9496
exec_mode,
9597
);
9698
let mut mm = MetadataMap::new();

src/sql/arrow_sql_gen/mysql.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,8 @@ pub fn map_column_to_data_type(
568568
| ColumnType::MYSQL_TYPE_LONG_BLOB
569569
| ColumnType::MYSQL_TYPE_TINY_BLOB
570570
| ColumnType::MYSQL_TYPE_MEDIUM_BLOB
571-
| ColumnType::MYSQL_TYPE_GEOMETRY => {
571+
| ColumnType::MYSQL_TYPE_GEOMETRY
572+
| ColumnType::MYSQL_TYPE_VECTOR => {
572573
unimplemented!("Unsupported column type {:?}", column_type)
573574
}
574575
}

src/sql/sql_provider_datafusion/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use crate::sql::db_connection_pool::{
1212
use async_trait::async_trait;
1313
use datafusion::{
1414
catalog::Session,
15+
physical_plan::execution_plan::{Boundedness, EmissionType},
1516
sql::unparser::dialect::{
1617
DefaultDialect, Dialect, MySqlDialect, PostgreSqlDialect, SqliteDialect,
1718
},
@@ -32,8 +33,8 @@ use datafusion::{
3233
},
3334
physical_expr::EquivalenceProperties,
3435
physical_plan::{
35-
stream::RecordBatchStreamAdapter, DisplayAs, DisplayFormatType, ExecutionMode,
36-
ExecutionPlan, Partitioning, PlanProperties, SendableRecordBatchStream,
36+
stream::RecordBatchStreamAdapter, DisplayAs, DisplayFormatType, ExecutionPlan,
37+
Partitioning, PlanProperties, SendableRecordBatchStream,
3738
},
3839
sql::{unparser::Unparser, TableReference},
3940
};
@@ -295,7 +296,8 @@ impl<T, P> SqlExec<T, P> {
295296
properties: PlanProperties::new(
296297
EquivalenceProperties::new(projected_schema),
297298
Partitioning::UnknownPartitioning(1),
298-
ExecutionMode::Bounded,
299+
EmissionType::Incremental,
300+
Boundedness::Bounded,
299301
),
300302
})
301303
}

src/sqlite/sqlite_interval.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ impl SQLiteIntervalVisitor {
240240
over: None,
241241
within_group: Vec::new(),
242242
parameters: ast::FunctionArguments::None,
243+
uses_odbc_syntax: false,
243244
});
244245

245246
Expr::Cast {
@@ -409,6 +410,7 @@ mod test {
409410
over: None,
410411
within_group: Vec::new(),
411412
parameters: ast::FunctionArguments::None,
413+
uses_odbc_syntax: false,
412414
})),
413415
data_type: ast::DataType::Text,
414416
format: None,
@@ -458,6 +460,7 @@ mod test {
458460
over: None,
459461
within_group: Vec::new(),
460462
parameters: ast::FunctionArguments::None,
463+
uses_odbc_syntax: false,
461464
})),
462465
data_type: ast::DataType::Text,
463466
format: None,

src/util/test.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::{any::Any, sync::Arc};
22

33
use datafusion::arrow::{array::RecordBatch, datatypes::SchemaRef};
4+
use datafusion::physical_plan::execution_plan::{Boundedness, EmissionType};
45
use datafusion::{
56
common::Statistics,
67
error::{DataFusionError, Result},
@@ -9,7 +10,7 @@ use datafusion::{
910
physical_plan::{
1011
common,
1112
stream::{RecordBatchReceiverStream, RecordBatchStreamAdapter},
12-
DisplayAs, DisplayFormatType, ExecutionMode, ExecutionPlan, Partitioning, PlanProperties,
13+
DisplayAs, DisplayFormatType, ExecutionPlan, Partitioning, PlanProperties,
1314
},
1415
};
1516

@@ -59,7 +60,8 @@ impl MockExec {
5960
PlanProperties::new(
6061
eq_properties,
6162
Partitioning::UnknownPartitioning(1),
62-
ExecutionMode::Bounded,
63+
EmissionType::Incremental,
64+
Boundedness::Bounded,
6365
)
6466
}
6567
}

0 commit comments

Comments
 (0)