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/22 16:13:14 UTC

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

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


##########
arrow-json/src/reader/schema.rs:
##########
@@ -476,6 +487,10 @@ fn collect_field_types_from_object(
 /// Infer the fields of a JSON file by reading all items from the JSON Value Iterator.
 ///
 /// The following type coercion logic is implemented:
+/// * Unsigned integer are converted to `UInt64`
+/// * Signed integer are converted to `Int64`
+/// * `Int64` and `UInt64` are converted to `Int64`

Review Comment:
   I mean the logic in the `coerce_data_type()` function, any suggestion to describe it accurately?
   ```rust
   (DataType::Int64, DataType::UInt64) | (DataType::UInt64, DataType::Int64) => {
       DataType::Int64
   }
   ```



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