Arrow: Support Large Binary when using to_arrow#409
Merged
Fokko merged 2 commits intoapache:mainfrom Feb 10, 2024
Merged
Conversation
Fokko
approved these changes
Feb 10, 2024
Contributor
Fokko
left a comment
There was a problem hiding this comment.
@castedice Thanks for raising this. I think this is fine since Polars does it as well:
python3
Python 3.11.7 (main, Dec 4 2023, 18:10:11) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import polars as pl
>>> df = pl.DataFrame(
... {"foo": [1, 2, 3, 4, 5, 6], "bar": [b"a", b"b", b"c", b"d", b"e", b"f"]}
... )
>>> df.to_arrow()
pyarrow.Table
foo: int64
bar: large_binary
----
foo: [[1,2,3,4,5,6]]
bar: [[61,62,63,64,65,66]]
Contributor
Author
|
Thanks for review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is to address an issue that prevented the
to_arrowmethod from handling binaries larger than 2GB when used as mentioned in #344.With this change in place, all binary types must be defined via
pa.large_binarywhen defining a pyarrow schema.I considered leaving it as
pa.binaryand casting it in pyiceberg, but since defining it aspa.large_binaryis essential for pyarrow to handle 2GB of data, I implemented it this way.