alamb commented on a change in pull request #1435:
URL: https://github.com/apache/arrow-rs/pull/1435#discussion_r827712787
##########
File path: arrow/src/array/array_dictionary.rs
##########
@@ -112,7 +112,11 @@ impl<'a, K: ArrowPrimitiveType> DictionaryArray<K> {
_ => data = data.null_count(0),
}
- Ok(data.build()?.into())
+ let array = unsafe { data.build_unchecked() };
+
+ array.validate_dictionary_offest()?;
Review comment:
I think the idea is that since the input to this function is a valid
array, then the array data itself is also valid.
Thus, we know that the dictionary keys are valid integers of type `K` but we
don't know that they are all within the range `0..dictionary_values.len()` so
that validation is still required. I think this PR makes this change
--
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]