alamb commented on code in PR #7611:
URL: https://github.com/apache/arrow-rs/pull/7611#discussion_r2145111340


##########
arrow-array/src/builder/generic_bytes_dictionary_builder.rs:
##########
@@ -152,6 +155,71 @@ where
             values_builder,
         })
     }
+
+    /// Creates a new `GenericByteDictionaryBuilder` from the existing builder 
with the same
+    /// keys and values, but with a new data type for the keys.
+    ///
+    /// # Example
+    /// ```
+    /// #
+    /// # use arrow_array::builder::StringDictionaryBuilder;
+    /// # use arrow_array::types::{UInt8Type, UInt16Type};
+    /// # use arrow_array::UInt16Array;
+    /// # use arrow_schema::ArrowError;
+    ///
+    /// let mut u8_keyed_builder = StringDictionaryBuilder::<UInt8Type>::new();
+    ///
+    /// // appending too many values causes the dictionary to overflow
+    /// for i in 0..256 {
+    ///     u8_keyed_builder.append_value(format!("{}", i));
+    /// }
+    /// let result = u8_keyed_builder.append("256");
+    /// assert!(matches!(result, 
Err(ArrowError::DictionaryKeyOverflowError{})));

Review Comment:
   this is great



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to