Skip to content

Expose ColumnCloseResult on ArrowColumnChunk - #9773

Merged
alamb merged 1 commit into
apache:mainfrom
leoyvens:expose-arrow-column-chunk-close
Apr 22, 2026
Merged

alamb merged 1 commit into
apache:mainfrom
leoyvens:expose-arrow-column-chunk-close

Conversation

@leoyvens

@leoyvens leoyvens commented Apr 20, 2026 •

Copy link
Copy Markdown
Contributor

Adds close() and close_mut() accessors on ArrowColumnChunk so callers can inspect and mutate the ColumnCloseResult produced by ArrowColumnWriter::close() before appending the chunk to a row group.

My motivation is dynamic deciding whether to omit the page index.

Should not be controversial given ColumnCloseResult is already public.

Which issue does this PR close?

What changes are included in this PR?

Adds accessor to ArrowColumnChunk

Are these changes tested?

An unit test is included, also illustrating a potential use case.

Are there any user-facing changes?

Yes the accessors are public.

Adds `close()` and `close_mut()` accessors on `ArrowColumnChunk` so
callers can inspect and mutate the `ColumnCloseResult` produced by
`ArrowColumnWriter::close()` before appending the chunk to a row
group.

Motivation: enables dynamic, per-column-chunk policies for page-level
index emission. For example, a pipelined writer can evaluate a rule
over the collected page statistics and encodings after close, and
drop `column_index` (or `bloom_filter`) for chunks where the index
would be useless — e.g. high-cardinality byte columns that fell back
to PLAIN encoding — without regenerating the data. Today the close
result is locked away behind private fields, so this is only possible
by bypassing `ArrowColumnWriter` and reimplementing the chunk path
against the lower-level `ColumnWriter`.

Both accessors are purely additive — they do not change
`append_to_row_group` or any other existing behavior.

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @leoyvens

@alamb
alamb merged commit 73ceb1d into apache:main Apr 22, 2026
17 checks passed
@alamb

alamb commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Thanks again @leoyvens

Rich-T-kid pushed a commit to Rich-T-kid/arrow-rs that referenced this pull request Jun 2, 2026
Adds `close()` and `close_mut()` accessors on `ArrowColumnChunk` so
callers can inspect and mutate the `ColumnCloseResult` produced by
`ArrowColumnWriter::close()` before appending the chunk to a row group.

My motivation is dynamic deciding whether to omit the page index.

Should not be controversial given `ColumnCloseResult` is already public.

# Which issue does this PR close?

- Closes apache#9774.

# What changes are included in this PR?

Adds accessor to `ArrowColumnChunk`

# Are these changes tested?

An unit test is included, also illustrating a potential use case.

# Are there any user-facing changes?

Yes the accessors are public.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parquet parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose ColumnCloseResult on ArrowColumnChunk

2 participants