diff --git a/arrow-json/src/reader/primitive_array.rs b/arrow-json/src/reader/primitive_array.rs index 624d5706b81e..a06394c28abe 100644 --- a/arrow-json/src/reader/primitive_array.rs +++ b/arrow-json/src/reader/primitive_array.rs @@ -45,7 +45,13 @@ macro_rules! primitive_parse { $(impl ParseJsonNumber for $t { fn parse(s: &[u8]) -> Option { match std::str::from_utf8(s) { - Ok(s) => s.to_string().parse::<$t>().ok(), + Ok(s) => { + if let Ok(res) = s.to_string().parse::<$t>() { + Some(res) + } else { + return s.to_string().parse::().ok().and_then(NumCast::from) + } + } Err(_) => None, } }