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

Method num_rows

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

Returns the number of rows in each column. # 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(); assert

(&self)

Source from the content-addressed store, hash-verified

614 /// assert_eq!(batch.num_rows(), 5);
615 /// ```
616 pub fn num_rows(&self) -> usize {
617 self.row_count
618 }
619
620 /// Get a reference to a column's array by index.
621 ///

Calls

no outgoing calls