Skip to content

[Backport] Use the whole frame when writing rows. (#17094)#17195

Merged
kfaraz merged 3 commits intoapache:31.0.0from
kfaraz:backport_17094
Oct 2, 2024
Merged

[Backport] Use the whole frame when writing rows. (#17094)#17195
kfaraz merged 3 commits intoapache:31.0.0from
kfaraz:backport_17094

Conversation

@kfaraz
Copy link
Copy Markdown
Contributor

@kfaraz kfaraz commented Sep 30, 2024

Backport #17094

* Use the whole frame when writing rows.

This patch makes the following adjustments to enable writing larger
single rows to frames:

1) RowBasedFrameWriter: Max out allocation size on the final doubling.
   i.e., if the final allocation "naturally" would be 1 MiB but the
   max frame size is 900 KiB, use 900 KiB rather than failing the 1 MiB
   allocation.

2) AppendableMemory: In reserveAdditional, release the last block if it
   is empty. This eliminates waste when a frame writer uses a
   successive-doubling approach to find the right allocation size.

3) ArenaMemoryAllocator: Reclaim memory from the last allocation when
   the last allocation is closed.

Prior to these changes, a single row could be much smaller than the
frame size and still fail to be added to the frame.

* Style.

* Fix test.
@github-actions github-actions Bot added Area - Batch Ingestion Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 labels Sep 30, 2024
@kfaraz kfaraz added this to the 31.0.0 milestone Sep 30, 2024
@kfaraz kfaraz merged commit 4a8008a into apache:31.0.0 Oct 2, 2024
@kfaraz kfaraz deleted the backport_17094 branch October 2, 2024 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area - Batch Ingestion Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 Backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants