optimize deltalake export memory - #241
Merged
Merged
Conversation
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 addresses #237
At a 512 MiB threshold that's ~3.4 GB against the 8 GB limit instead of ~5.3 GB.
shapely WKB decoding — 4.18x on its own. .to_list() built a Python bytes per row and shapely.from_wkb a GEOS geometry per row. Replaced with a numpy reader: PostGIS EWKB points are fixed-width, so the values buffer reshapes directly. Falls back to shapely for anything non-uniform (big-endian, 2D, mixed types).
Per-spec full-table copies. Each of your 4 specs materialised the whole table twice while the shared frame stayed alive. Now the derived columns attach to the decoded batches zero-copy.
The partitioned write — 3.93x. The writer holds an open Parquet writer per partition and flushes only when the call returns. Now written in bounded groups of partitions.
pl.cut materialised a string label per row (categorical→Utf8→Int32). Replaced with np.searchsorted.