Multiple enumeration while serializing #556
Answered
by
aloneguid
raminrahimzada
asked this question in
Q&A
-
Library Version4.25.0 OSWindows OS Architecture64 bit How to reproduce?Hi, I have the following example code to reproduce: public sealed record class MyClass(int Id, Guid Hash);
static IEnumerable<MyClass> YieldAll()
{
Console.WriteLine("I am here");
yield return new MyClass(1, Guid.NewGuid());
yield return new MyClass(2, Guid.NewGuid());
}
static async Task Main()
{
const string path = "my_file.parquet";
await ParquetSerializer.SerializeAsync(YieldAll(), path);
} And the output was:
I think it should not enumerate my items twice and it is an issue because in my case I am connecting to the sql table containing millions of rows, so serializing fetches them twice Failing testNo response |
Beta Was this translation helpful? Give feedback.
Answered by
aloneguid
Sep 30, 2024
Replies: 1 comment
-
This is by design. Each property will incur full collection enumeration. It's a consequence of parquet being columnar format, so to fill one column we need to enumerate it. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
aloneguid
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is by design. Each property will incur full collection enumeration. It's a consequence of parquet being columnar format, so to fill one column we need to enumerate it.