Skip to content

Commit 617700d

Browse files
authored
Upgrade DataFusion to arrow-rs/parquet 57.2.0 (apache#19355)
## Which issue does this PR close? - Related to apache/arrow-rs#8465 - Closes apache#19290 ## Rationale for this change Upgrade to latest arrow version I made this PR early to test the arrow release with DataFusion ## What changes are included in this PR? 1. Update arrow 2. Updates for API ## Are these changes tested? Yes by CI ## Are there any user-facing changes? No
1 parent 6267fee commit 617700d

File tree

12 files changed

+116
-116
lines changed

12 files changed

+116
-116
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,19 @@ ahash = { version = "0.8", default-features = false, features = [
9191
"runtime-rng",
9292
] }
9393
apache-avro = { version = "0.21", default-features = false }
94-
arrow = { version = "57.1.0", features = [
94+
arrow = { version = "57.2.0", features = [
9595
"prettyprint",
9696
"chrono-tz",
9797
] }
98-
arrow-buffer = { version = "57.1.0", default-features = false }
99-
arrow-flight = { version = "57.1.0", features = [
98+
arrow-buffer = { version = "57.2.0", default-features = false }
99+
arrow-flight = { version = "57.2.0", features = [
100100
"flight-sql-experimental",
101101
] }
102-
arrow-ipc = { version = "57.1.0", default-features = false, features = [
102+
arrow-ipc = { version = "57.2.0", default-features = false, features = [
103103
"lz4",
104104
] }
105-
arrow-ord = { version = "57.1.0", default-features = false }
106-
arrow-schema = { version = "57.1.0", default-features = false }
105+
arrow-ord = { version = "57.2.0", default-features = false }
106+
arrow-schema = { version = "57.2.0", default-features = false }
107107
async-trait = "0.1.89"
108108
bigdecimal = "0.4.8"
109109
bytes = "1.11"
@@ -166,7 +166,7 @@ log = "^0.4"
166166
num-traits = { version = "0.2" }
167167
object_store = { version = "0.12.4", default-features = false }
168168
parking_lot = "0.12"
169-
parquet = { version = "57.1.0", default-features = false, features = [
169+
parquet = { version = "57.2.0", default-features = false, features = [
170170
"arrow",
171171
"async",
172172
"object_store",

datafusion/common/src/scalar/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8868,7 +8868,7 @@ mod tests {
88688868
.unwrap(),
88698869
ScalarValue::try_new_null(&DataType::Map(map_field_ref, false)).unwrap(),
88708870
ScalarValue::try_new_null(&DataType::Union(
8871-
UnionFields::new(vec![42], vec![field_ref]),
8871+
UnionFields::try_new(vec![42], vec![field_ref]).unwrap(),
88728872
UnionMode::Dense,
88738873
))
88748874
.unwrap(),
@@ -8971,13 +8971,14 @@ mod tests {
89718971
}
89728972

89738973
// Test union type
8974-
let union_fields = UnionFields::new(
8974+
let union_fields = UnionFields::try_new(
89758975
vec![0, 1],
89768976
vec![
89778977
Field::new("i32", DataType::Int32, false),
89788978
Field::new("f64", DataType::Float64, false),
89798979
],
8980-
);
8980+
)
8981+
.unwrap();
89818982
let union_result = ScalarValue::new_default(&DataType::Union(
89828983
union_fields.clone(),
89838984
UnionMode::Sparse,

datafusion/datasource-avro/src/avro_to_arrow/schema.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ fn schema_to_field_with_props(
117117
.iter()
118118
.map(|s| schema_to_field_with_props(s, None, has_nullable, None))
119119
.collect::<Result<Vec<Field>>>()?;
120-
let type_ids = 0_i8..fields.len() as i8;
121-
DataType::Union(UnionFields::new(type_ids, fields), UnionMode::Dense)
120+
// Assign type_ids based on the order in which they appear
121+
DataType::Union(UnionFields::from_fields(fields), UnionMode::Dense)
122122
}
123123
}
124124
AvroSchema::Record(RecordSchema { fields, .. }) => {

datafusion/functions/src/core/union_extract.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,14 @@ mod tests {
189189
fn test_scalar_value() -> Result<()> {
190190
let fun = UnionExtractFun::new();
191191

192-
let fields = UnionFields::new(
192+
let fields = UnionFields::try_new(
193193
vec![1, 3],
194194
vec![
195195
Field::new("str", DataType::Utf8, false),
196196
Field::new("int", DataType::Int32, false),
197197
],
198-
);
198+
)
199+
.unwrap();
199200

200201
let args = vec![
201202
ColumnarValue::Scalar(ScalarValue::Union(

datafusion/physical-plan/src/filter.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,13 +1557,14 @@ mod tests {
15571557
#[test]
15581558
fn test_equivalence_properties_union_type() -> Result<()> {
15591559
let union_type = DataType::Union(
1560-
UnionFields::new(
1560+
UnionFields::try_new(
15611561
vec![0, 1],
15621562
vec![
15631563
Field::new("f1", DataType::Int32, true),
15641564
Field::new("f2", DataType::Utf8, true),
15651565
],
1566-
),
1566+
)
1567+
.unwrap(),
15671568
UnionMode::Sparse,
15681569
);
15691570

0 commit comments

Comments
 (0)