Skip to content

Commit

Permalink
StructArray::columns return slice
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Nov 24, 2022
1 parent 5640a5b commit 12214d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions arrow-array/src/array/struct_array.rs
Expand Up @@ -67,8 +67,8 @@ impl StructArray {
}

/// Returns the fields of the struct array
pub fn columns(&self) -> Vec<&ArrayRef> {
self.boxed_fields.iter().collect()
pub fn columns(&self) -> &[ArrayRef] {
&self.boxed_fields
}

/// Returns child array refs of the struct array
Expand Down
2 changes: 1 addition & 1 deletion arrow-ipc/src/writer.rs
Expand Up @@ -177,7 +177,7 @@ impl IpcDataGenerator {
match column.data_type() {
DataType::Struct(fields) => {
let s = as_struct_array(column);
for (field, &column) in fields.iter().zip(s.columns().iter()) {
for (field, column) in fields.iter().zip(s.columns()) {
self.encode_dictionaries(
field,
column,
Expand Down

0 comments on commit 12214d4

Please sign in to comment.