pub fn try_new(schema: Schema, columns: Vec<ArrayRef>) -> Result<Self> {
        let options = RecordBatchOptions::default();
        Self::validate_new_batch(&schema, columns.as_slice(), &options)?;
        Ok(RecordBatch { schema, columns })
    }
/// Creates a `RecordBatch` from a schema and columns.
///
/// Expects the following:
///  * the vec of columns to not be empty
///  * the schema and column data types to have equal lengths
///    and match
///  * each array in columns to have the same length
///
/// If the conditions are not met, an error is returned.
///
/// # Example
///
/// ```
/// # use std::sync::Arc;
/// # use arrow2::array::Primitive;
/// # use arrow2::datatypes::{Schema, Field, DataType};
/// # use arrow2::record_batch::RecordBatch;
/// # fn main() -> arrow2::error::Result<()> {
/// let id_array = Primitive::from_slice(&[1i32, 2, 3, 4, 5]).to(DataType::Int32);
/// let schema = Schema::new(vec![
///     Field::new("id", DataType::Int32, false)
/// ]);
///
/// let batch = RecordBatch::try_new(
///     schema,
///     vec![Arc::new(id_array)]
/// )?;
/// # Ok(())
/// # }
/// ```
Creates a `RecordBatch` from a schema and columns.
Expects the following:
the vec of columns to not be empty
the schema and column data types to have equal lengths
and match
each array in columns to have the same length

If the conditions are not met, an error is returned.
Creates a ` RecordBatch ` from a schema and columns . Expects the following : the vec of columns to not be empty the schema and column data types to have equal lengths and match each array in columns to have the same length If the conditions are not met an error is returned .
pub fn try_new(schema: Schema, columns: Vec<ArrayRef>) -> Result<Self> {
        let options = RecordBatchOptions::default();
        Self::validate_new_batch(&schema, columns.as_slice(), &options)?;
        Ok(RecordBatch { schema, columns })
    }
pub fn try_new ( schema : Schema , columns : Vec < ArrayRef > ) -> Result < Self > { let options = RecordBatchOptions :: default ( ) ; Self :: validate_new_batch ( & schema , columns . as_slice ( ) , & options ) ? ; Ok ( RecordBatch { schema , columns } ) }
Creates a `RecordBatch` from a schema and columns.
Creates a ` RecordBatch ` from a schema and columns .
schema
Schema
columns
Vec<ArrayRef>
schema
Schema
columns
Vec<ArrayRef>
example
None
use std::sync::arc;
None
use arrow2::array::primitive;
None
use arrow2::datatypes::{schema, field, datatype};
None
use arrow2::record_batch::recordbatch;
None
fn main() -> arrow2::error::result<()> {


let batch = RecordBatch::try_new(
schema,
vec![Arc::new(id_array)]
)?.
let batch = RecordBatch :: try_new ( schema vec! [ Arc :: new ( id_array ) ] ) ? .
ok(())
None
}
None