westonpace commented on code in PR #12852:
URL: https://github.com/apache/arrow/pull/12852#discussion_r870881168
##########
cpp/src/arrow/engine/substrait/extension_set.cc:
##########
@@ -174,31 +134,51 @@ Result<ExtensionSet>
ExtensionSet::Make(std::vector<util::string_view> uris,
}
Result<ExtensionSet::TypeRecord> ExtensionSet::DecodeType(uint32_t anchor)
const {
- if (anchor >= types_.size() || types_[anchor].id.empty()) {
+ if (types_.find(anchor) == types_.end() || types_.at(anchor).id.empty()) {
return Status::Invalid("User defined type reference ", anchor,
" did not have a corresponding anchor in the
extension set");
}
- return types_[anchor];
+ return types_.at(anchor);
Review Comment:
Ah, fair enough. I think you're probably right on the behavior for maps.
Thanks for the catch. Let's keep this as `at`
--
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]