question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regression: ParquetWriter.CreateRowGroup calls Stream.Position for no reason

See original GitHub issue

Version: 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:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
aloneguidcommented, Nov 10, 2022

out in 4.1.1 😉

0reactions
Pansynchro-Admincommented, Nov 9, 2022

Thanks for merging the fix. Can you reply here to let me know when it’s in Nuget?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found