SteveLauC commented on code in PR #4138:
URL: https://github.com/apache/arrow-rs/pull/4138#discussion_r1177862981
##########
arrow-json/src/reader/schema.rs:
##########
@@ -663,6 +662,24 @@ mod tests {
assert_eq!(inferred_schema, schema);
}
+ #[test]
+ fn test_infer_json_schema_bigger_than_i64_max() {
+ let bigger_than_i64_max = (i64::MAX as i128) + 1;
+ let smaller_than_i64_min = (i64::MIN as i128) - 1;
+ let json = format!(
+ "{{ \"bigger_than_i64_max\": {}, \"smaller_than_i64_min\": {} }}",
+ bigger_than_i64_max, smaller_than_i64_min
+ );
Review Comment:
[serde_json::json!](https://docs.rs/serde_json/latest/serde_json/macro.json.html)
cannot be used here to construct this json as it will panic when encountering
a number smaller than `i64::MIN`
--
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]