thinkharderdev commented on code in PR #5488:
URL: https://github.com/apache/arrow-rs/pull/5488#discussion_r1523906325
##########
arrow-flight/src/encode.rs:
##########
@@ -537,19 +599,54 @@ fn prepare_batch_for_flight(
/// Hydrates a dictionary to its underlying type if send_dictionaries is
false. If send_dictionaries
/// is true, dictionaries are sent with every batch which is not as optimal as
described in [DictionaryHandling::Hydrate] above,
/// but does enable sending DictionaryArray's via Flight.
-fn hydrate_dictionary(array: &ArrayRef, send_dictionaries: bool) ->
Result<ArrayRef> {
- let arr = match array.data_type() {
- DataType::Dictionary(_, value) if !send_dictionaries =>
arrow_cast::cast(array, value)?,
+fn hydrate_dictionary(
+ array: &ArrayRef,
+ data_type: &DataType,
+ send_dictionaries: bool,
+) -> Result<ArrayRef> {
+ let arr = match (array.data_type(), data_type) {
+ (DataType::Dictionary(_, value), _) if !send_dictionaries => {
Review Comment:
Changed this and also renamed this method to `hydrate_dictionaries` since we
only need to call when we have `DictionaryHandling::Hydrate`. In the case of
`Resend` I just skip this entirely to avoid the pointless clones
--
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]