Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] Expose compressed file readers as NativeFile #19888

Closed
asfimport opened this issue Oct 20, 2018 · 8 comments
Closed

[Python] Expose compressed file readers as NativeFile #19888

asfimport opened this issue Oct 20, 2018 · 8 comments

Comments

@asfimport
Copy link

Reporter: Wes McKinney / @wesm
Assignee: Antoine Pitrou / @pitrou

PRs and other links:

Note: This issue was originally created as ARROW-3576. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
e.g. similar to gzip.GzipFile in Python

@asfimport
Copy link
Author

Antoine Pitrou / @pitrou:
NativeFile currently requires a RandomAccessFile, but compressed files are mere InputStream. Fixing this will require rethinking NativeFile semantics.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
Indeed, it would need to be modified to support file handles not supporting seek

@asfimport
Copy link
Author

Antoine Pitrou / @pitrou:
What should the API be here? CompressedReader and CompressedWriter classes (or CompressedInputStream CompressedOutputStream) would mirror the C++ API and make the implementation easy.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
I was thinking we could change NativeFile to have a single shared_ptr to the base FileInterface and then cast pointers depending on the capabilities of the file.

@asfimport
Copy link
Author

Antoine Pitrou / @pitrou:
That's a possible implementation, but I was asking more about the Python-visible API. Do we add a compression argument to the OSFile constructor? Something else?

@asfimport
Copy link
Author

Wes McKinney / @wesm:
Oh I see. I think having CompressedReader that takes any readable NativeFile (and CompressedWriter + writable NativeFile) is a good strategy

@asfimport
Copy link
Author

Wes McKinney / @wesm:
Issue resolved by pull request 2839
#2839

@asfimport asfimport added this to the 0.12.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants