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

Method new

parquet/src/arrow/array_reader/cached_array_reader.rs:94–115  ·  view source on GitHub ↗

Creates a new cached array reader with the specified role

(
        inner: Box<dyn ArrayReader>,
        cache: Arc<RwLock<RowGroupCache>>,
        column_idx: usize,
        role: CacheRole,
        metrics: ArrowReaderMetrics,
    )

Source from the content-addressed store, hash-verified

92impl CachedArrayReader {
93 /// Creates a new cached array reader with the specified role
94 pub fn new(
95 inner: Box<dyn ArrayReader>,
96 cache: Arc<RwLock<RowGroupCache>>,
97 column_idx: usize,
98 role: CacheRole,
99 metrics: ArrowReaderMetrics,
100 ) -> Self {
101 let batch_size = cache.read().unwrap().batch_size();
102
103 Self {
104 inner,
105 shared_cache: cache,
106 column_idx,
107 outer_position: 0,
108 inner_position: 0,
109 batch_size,
110 selections: BooleanBufferBuilder::new(0),
111 role,
112 local_cache: HashMap::new(),
113 metrics,
114 }
115 }
116
117 fn get_batch_id_from_position(&self, row_id: usize) -> BatchID {
118 BatchID {

Callers

nothing calls this directly

Calls 2

batch_sizeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected