Skip to content

Commit 2ee09bb

Browse files
authored
Fix master (#2692)
1 parent 7a22ec0 commit 2ee09bb

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

arrow/src/compute/kernels/concat.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ pub fn concat(arrays: &[&dyn Array]) -> Result<ArrayRef> {
104104
}
105105

106106
/// Concatenates `batches` together into a single record batch.
107-
pub fn concat_batches(schema: &SchemaRef, batches: &[RecordBatch]) -> Result<RecordBatch> {
107+
pub fn concat_batches(
108+
schema: &SchemaRef,
109+
batches: &[RecordBatch],
110+
) -> Result<RecordBatch> {
108111
if batches.is_empty() {
109112
return Ok(RecordBatch::new_empty(schema.clone()));
110113
}
@@ -613,16 +616,16 @@ mod tests {
613616
Arc::new(StringArray::from(vec!["a", "b"])),
614617
],
615618
)
616-
.unwrap();
619+
.unwrap();
617620
let batch2 = RecordBatch::try_new(
618621
schema.clone(),
619622
vec![
620623
Arc::new(Int32Array::from(vec![3, 4])),
621624
Arc::new(StringArray::from(vec!["c", "d"])),
622625
],
623626
)
624-
.unwrap();
625-
let new_batch = RecordBatch::concat(&schema, &[batch1, batch2]).unwrap();
627+
.unwrap();
628+
let new_batch = concat_batches(&schema, &[batch1, batch2]).unwrap();
626629
assert_eq!(new_batch.schema().as_ref(), schema.as_ref());
627630
assert_eq!(2, new_batch.num_columns());
628631
assert_eq!(4, new_batch.num_rows());
@@ -634,7 +637,7 @@ mod tests {
634637
Field::new("a", DataType::Int32, false),
635638
Field::new("b", DataType::Utf8, false),
636639
]));
637-
let batch = RecordBatch::concat(&schema, &[]).unwrap();
640+
let batch = concat_batches(&schema, &[]).unwrap();
638641
assert_eq!(batch.schema().as_ref(), schema.as_ref());
639642
assert_eq!(0, batch.num_rows());
640643
}
@@ -656,16 +659,16 @@ mod tests {
656659
Arc::new(StringArray::from(vec!["a", "b"])),
657660
],
658661
)
659-
.unwrap();
662+
.unwrap();
660663
let batch2 = RecordBatch::try_new(
661664
schema2,
662665
vec![
663666
Arc::new(Int32Array::from(vec![3, 4])),
664667
Arc::new(StringArray::from(vec!["c", "d"])),
665668
],
666669
)
667-
.unwrap();
668-
let error = RecordBatch::concat(&schema1, &[batch1, batch2]).unwrap_err();
670+
.unwrap();
671+
let error = concat_batches(&schema1, &[batch1, batch2]).unwrap_err();
669672
assert_eq!(
670673
error.to_string(),
671674
"Invalid argument error: batches[1] schema is different with argument schema.",

0 commit comments

Comments
 (0)