-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
arrowChanges to the arrow crateChanges to the arrow crateenhancementAny new improvement worthy of a entry in the changelogAny new improvement worthy of a entry in the changelog
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
In the arrow-array/src/array/union_array.rs
file the UnionArray::is_dense
method is currently private. Because this method is private, the arrow-avro
Encoder
requires additional complexity to support Union type encoding to route between Sparse and Dense Union types.
By having UnionArray::is_dense
public, we could simplify this and just call is_dense
in the UnionEncoder
constructor method.
Describe the solution you'd like
In arrow-array/src/array/union_array.rs
:
fn is_dense(&self)
-> pub fn is_dense(&self)
Describe alternatives you've considered
Re-implementing the same logic inside of the arrow-avro
Encoder
, i.e.
Additional context
- Without Change
let DataType::Union(fields, UnionMode::Dense) = array.data_type() else {
return Err(ArrowError::SchemaError("Expected Dense UnionArray".into()));
};
- With Change
if !array.is_dense() {
return Err(ArrowError::SchemaError("Expected Dense UnionArray".into()));
}
alamb
Metadata
Metadata
Assignees
Labels
arrowChanges to the arrow crateChanges to the arrow crateenhancementAny new improvement worthy of a entry in the changelogAny new improvement worthy of a entry in the changelog