MCPcopy Create free account
hub / github.com/apache/arrow-rs / num_columns

Method num_columns

arrow-array/src/record_batch.rs:594–596  ·  view source on GitHub ↗

Returns the number of columns in the record batch. # Example ``` # use std::sync::Arc; # use arrow_array::{Int32Array, RecordBatch}; # use arrow_schema::{DataType, Field, Schema}; let id_array = Int32Array::from(vec![1, 2, 3, 4, 5]); let schema = Schema::new(vec![ Field::new("id", DataType::Int32, false) ]); let batch = RecordBatch::try_new(Arc::new(schema), vec![Arc::new(id_array)]).unwrap();

(&self)

Source from the content-addressed store, hash-verified

592 /// assert_eq!(batch.num_columns(), 1);
593 /// ```
594 pub fn num_columns(&self) -> usize {
595 self.columns.len()
596 }
597
598 /// Returns the number of rows in each column.
599 ///

Callers 8

writeMethod · 0.45
filter_record_batchFunction · 0.45
from_batchMethod · 0.45
compare_batchesFunction · 0.45
consume_flight_locationFunction · 0.45
validateFunction · 0.45

Calls 1

lenMethod · 0.45

Tested by 2

consume_flight_locationFunction · 0.36
validateFunction · 0.36