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

Method insert

parquet/src/arrow/array_reader/row_group_cache.rs:88–105  ·  view source on GitHub ↗

Inserts an array into the cache for the given column and starting row ID Returns true if the array was inserted, false if it would exceed the cache size limit

(&mut self, column_idx: usize, batch_id: BatchID, array: ArrayRef)

Source from the content-addressed store, hash-verified

86 /// Inserts an array into the cache for the given column and starting row ID
87 /// Returns true if the array was inserted, false if it would exceed the cache size limit
88 pub fn insert(&mut self, column_idx: usize, batch_id: BatchID, array: ArrayRef) -> bool {
89 let array_size = get_array_memory_size_for_cache(&array);
90
91 // Check if adding this array would exceed the cache size limit
92 if self.current_cache_size + array_size > self.max_cache_bytes {
93 return false; // Cache is full, don't insert
94 }
95
96 let key = CacheKey {
97 column_idx,
98 batch_id,
99 };
100
101 let existing = self.cache.insert(key, array);
102 assert!(existing.is_none());
103 self.current_cache_size += array_size;
104 true
105 }
106
107 /// Retrieves a cached array for the given column and row ID
108 /// Returns None if not found in cache

Callers 15

buildMethod · 0.45
try_newMethod · 0.45
fetch_batchMethod · 0.45
read_recordsMethod · 0.45
writeMethod · 0.45
putMethod · 0.45
encodeFunction · 0.45
parquet_to_arrow_fieldFunction · 0.45
test_metadataFunction · 0.45
convert_fieldFunction · 0.45

Calls 1