MCPcopy Create free account
hub / github.com/apache/arrow / Init

Method Init

cpp/src/arrow/compute/light_array_internal.cc:207–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207Status ResizableArrayData::Init(const std::shared_ptr<DataType>& data_type,
208 MemoryPool* pool, int log_num_rows_min) {
209#ifndef NDEBUG
210 if (num_rows_allocated_ > 0) {
211 ARROW_DCHECK(data_type_ != nullptr);
212 const KeyColumnMetadata& metadata_before = column_metadata_;
213 ARROW_ASSIGN_OR_RAISE(KeyColumnMetadata metadata_after,
214 ColumnMetadataFromDataType(data_type));
215 ARROW_DCHECK(metadata_before.is_fixed_length == metadata_after.is_fixed_length &&
216 metadata_before.fixed_length == metadata_after.fixed_length);
217 }
218#endif
219 ARROW_DCHECK(data_type != nullptr);
220 ARROW_ASSIGN_OR_RAISE(column_metadata_, ColumnMetadataFromDataType(data_type));
221 Clear(/*release_buffers=*/false);
222 log_num_rows_min_ = log_num_rows_min;
223 data_type_ = data_type;
224 pool_ = pool;
225 return Status::OK();
226}
227
228void ResizableArrayData::Clear(bool release_buffers) {
229 num_rows_ = 0;

Callers 2

AppendSelectedMethod · 0.45
AppendNullsMethod · 0.45

Calls 3

ARROW_ASSIGN_OR_RAISEFunction · 0.50
OKFunction · 0.50

Tested by

no test coverage detected