pitrou commented on code in PR #43760:
URL: https://github.com/apache/arrow/pull/43760#discussion_r1735982133
##########
cpp/src/arrow/compute/light_array_internal.cc:
##########
@@ -235,6 +237,7 @@ void ResizableArrayData::Clear(bool release_buffers) {
Status ResizableArrayData::ResizeFixedLengthBuffers(int num_rows_new) {
ARROW_DCHECK(num_rows_new >= 0);
+ ARROW_DCHECK(data_type_ != nullptr);
Review Comment:
I agree with @zanmato1984 that this doesn't seem terribly useful.
##########
cpp/src/arrow/compute/light_array_internal.cc:
##########
@@ -205,22 +204,25 @@ Status ColumnArraysFromExecBatch(const ExecBatch& batch,
column_arrays);
}
-void ResizableArrayData::Init(const std::shared_ptr<DataType>& data_type,
- MemoryPool* pool, int log_num_rows_min) {
+Status ResizableArrayData::Init(const std::shared_ptr<DataType>& data_type,
+ MemoryPool* pool, int log_num_rows_min) {
#ifndef NDEBUG
if (num_rows_allocated_ > 0) {
- ARROW_DCHECK(data_type_ != NULLPTR);
- KeyColumnMetadata metadata_before =
- ColumnMetadataFromDataType(data_type_).ValueOrDie();
- KeyColumnMetadata metadata_after =
ColumnMetadataFromDataType(data_type).ValueOrDie();
+ ARROW_DCHECK(data_type_ != nullptr);
+ const KeyColumnMetadata& metadata_before = column_metadata_;
+ ARROW_ASSIGN_OR_RAISE(KeyColumnMetadata metadata_after,
+ ColumnMetadataFromDataType(data_type));
ARROW_DCHECK(metadata_before.is_fixed_length ==
metadata_after.is_fixed_length &&
metadata_before.fixed_length == metadata_after.fixed_length);
}
#endif
+ ARROW_DCHECK(data_type != nullptr);
Review Comment:
Can you avoid duplicating this line?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]