Regression: ParquetWriter.CreateRowGroup calls Stream.Position for no reason
See original GitHub issueVersion: Parquet.Net v… 4.10
Runtime Version: .Net 6
OS: Windows
Expected behavior
Writing to a writeable stream should not throw exceptions. This was true in v3.x.
Actual behavior
Writing to a write-only stream that does not support Position
throws an exception when calling CreateRowGroup
, because it instantiates a new ParquetRowGroupWriter()
, and the constructor asks for the stream’s Position
property.
The only thing it does with this value is to store it to a field that is never used. So not only is this throwing exceptions, it is doing so completely pointlessly.
Code snippet reproducing the behavior
var pipe = new System.IO.Pipelines.Pipe();
var input = pipe.Writer.AsStream(); //write-only stream
var pWriter = new ParquetWriter(GetSchema(), input); //GetSchema should simply return any valid schema
var group = writer.CreateRowGroup(); //explodes here
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Writing Parquet files using Parquet.NET works with local ...
The explanation for the file ending up empty is the line: blob.AppendBlockAsync(stream);. Note how the function called has the Async suffix.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
out in 4.1.1 😉
Thanks for merging the fix. Can you reply here to let me know when it’s in Nuget?