Skip to content

Regression when serializing large json numbers #5038

@Blajda

Description

@Blajda

Describe the bug
Serializing and writing a json Number Number(1699148028689) to parquet using arrow_json the value is not preserved.
When the value is read back from the parquet file, we obtain -1659020527.

To Reproduce

    #[test]
    fn test_serde_field() {
        let field = Field::new("int", DataType::Int64, true);
        let mut decoder = ReaderBuilder::new_with_field(field)
            .build_decoder()
            .unwrap();
        decoder.serialize(&[1699148028689_u64, 2, 3, 4]).unwrap();
        let b = decoder.flush().unwrap().unwrap();
        let values = b.column(0).as_primitive::<Int64Type>().values();
        assert_eq!(values, &[1699148028689, 2, 3, 4]);
    }

Metadata

Metadata

Assignees

Labels

arrowChanges to the arrow cratebug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions