You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/04/26 12:38:00 UTC
[GitHub] [arrow-rs] tustvold commented on a diff in pull request #4138: Infer Float64 for JSON Numerics Beyond Bounds of i64
tustvold commented on code in PR #4138:
URL: https://github.com/apache/arrow-rs/pull/4138#discussion_r1177817529
##########
arrow-json/src/reader/schema.rs:
##########
@@ -442,11 +442,10 @@ fn collect_field_types_from_object(
// inferring
}
Value::Number(n) => {
- if n.is_f64() {
- set_object_scalar_field_type(field_types, k, DataType::Float64)?;
- } else {
- // default to i64
+ if n.is_i64() {
set_object_scalar_field_type(field_types, k, DataType::Int64)?;
+ } else {
+ set_object_scalar_field_type(field_types, k, DataType::Float64)?;
Review Comment:
Could we get a test of this, showing it inferring f64 for i64::MAX?
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org