himadripal commented on code in PR #7177:
URL: https://github.com/apache/arrow-rs/pull/7177#discussion_r1972383357


##########
arrow-cast/src/cast/mod.rs:
##########
@@ -8416,92 +8417,92 @@ mod tests {
     fn test_parse_string_to_decimal() {
         assert_eq!(
             Decimal128Type::format_decimal(
-                parse_string_to_decimal_native::<Decimal128Type>("123.45", 
2).unwrap(),
+                parse_decimal::<Decimal128Type>("123.45", 38, 2).unwrap(),

Review Comment:
   Idea is to move from parse_string_to_decimal_native and  to use 
parse_decimal while doing string to decimal casting 
[here](https://github.com/apache/arrow-rs/blob/a00f9f43a0530b9255e4f9940e43121deedb0cc7/arrow-cast/src/cast/decimal.rs#L396).
 Main reason is that parse_decimal has support for e-notation and is also being 
used in readers like (i.e 
[arrow-csv](https://github.com/apache/arrow-rs/blob/a00f9f43a0530b9255e4f9940e43121deedb0cc7/arrow-csv/src/reader/mod.rs#L657),
  
[arrow-json](https://github.com/apache/arrow-rs/blob/a00f9f43a0530b9255e4f9940e43121deedb0cc7/arrow-json/src/reader/decimal_array.rs#L51)
 and also performant, some discussion   
[here](https://github.com/apache/datafusion/issues/10315#issuecomment-2552112849)
 



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