Reranko05 commented on code in PR #50500:
URL: https://github.com/apache/arrow/pull/50500#discussion_r3637241089
##########
cpp/src/arrow/util/key_value_metadata.cc:
##########
@@ -126,6 +126,7 @@ Status KeyValueMetadata::DeleteMany(std::vector<int64_t>
indices) {
DCHECK_GE(stop, 0);
DCHECK_LE(stop, size);
for (int64_t index = start; index < stop; ++index) {
+ DCHECK_GE(index - shift, 0);
Review Comment:
I noticed `DeleteMany` returns `Status`, but the function currently relies
on DCHECKs for validating assumptions. Would it make sense to reject duplicate
or otherwise invalid indices with `Status::Invalid` instead? That would provide
runtime validation rather than only catching the issue in assertion-enabled
builds.
--
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]