scovich commented on PR #7783: URL: https://github.com/apache/arrow-rs/pull/7783#issuecomment-3025373479
> What I suggest is that we do this incrementally: > > 1. Implement basic JSON decoding (this PR) merged without proper decimal handling > > 2. Mark any failing tests as `#[ignore]` and file a ticket to fix the json decoding in a follow on PR > > 3. Merge this one in Seems reasonable. And as a quick-follow, it's not _that_ hard to manually parse a JSON numeric string literal to Variant (pathfinding already done). The [grammar](https://www.json.org/json-en.html) is _super_ simple, basically: ``` E := "e" | "E" number := signed_integer (. unsigned_integer)? ( E signed_integer )? ``` And for parsing, it's basically: * If contains "e" or "E" => parse as double * else if contains "." => parse as decimal * fall back to double if precision is higher than 38 * else parse as int * fall back to decimal if precision is 20..=38 * fall back to double if precision is higher than 38 ```rust if !strval.contains(['e', 'E']) { // not obviously float if !strval.contains(".") { // not obviously decimal if let Ok(val) = parse_variant_int(strval) { return Ok(val); } } if let Ok(val) = parse_variant_decimal(strval) { return Ok(val); } } parse_variant_float(strval) ``` -- 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