[
https://issues.apache.org/jira/browse/ARROW-1757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16352988#comment-16352988
]
ASF GitHub Bot commented on ARROW-1757:
---------------------------------------
wesm commented on a change in pull request #1535: ARROW-1757: [C++] Add
DictionaryArray::FromArrays alternate ctor that can check or sanitized
"untrusted" indices
URL: https://github.com/apache/arrow/pull/1535#discussion_r166125700
##########
File path: cpp/src/arrow/array.h
##########
@@ -801,6 +782,38 @@ ARROW_EXTERN_TEMPLATE NumericArray<TimestampType>;
ARROW_EXPORT
Status ValidateArray(const Array& array);
+/// \brief Perform validation check to determine if all indices are within
+/// valid range (0 <= index < upper_bound)
+///
+/// \param[in] indices array of indices
+/// \param[in] upper_bound upper bound of valid range for indices
+/// \return Status
+template <typename ArrowType>
+Status ValidateArray(const std::shared_ptr<Array>& indices, const int64_t
upper_bound) {
Review comment:
Can you move this to `array.cc` and rename to `ValidateDictionaryIndices`?
This template does not need to be visible in the public API
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> [C++] Add DictionaryArray::FromArrays alternate ctor that can check or
> sanitized "untrusted" indices
> ----------------------------------------------------------------------------------------------------
>
> Key: ARROW-1757
> URL: https://issues.apache.org/jira/browse/ARROW-1757
> Project: Apache Arrow
> Issue Type: New Feature
> Components: C++
> Reporter: Wes McKinney
> Assignee: Panchen Xue
> Priority: Major
> Labels: pull-request-available
> Fix For: 0.9.0
>
>
> Related to ARROW-1658. This is related to the offset sanitization in
> {{ListArray::FromArrays}}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)