andishgar commented on code in PR #47586:
URL: https://github.com/apache/arrow/pull/47586#discussion_r2414089030
##########
cpp/src/arrow/tensor/coo_converter.cc:
##########
@@ -220,7 +265,8 @@ class SparseCOOTensorConverter : private
SparseTensorConverterMixin {
indices_shape, indices_strides);
ARROW_ASSIGN_OR_RAISE(sparse_index, SparseCOOIndex::Make(coords, true));
data = std::move(values_buffer);
-
+ DCHECK_OK((ValidateSparseCooTensorCreation<ValueType,
IndexType>(*sparse_index, *data,
Review Comment:
>Hmm, so this is only executed in debug mode? Note this is a O(n) function
with n potentially large, so I'm not >sure we really want to run this every
time a tensor is converted.
I checked this, and it’s fine — it only runs in debug mode.
The way I verified it:
1. I built Arrow in **Release mode**.
2. I modified the code to return `Status::Invalid` regardless of logic
correctness.
3. I ran the benchmark:
* With `DCHECK_OK`, **no fatal error** was triggered.
* Then I replaced `DCHECK_OK` with `ARROW_RETURN_NOT_OK`, and an **Arrow
fatal error** was emitted.
From this, I conclude that `DCHECK_OK` only executes in debug mode.
--
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]