You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "juanluispaz (via GitHub)" <gi...@apache.org> on 2025/10/03 13:37:19 UTC
[I] Compression level [arrow]
juanluispaz opened a new issue, #47694:
URL: https://github.com/apache/arrow/issues/47694
### Describe the enhancement requested
In python, there are plenty of places where compression can be used as string, but, there is not a way to set the compression level; like in pyarrow file system. It will be nice to have it, or any other way to deal with different compression level. What I am able to find is the Codec class, put that doesn't allow having stream, and the stream class doesn't allow specifying the compression level
### Component(s)
Python
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Python] Allow Compression level to be used on CompressedOutputStream and output_stream related classes that allows for compression to be defined [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #47694:
URL: https://github.com/apache/arrow/issues/47694#issuecomment-5980300512
This issue has been marked as stale because it has had no activity in the past 365 days. Please remove the stale label or comment below, or this issue will be closed in 14 days. If this improvement is still desired but has no current owner, please add the 'Status: needs champion' label.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Python] Compression level [arrow]
Posted by "juanluispaz (via GitHub)" <gi...@apache.org>.
juanluispaz commented on issue #47694:
URL: https://github.com/apache/arrow/issues/47694#issuecomment-3365959662
Sure:
There is no way to set the compression level:
- In the class [CompressedOutputStream](https://arrow.apache.org/docs/python/generated/pyarrow.CompressedOutputStream.html)
- In the function [output_stream](https://arrow.apache.org/docs/python/generated/pyarrow.output_stream.html)
- In the file system's function [open_output_stream](https://arrow.apache.org/docs/python/generated/pyarrow.fs.FileSystem.html#pyarrow.fs.FileSystem.open_output_stream) and derivates classes
- In the file system's function [open_append_stream](https://arrow.apache.org/docs/python/generated/pyarrow.fs.FileSystem.html#pyarrow.fs.FileSystem.open_append_stream) and derivates classes
What I'm trying to do is to write a file that must be compressed with a custom compression level.
The class [Codec](https://arrow.apache.org/docs/python/generated/pyarrow.Codec.html) allows specifying the compression level, and even allows compressing chunks, but there is no a pathway to get a compressed output stream with a custom compression level.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Python] Allow Compression level to be used on CompressedOutputStream and output_stream related classes that allows for compression to be defined [arrow]
Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on issue #47694:
URL: https://github.com/apache/arrow/issues/47694#issuecomment-3366010252
This sounds reasonable to me, we could probably expose a compression_level on the API and allow to create the internal Codec with that, here:
https://github.com/apache/arrow/blob/ef718a7da55e053c92b5ae24dced5b644fe63e52/python/pyarrow/io.pxi#L1827-L1837
We probably should also do that for `CompressedInputStream` too.
@AlenkaF what do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Python] Compression level [arrow]
Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on issue #47694:
URL: https://github.com/apache/arrow/issues/47694#issuecomment-3365877994
Hi @juanluispaz , I am not sure I understand what you are referring to here. Can you share a pseudocode example of what you are suggesting or show a specific case on an API where you are missing ? Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Python] Allow Compression level to be used on CompressedOutputStream and output_stream related classes that allows for compression to be defined [arrow]
Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on issue #47694:
URL: https://github.com/apache/arrow/issues/47694#issuecomment-3367219432
Yes, that is a good idea. In the C++ implementation the `CompressedInputStream` and `CompressedOutputStream` accept `Codec` with additional parameter `compression_level`, see https://arrow.apache.org/docs/cpp/api/io.html#compressed-input-output-wrappers. So we can at least add `compression_level` as an optional parameter.
@raulcd already added the information of which part of the code would need an update. As we create the `Codec` class instead of the user, `compression_level` only needs to be passed to the constructor to make this work.
Would be nice, IMO, to have the same signature as in the C++ where `Codec` class is passed as the parameter. That would be a braking change though as it would make sense to remove the `compression` then. So no need to complicate things.
@juanluispaz would you be interested in adding this feature?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org