jhorstmann commented on code in PR #4785:
URL: https://github.com/apache/arrow-rs/pull/4785#discussion_r1318272872
##########
arrow-json/src/reader/primitive_array.rs:
##########
@@ -57,19 +57,31 @@ primitive_parse!(i8, i16, i32, i64, u8, u16, u32, u64);
impl ParseJsonNumber for f16 {
fn parse(s: &[u8]) -> Option<Self> {
- lexical_core::parse::<f32>(s).ok().map(f16::from_f32)
+ s.iter()
+ .map(|&b| b as char)
+ .collect::<String>()
Review Comment:
Since this file is json specific it might also be possible to use
`serde_json::from_slice(s).ok()`, but it seems this has slightly stricter
parsing and does not accept numbers such as `2e0` as integer (but does as
float).
--
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]