You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Folyd (via GitHub)" <gi...@apache.org> on 2023/06/16 15:58:22 UTC

[GitHub] [arrow-rs] Folyd commented on a diff in pull request #4420: fix: infer unsigned int as u64

Folyd commented on code in PR #4420:
URL: https://github.com/apache/arrow-rs/pull/4420#discussion_r1232432307


##########
arrow-json/src/reader/schema.rs:
##########
@@ -442,7 +442,9 @@ fn collect_field_types_from_object(
                 // inferring
             }
             Value::Number(n) => {
-                if n.is_i64() {
+                if n.is_u64() {
+                    set_object_scalar_field_type(field_types, k, DataType::UInt64)?;
+                } else if n.is_i64() {
                     set_object_scalar_field_type(field_types, k, DataType::Int64)?;

Review Comment:
   Yes, I prefer the unsigned one since `u64` has a wider positive-integer range than `i64`. If the number is negative, we treat it as an `i64`. This is a breaking change, would be allowed if we release the next major version?
   
   



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