Giter VIP home page Giter VIP logo

Comments (4)

adamreeve avatar adamreeve commented on September 16, 2024 1

Hi @delreluca, yes your explanation for what is happening is correct. ManagedRandomAccessFile is IDisposable so it's intended to be used with a using statement and only disposed after it is no longer needed.

This isn't the first time someone has run into this issue though, see #266 for example. So it would probably make sense for ParquetFileReader to keep a handle to the RandomAccessFile to avoid this issue. And similarly, ParquetFileWriter should keep a handle to an OutputStream when one is used.

from parquetsharp.

adamreeve avatar adamreeve commented on September 16, 2024 1

This has been fixed on master now, you should still dispose of the ManagedRandomAccessFile yourself with a using statement, but ParquetSharp should no longer crash if you don't.

from parquetsharp.

delreluca avatar delreluca commented on September 16, 2024

Ah, I missed that issue, sorry. Thanks for confirming my explanation, I can just fix my code with the additional using then.

I would welcome remembering the handle since I would have expected an IDisposable to also dispose of whatever it received as a reference in its constructor. (Not sure if that is a written best practice? Just a gut feeling)

from parquetsharp.

adamreeve avatar adamreeve commented on September 16, 2024

I'm not sure it makes sense for ParquetFileReader/Writer to actually dispose of the ManagedRandomAccessFile or OutputStream. That would be a breaking change if someone is relying on being able to reuse them afterwards. But it seems sensible for the reader and writer to just hold a reference to prevent these objects from being garbage collected while in use.

from parquetsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.