diff --git a/src/Parquet.Test/Serialisation/ParquetSerializerTest.cs b/src/Parquet.Test/Serialisation/ParquetSerializerTest.cs index d4a98018..8c44115a 100644 --- a/src/Parquet.Test/Serialisation/ParquetSerializerTest.cs +++ b/src/Parquet.Test/Serialisation/ParquetSerializerTest.cs @@ -1078,5 +1078,28 @@ public async Task Class_With_Nullable_Struct() { Assert.Equivalent(data2, data); } + + class EdgeCaseInt32 { + public int Id { get; set; } + } + + [Fact] + public async Task EdgeCase_rawint64_to_classInt32() { + var schema = new ParquetSchema(new DataField("Id")); + using var ms = new MemoryStream(); + using(ParquetWriter writer = await ParquetWriter.CreateAsync(schema, ms)) { + using(ParquetRowGroupWriter rg = writer.CreateRowGroup()) { + await rg.WriteColumnAsync(new DataColumn(schema.DataFields[0], new long[] { 1, 2, 3 })); + } + } + ms.Position = 0; + + IList data = await ParquetSerializer.DeserializeAsync(ms); + + Assert.Equal(1, data[0].Id); + Assert.Equal(2, data[1].Id); + Assert.Equal(3, data[2].Id); + + } } }