Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 39 additions & 70 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,19 @@ ahash = { version = "0.8", default-features = false, features = [
"runtime-rng",
] }
apache-avro = { version = "0.21", default-features = false }
arrow = { version = "57.1.0", features = [
arrow = { version = "57.2.0", features = [
"prettyprint",
"chrono-tz",
] }
arrow-buffer = { version = "57.1.0", default-features = false }
arrow-flight = { version = "57.1.0", features = [
arrow-buffer = { version = "57.2.0", default-features = false }
arrow-flight = { version = "57.2.0", features = [
"flight-sql-experimental",
] }
arrow-ipc = { version = "57.1.0", default-features = false, features = [
arrow-ipc = { version = "57.2.0", default-features = false, features = [
"lz4",
] }
arrow-ord = { version = "57.1.0", default-features = false }
arrow-schema = { version = "57.1.0", default-features = false }
arrow-ord = { version = "57.2.0", default-features = false }
arrow-schema = { version = "57.2.0", default-features = false }
async-trait = "0.1.89"
bigdecimal = "0.4.8"
bytes = "1.11"
Expand Down Expand Up @@ -166,7 +166,7 @@ log = "^0.4"
num-traits = { version = "0.2" }
object_store = { version = "0.12.4", default-features = false }
parking_lot = "0.12"
parquet = { version = "57.1.0", default-features = false, features = [
parquet = { version = "57.2.0", default-features = false, features = [
"arrow",
"async",
"object_store",
Expand Down
7 changes: 4 additions & 3 deletions datafusion/common/src/scalar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8868,7 +8868,7 @@ mod tests {
.unwrap(),
ScalarValue::try_new_null(&DataType::Map(map_field_ref, false)).unwrap(),
ScalarValue::try_new_null(&DataType::Union(
UnionFields::new(vec![42], vec![field_ref]),
UnionFields::try_new(vec![42], vec![field_ref]).unwrap(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UnionMode::Dense,
))
.unwrap(),
Expand Down Expand Up @@ -8971,13 +8971,14 @@ mod tests {
}

// Test union type
let union_fields = UnionFields::new(
let union_fields = UnionFields::try_new(
vec![0, 1],
vec![
Field::new("i32", DataType::Int32, false),
Field::new("f64", DataType::Float64, false),
],
);
)
.unwrap();
let union_result = ScalarValue::new_default(&DataType::Union(
union_fields.clone(),
UnionMode::Sparse,
Expand Down
4 changes: 2 additions & 2 deletions datafusion/datasource-avro/src/avro_to_arrow/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ fn schema_to_field_with_props(
.iter()
.map(|s| schema_to_field_with_props(s, None, has_nullable, None))
.collect::<Result<Vec<Field>>>()?;
let type_ids = 0_i8..fields.len() as i8;
DataType::Union(UnionFields::new(type_ids, fields), UnionMode::Dense)
// Assign type_ids based on the order in which they appear
DataType::Union(UnionFields::from_fields(fields), UnionMode::Dense)
}
}
AvroSchema::Record(RecordSchema { fields, .. }) => {
Expand Down
5 changes: 3 additions & 2 deletions datafusion/functions/src/core/union_extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,14 @@ mod tests {
fn test_scalar_value() -> Result<()> {
let fun = UnionExtractFun::new();

let fields = UnionFields::new(
let fields = UnionFields::try_new(
vec![1, 3],
vec![
Field::new("str", DataType::Utf8, false),
Field::new("int", DataType::Int32, false),
],
);
)
.unwrap();

let args = vec![
ColumnarValue::Scalar(ScalarValue::Union(
Expand Down
5 changes: 3 additions & 2 deletions datafusion/physical-plan/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1557,13 +1557,14 @@ mod tests {
#[test]
fn test_equivalence_properties_union_type() -> Result<()> {
let union_type = DataType::Union(
UnionFields::new(
UnionFields::try_new(
vec![0, 1],
vec![
Field::new("f1", DataType::Int32, true),
Field::new("f2", DataType::Utf8, true),
],
),
)
.unwrap(),
UnionMode::Sparse,
);

Expand Down
Loading