veluca93 commented on code in PR #6025:
URL: https://github.com/apache/arrow-rs/pull/6025#discussion_r1689160729


##########
parquet/src/arrow/buffer/dictionary_buffer.rs:
##########
@@ -162,6 +162,10 @@ impl<K: ArrowNativeType + Ord, V: OffsetSizeTrait> 
DictionaryBuffer<K, V> {
 
                 let data = match cfg!(debug_assertions) {
                     true => builder.build().unwrap(),
+                    // SAFETY: FIXME: this is unsound. data_type is passed by 
the caller without

Review Comment:
   I haven't had a lot of time - I've been busy and I am at a programming 
competition this week - but I can confirm that the code as written is unsound 
(even if the unsoundness cannot trigger undefined behaviour): validating the 
data type, or marking the function as unsafe and writing down in the caller why 
the data type is correct would fix the issue.



-- 
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]

Reply via email to