Repository navigation
Conversation
…ow's buffers (#324) An Arrow string column is already offsets plus one UTF-8 blob, which is the StringColumn layout. The batch went through to_pylist (one str per row) and core._string_column encoded those again. dataframe._arrow_string_column now rebases the offsets (a to_batches batch is a slice), narrows them to int32 and sends the bytes between the first and the last offset. A chunk it cannot take (empty, a blob of 2 GiB or more, a null row that holds text) keeps the to_pylist route. No speed claim: not timed.
This branch has not been deployed
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.
What does this PR do?
On the JVM wheel,
insert_arrowandinsert_dataframenow build a string column from Arrow's own buffers. An Arrow string or large string column is already int offsets plus one UTF-8 blob, which is what the bridge'sStringColumntakes. Before, each batch went throughto_pylist(one Pythonstrper row) andcore._string_columnencoded those again. This is the "Arrow and DataFrame string columns are first turned into Python lists" item that #324 left open after #334. The offsets are rebased (a batch ofto_batchesis a slice of the table), and a chunk the buffers cannot carry (empty, a blob of 2 GiB or more, a null row that holds text) keeps theto_pylistroute. The native wheel and the Java code are not touched.Still open on #324 after this: object columns that mix types, and the string columns of
append_samples.Related issues
Refs #324 and #315.
Performance changes
Not measured. The change removes one Python
strand one encode per row, but this PR states no speed or memory figure until a timed A/B of a CI-built JVM wheel has run, so it stays draft until that run is read.Docs
None: no page describes how a string column crosses.
Checklist
tests/test_arrow_string_column_jvm.py: 4 of 5 fail onmain, all pass here; JVM overlay on the 26.12.1.dev0 wheel, with the other Arrow and DataFrame tests, 302 passed)uvx pre-commit run --files <changed files>passes