Skip to content

Commit 8826f69

Browse files
chore: upgrade DataFusion family
Signed-off-by: luofucong <luofc@foxmail.com>
1 parent 8566bf1 commit 8826f69

31 files changed

Lines changed: 574 additions & 766 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ rust.unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }
100100
# See for more detaiils: https://github.com/rust-lang/cargo/issues/11329
101101
ahash = { version = "0.8", features = ["compile-time-rng"] }
102102
aquamarine = "0.6"
103-
arrow = { version = "57.0", features = ["prettyprint"] }
104-
arrow-array = { version = "57.0", default-features = false, features = ["chrono-tz"] }
105-
arrow-buffer = "57.0"
106-
arrow-cast = "57.0"
107-
arrow-flight = "57.0"
108-
arrow-ipc = { version = "57.0", default-features = false, features = ["lz4", "zstd"] }
109-
arrow-schema = { version = "57.0", features = ["serde"] }
103+
arrow = { version = "57.2", features = ["prettyprint"] }
104+
arrow-array = { version = "57.2", default-features = false, features = ["chrono-tz"] }
105+
arrow-buffer = "57.2"
106+
arrow-cast = "57.2"
107+
arrow-flight = "57.2"
108+
arrow-ipc = { version = "57.2", default-features = false, features = ["lz4", "zstd"] }
109+
arrow-schema = { version = "57.2", features = ["serde"] }
110110
async-stream = "0.3"
111111
async-trait = "0.1"
112112
# Remember to update axum-extra, axum-macros when updating axum
@@ -126,19 +126,19 @@ config = "0.13.0"
126126
const_format = "0.2"
127127
crossbeam-utils = "0.8"
128128
dashmap = "6.1"
129-
datafusion = "51.0"
130-
datafusion-common = "51.0"
131-
datafusion-datasource = "51.0"
132-
datafusion-expr = "51.0"
133-
datafusion-functions = "51.0"
134-
datafusion-functions-aggregate-common = "51.0"
135-
datafusion-optimizer = "51.0"
136-
datafusion-orc = { git = "https://github.com/GreptimeTeam/datafusion-orc.git", rev = "35f2e04bf81f2ab7b6f86c0450d6a77b7098d43e" }
137-
datafusion-pg-catalog = "0.13"
138-
datafusion-physical-expr = "51.0"
139-
datafusion-physical-plan = "51.0"
140-
datafusion-sql = "51.0"
141-
datafusion-substrait = "51.0"
129+
datafusion = "52.0"
130+
datafusion-common = "52.0"
131+
datafusion-datasource = "52.0"
132+
datafusion-expr = "52.0"
133+
datafusion-functions = "52.0"
134+
datafusion-functions-aggregate-common = "52.0"
135+
datafusion-optimizer = "52.0"
136+
datafusion-orc = "0.7"
137+
datafusion-pg-catalog = "0.14"
138+
datafusion-physical-expr = "52.0"
139+
datafusion-physical-plan = "52.0"
140+
datafusion-sql = "52.0"
141+
datafusion-substrait = "52.0"
142142
deadpool = "0.12"
143143
deadpool-postgres = "0.14"
144144
derive_builder = "0.20"
@@ -185,7 +185,7 @@ otel-arrow-rust = { git = "https://github.com/GreptimeTeam/otel-arrow", rev = "5
185185
"server",
186186
] }
187187
parking_lot = "0.12"
188-
parquet = { version = "57.0", default-features = false, features = ["arrow", "async", "object_store"] }
188+
parquet = { version = "57.2", default-features = false, features = ["arrow", "async", "object_store"] }
189189
paste = "1.0"
190190
pin-project = "1.0"
191191
pretty_assertions = "1.4.0"
@@ -224,7 +224,7 @@ simd-json = "0.15"
224224
similar-asserts = "1.6.0"
225225
smallvec = { version = "1", features = ["serde"] }
226226
snafu = "0.8"
227-
sqlparser = { version = "0.59.0", default-features = false, features = ["std", "visitor", "serde"] }
227+
sqlparser = { version = "0.60.0", default-features = false, features = ["std", "visitor", "serde"] }
228228
sqlx = { version = "0.8", default-features = false, features = ["any", "macros", "json", "runtime-tokio-rustls"] }
229229
strum = { version = "0.27", features = ["derive"] }
230230
sysinfo = "0.33"
@@ -323,20 +323,19 @@ git = "https://github.com/GreptimeTeam/greptime-meter.git"
323323
rev = "5618e779cf2bb4755b499c630fba4c35e91898cb"
324324

325325
[patch.crates-io]
326-
datafusion = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7143b2fc4492a7970774583ed0997a459f3e5c05" }
327-
datafusion-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7143b2fc4492a7970774583ed0997a459f3e5c05" }
328-
datafusion-expr = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7143b2fc4492a7970774583ed0997a459f3e5c05" }
329-
datafusion-functions = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7143b2fc4492a7970774583ed0997a459f3e5c05" }
330-
datafusion-functions-aggregate-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7143b2fc4492a7970774583ed0997a459f3e5c05" }
331-
datafusion-optimizer = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7143b2fc4492a7970774583ed0997a459f3e5c05" }
332-
datafusion-physical-expr = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7143b2fc4492a7970774583ed0997a459f3e5c05" }
333-
datafusion-physical-expr-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7143b2fc4492a7970774583ed0997a459f3e5c05" }
334-
datafusion-physical-plan = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7143b2fc4492a7970774583ed0997a459f3e5c05" }
335-
datafusion-pg-catalog = { git = "https://github.com/GreptimeTeam/datafusion-postgres.git", rev = "74ac8e2806be6de91ff192b97f64735392539d16" }
336-
datafusion-datasource = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7143b2fc4492a7970774583ed0997a459f3e5c05" }
337-
datafusion-sql = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7143b2fc4492a7970774583ed0997a459f3e5c05" }
338-
datafusion-substrait = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7143b2fc4492a7970774583ed0997a459f3e5c05" }
339-
sqlparser = { git = "https://github.com/GreptimeTeam/sqlparser-rs.git", rev = "d7d95a44889e099e32d78e9bad9bc00598faef28" } # on branch v0.59.x
326+
datafusion = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "dc4129282abc8a74eb1674690115ec899d4e5741" }
327+
datafusion-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "dc4129282abc8a74eb1674690115ec899d4e5741" }
328+
datafusion-expr = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "dc4129282abc8a74eb1674690115ec899d4e5741" }
329+
datafusion-functions = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "dc4129282abc8a74eb1674690115ec899d4e5741" }
330+
datafusion-functions-aggregate-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "dc4129282abc8a74eb1674690115ec899d4e5741" }
331+
datafusion-optimizer = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "dc4129282abc8a74eb1674690115ec899d4e5741" }
332+
datafusion-physical-expr = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "dc4129282abc8a74eb1674690115ec899d4e5741" }
333+
datafusion-physical-expr-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "dc4129282abc8a74eb1674690115ec899d4e5741" }
334+
datafusion-physical-plan = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "dc4129282abc8a74eb1674690115ec899d4e5741" }
335+
datafusion-datasource = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "dc4129282abc8a74eb1674690115ec899d4e5741" }
336+
datafusion-sql = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "dc4129282abc8a74eb1674690115ec899d4e5741" }
337+
datafusion-substrait = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "dc4129282abc8a74eb1674690115ec899d4e5741" }
338+
sqlparser = { git = "https://github.com/GreptimeTeam/sqlparser-rs.git", rev = "e8a3ac44693768965abf7030cd38ebcff53a4d29" } # on branch v0.60.x
340339

341340
[profile.release]
342341
debug = 1

src/common/datasource/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ workspace = true
1010
[dependencies]
1111
arrow.workspace = true
1212
arrow-schema.workspace = true
13-
async-compression = { version = "0.3", features = [
13+
async-compression = { version = "0.4", features = [
1414
"bzip2",
1515
"gzip",
1616
"xz",

src/common/datasource/src/error.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ pub enum Error {
203203
error: parquet::errors::ParquetError,
204204
},
205205

206-
#[snafu(display("Failed to build file stream"))]
207-
BuildFileStream {
206+
#[snafu(transparent)]
207+
DataFusion {
208208
#[snafu(implicit)]
209209
location: Location,
210210
#[snafu(source)]
@@ -241,8 +241,9 @@ impl ErrorExt for Error {
241241
| ReadRecordBatch { .. }
242242
| WriteRecordBatch { .. }
243243
| EncodeRecordBatch { .. }
244-
| BuildFileStream { .. }
245244
| OrcReader { .. } => StatusCode::Unexpected,
245+
246+
DataFusion { .. } => StatusCode::Internal,
246247
}
247248
}
248249

src/common/datasource/src/file_format.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,16 +313,13 @@ pub async fn file_to_stream(
313313
filename.to_string(),
314314
0,
315315
)]))
316-
.with_projection_indices(projection)
316+
.with_projection_indices(projection)?
317317
.with_file_compression_type(df_compression)
318318
.build();
319319

320320
let store = Arc::new(OpendalStore::new(store.clone()));
321-
let file_opener = file_source
322-
.with_projection(&config)
323-
.create_file_opener(store, &config, 0);
324-
let stream = FileStream::new(&config, 0, file_opener, &ExecutionPlanMetricsSet::new())
325-
.context(error::BuildFileStreamSnafu)?;
321+
let file_opener = file_source.create_file_opener(store, &config, 0)?;
322+
let stream = FileStream::new(&config, 0, file_opener, &ExecutionPlanMetricsSet::new())?;
326323

327324
Ok(Box::pin(stream))
328325
}

src/common/datasource/src/file_format/tests.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ struct Test<'a> {
4646
impl Test<'_> {
4747
async fn run(self, store: &ObjectStore) {
4848
let store = Arc::new(object_store_opendal::OpendalStore::new(store.clone()));
49-
let file_opener = self.file_source.create_file_opener(store, &self.config, 0);
49+
let file_opener = self
50+
.file_source
51+
.create_file_opener(store, &self.config, 0)
52+
.unwrap();
5053

5154
let result = FileStream::new(
5255
&self.config,

src/common/datasource/src/test_util.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,13 @@ pub async fn setup_stream_to_csv_test(
154154
let config = scan_config(None, origin_path, csv_source.clone());
155155
let size = store.read(origin_path).await.unwrap().len();
156156

157-
let csv_opener = csv_source.create_file_opener(
158-
Arc::new(object_store_opendal::OpendalStore::new(store.clone())),
159-
&config,
160-
0,
161-
);
157+
let csv_opener = csv_source
158+
.create_file_opener(
159+
Arc::new(object_store_opendal::OpendalStore::new(store.clone())),
160+
&config,
161+
0,
162+
)
163+
.unwrap();
162164
let stream = FileStream::new(&config, 0, csv_opener, &ExecutionPlanMetricsSet::new()).unwrap();
163165

164166
let (tmp_store, dir) = test_tmp_store("test_stream_to_csv");

src/common/function/src/aggrs/count_hash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ impl Accumulator for CountHashAccumulator {
428428
&self.random_state,
429429
&mut self.batch_hashes,
430430
)?;
431-
for hash in hashes.as_slice() {
431+
for hash in hashes {
432432
self.values.insert(*hash);
433433
}
434434
Ok(())

src/common/query/src/logical_plan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub fn rename_logical_plan_columns(
4848
plan.schema().qualified_field_from_column(&old_column)?;
4949

5050
for (qualifier, field) in plan.schema().iter() {
51-
if qualifier.eq(&qualifier_rename) && field.as_ref() == field_rename {
51+
if qualifier.eq(&qualifier_rename) && field == field_rename {
5252
projection.push(col(Column::from((qualifier, field))).alias(new_name));
5353
}
5454
}

src/file-engine/src/error.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ pub enum Error {
178178
location: Location,
179179
},
180180

181-
#[snafu(display("Failed to extract column from filter"))]
182-
ExtractColumnFromFilter {
181+
#[snafu(transparent)]
182+
DataFusion {
183183
#[snafu(source)]
184184
error: DataFusionError,
185185
#[snafu(implicit)]
@@ -225,8 +225,9 @@ impl ErrorExt for Error {
225225
| ManifestExists { .. }
226226
| BuildStream { .. }
227227
| ParquetScanPlan { .. }
228-
| UnexpectedEngine { .. }
229-
| ExtractColumnFromFilter { .. } => StatusCode::Unexpected,
228+
| UnexpectedEngine { .. } => StatusCode::Unexpected,
229+
230+
DataFusion { .. } => StatusCode::Internal,
230231
}
231232
}
232233

0 commit comments

Comments
 (0)