• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vortex-data / vortex / 16992684502

15 Aug 2025 02:56PM UTC coverage: 87.875% (+0.2%) from 87.72%
16992684502

Pull #2456

github

web-flow
Merge 2d540e578 into 4a23f65b3
Pull Request #2456: feat: basic BoolBuffer / BoolBufferMut

1275 of 1428 new or added lines in 110 files covered. (89.29%)

334 existing lines in 31 files now uncovered.

57169 of 65057 relevant lines covered (87.88%)

658056.52 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

26.67
/vortex-array/src/arrow/record_batch.rs
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3

4
use arrow_array::RecordBatch;
5
use arrow_array::cast::AsArray;
6
use arrow_schema::{DataType, Schema};
7
use vortex_error::{VortexError, VortexResult, vortex_err};
8

9
use crate::arrays::StructArray;
10
use crate::arrow::compute::{to_arrow, to_arrow_preferred};
11
use crate::{Array, ToCanonical};
12

13
impl TryFrom<&dyn Array> for RecordBatch {
14
    type Error = VortexError;
15

16
    fn try_from(value: &dyn Array) -> VortexResult<Self> {
×
17
        let struct_arr = value.to_struct().map_err(|err| {
×
18
            vortex_err!("RecordBatch can only be constructed from a Vortex StructArray: {err}")
×
19
        })?;
×
20

21
        struct_arr.into_record_batch()
×
22
    }
×
23
}
24

25
impl StructArray {
26
    pub fn into_record_batch(self) -> VortexResult<RecordBatch> {
1,629✔
27
        let array_ref = to_arrow_preferred(self.as_ref())?;
1,629✔
28
        Ok(RecordBatch::from(array_ref.as_struct()))
1,629✔
29
    }
1,629✔
30

UNCOV
31
    pub fn into_record_batch_with_schema(self, schema: &Schema) -> VortexResult<RecordBatch> {
×
UNCOV
32
        let data_type = DataType::Struct(schema.fields.clone());
×
UNCOV
33
        let array_ref = to_arrow(self.as_ref(), &data_type)?;
×
UNCOV
34
        Ok(RecordBatch::from(array_ref.as_struct()))
×
UNCOV
35
    }
×
36
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc