Skip to content

Commit 1e79786

Browse files
committed
update datafusion for olympus; update SqlExec schema organized tables
1 parent 5bbbb32 commit 1e79786

File tree

3 files changed

+66
-23
lines changed

3 files changed

+66
-23
lines changed

Cargo.toml

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ license = "Apache-2.0"
88
description = "Extend the capabilities of DataFusion to support additional data sources via implementations of the `TableProvider` trait."
99

1010
[dependencies]
11-
arrow = "52.2.0"
12-
arrow-array = { version = "52.2.0", optional = true }
13-
arrow-cast = { version = "52.2.0", optional = true }
14-
arrow-flight = { version = "52.2.0", optional = true, features = ["flight-sql-experimental", "tls"] }
15-
arrow-schema = { version = "52.2.0", optional = true, features = ["serde"] }
16-
arrow-json = "52.2.0"
11+
arrow = "53.0.0"
12+
arrow-array = { version = "53.0.0", optional = true }
13+
arrow-cast = { version = "53.0.0", optional = true }
14+
arrow-flight = { version = "53.0.0", optional = true, features = [
15+
"flight-sql-experimental",
16+
"tls",
17+
] }
18+
arrow-schema = { version = "53.0.0", optional = true, features = ["serde"] }
19+
arrow-json = "53.0.0"
1720
async-stream = { version = "0.3.5", optional = true }
1821
async-trait = "0.1.80"
1922
num-bigint = "0.4.4"
@@ -23,12 +26,12 @@ bigdecimal = "0.4.5"
2326
bigdecimal_0_3_0 = { package = "bigdecimal", version = "0.3.0" }
2427
byteorder = "1.5.0"
2528
chrono = "0.4.38"
26-
datafusion = "41.0.0"
27-
datafusion-expr = { version = "41.0.0", optional = true }
28-
datafusion-physical-expr = { version = "41.0.0", optional = true }
29-
datafusion-physical-plan = { version = "41.0.0", optional = true }
30-
datafusion-proto = { version = "41.0.0", optional = true }
31-
datafusion-federation = { version = "0.2.2", features = ["sql"] }
29+
datafusion = "42.0.0"
30+
datafusion-expr = { version = "42.0.0", optional = true }
31+
datafusion-physical-expr = { version = "42.0.0", optional = true }
32+
datafusion-physical-plan = { version = "42.0.0", optional = true }
33+
datafusion-proto = { version = "42.0.0", optional = true }
34+
datafusion-federation = { version = "0.3.0", features = ["sql"] }
3235
duckdb = { version = "1", features = [
3336
"bundled",
3437
"r2d2",
@@ -38,18 +41,34 @@ duckdb = { version = "1", features = [
3841
], optional = true }
3942
fallible-iterator = "0.3.0"
4043
futures = "0.3.30"
41-
mysql_async = { version = "0.34.1", features = ["native-tls-tls", "chrono"], optional = true }
42-
prost = { version = "0.12" , optional = true } # pinned for arrow-flight compat
44+
mysql_async = { version = "0.34.1", features = [
45+
"native-tls-tls",
46+
"chrono",
47+
], optional = true }
48+
prost = { version = "0.13.3", optional = true } # pinned for arrow-flight compat
4349
r2d2 = { version = "0.8.10", optional = true }
4450
rusqlite = { version = "0.31.0", optional = true }
45-
sea-query = { version = "0.31.0", features = ["backend-sqlite", "backend-postgres", "postgres-array", "with-rust_decimal", "with-bigdecimal", "with-time", "with-chrono"] }
51+
sea-query = { version = "0.31.0", features = [
52+
"backend-sqlite",
53+
"backend-postgres",
54+
"postgres-array",
55+
"with-rust_decimal",
56+
"with-bigdecimal",
57+
"with-time",
58+
"with-chrono",
59+
] }
4660
secrecy = "0.8.0"
4761
serde = { version = "1.0.209", optional = true }
4862
serde_json = "1.0.124"
4963
snafu = "0.8.3"
5064
time = "0.3.36"
5165
tokio = { version = "1.38.0", features = ["macros", "fs"] }
52-
tokio-postgres = { version = "0.7.10", features = ["with-chrono-0_4", "with-uuid-1", "with-serde_json-1", "with-geo-types-0_7"], optional = true }
66+
tokio-postgres = { version = "0.7.10", features = [
67+
"with-chrono-0_4",
68+
"with-uuid-1",
69+
"with-serde_json-1",
70+
"with-geo-types-0_7",
71+
], optional = true }
5372
tracing = "0.1.40"
5473
uuid = { version = "1.9.1", optional = true }
5574
postgres-native-tls = { version = "0.5.0", optional = true }
@@ -79,7 +98,16 @@ arrow-schema = "52.2.0"
7998

8099
[features]
81100
mysql = ["dep:mysql_async", "dep:async-stream"]
82-
postgres = ["dep:tokio-postgres", "dep:uuid", "dep:postgres-native-tls", "dep:bb8", "dep:bb8-postgres", "dep:native-tls", "dep:pem", "dep:async-stream"]
101+
postgres = [
102+
"dep:tokio-postgres",
103+
"dep:uuid",
104+
"dep:postgres-native-tls",
105+
"dep:bb8",
106+
"dep:bb8-postgres",
107+
"dep:native-tls",
108+
"dep:pem",
109+
"dep:async-stream",
110+
]
83111
sqlite = ["dep:rusqlite", "dep:tokio-rusqlite"]
84112
duckdb = ["dep:duckdb", "dep:r2d2", "dep:uuid"]
85113
flight = [

src/sql/db_connection_pool/dbconnection/postgresconn.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,9 @@ impl<'a>
8686
&self,
8787
table_reference: &TableReference,
8888
) -> Result<SchemaRef, super::Error> {
89-
let rows = match self
90-
.conn
91-
.query(&format!("SELECT * FROM {table_reference} LIMIT 1"), &[])
92-
.await
93-
{
89+
let q = &format!("SELECT * FROM {table_reference} LIMIT 1");
90+
91+
let rows = match self.conn.query(q.as_str(), &[]).await {
9492
Ok(rows) => rows,
9593
Err(e) => {
9694
if let Some(error_source) = e.source() {

src/sql/sql_provider_datafusion/mod.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,24 @@ impl<T, P> SqlExec<T, P> {
311311
}
312312

313313
fn table_name_escaped(&self) -> String {
314-
self.ident_escaped(&self.table_reference.to_string())
314+
match &self.table_reference {
315+
TableReference::Bare { table } => self.ident_escaped(&table),
316+
TableReference::Partial { schema, table } => format!(
317+
"{}.{}",
318+
self.ident_escaped(&schema),
319+
self.ident_escaped(&table)
320+
),
321+
TableReference::Full {
322+
catalog,
323+
schema,
324+
table,
325+
} => format!(
326+
"{}.{}.{}",
327+
self.ident_escaped(&catalog),
328+
self.ident_escaped(&schema),
329+
self.ident_escaped(&table)
330+
),
331+
}
315332
}
316333

317334
fn column_name_escaped(&self, column_name: &str) -> String {

0 commit comments

Comments
 (0)