andygrove commented on code in PR #6383:
URL: https://github.com/apache/arrow-rs/pull/6383#discussion_r1756050534


##########
arrow-cast/src/cast/dictionary.rs:
##########
@@ -203,10 +203,36 @@ pub(crate) fn cast_to_dictionary<K: 
ArrowDictionaryKeyType>(
         UInt32 => pack_numeric_to_dictionary::<K, UInt32Type>(array, 
dict_value_type, cast_options),
         UInt64 => pack_numeric_to_dictionary::<K, UInt64Type>(array, 
dict_value_type, cast_options),
         Decimal128(_, _) => {
-            pack_numeric_to_dictionary::<K, Decimal128Type>(array, 
dict_value_type, cast_options)
+            // pack_numeric_to_dictionary loses the precision and scale so we 
have to perform a
+            // second cast
+            let decimal_dict_max_precision_scale = 
pack_numeric_to_dictionary::<K, Decimal128Type>(

Review Comment:
   > We don't need to do second cast, but just need to change the dictionary 
value type after casting.
   
   I'm not sure how to do that. Could you give me some guidance?
   
   



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