albertlockett commented on code in PR #7611:
URL: https://github.com/apache/arrow-rs/pull/7611#discussion_r2144971950
##########
arrow-array/src/builder/generic_bytes_dictionary_builder.rs:
##########
@@ -152,6 +155,65 @@ 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;;
+ ///
+ /// let mut u8_keyed_builder = StringDictionaryBuilder::<UInt8Type>::new();
+ /// u8_keyed_builder.append("def").unwrap();
+ /// u8_keyed_builder.append_null();
+ /// u8_keyed_builder.append("abc").unwrap();
+ ///
+ /// // for some reason, we decide we need to upgrade the key type
Review Comment:
reworked the example to make this more clear
--
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]