| 205 | } |
| 206 | |
| 207 | Status 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 | |
| 228 | void ResizableArrayData::Clear(bool release_buffers) { |
| 229 | num_rows_ = 0; |
no test coverage detected