Skip to content

fix(arrow): release schema after conversion failure - #862

Open
WZhuo wants to merge 1 commit into
apache:mainfrom
WZhuo:fix-to-arrow-schema-resource-leak
Open

fix(arrow): release schema after conversion failure#862
WZhuo wants to merge 1 commit into
apache:mainfrom
WZhuo:fix-to-arrow-schema-resource-leak

Conversation

@WZhuo

@WZhuo WZhuo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Release partially initialized ArrowSchema output when internal Iceberg-to-Arrow conversion fails. Add coverage using fixed(0), which passes compatibility validation but is rejected by nanoarrow, and verify the output release callback is cleared. Tests: arrow_test.

Copilot AI review requested due to automatic review settings July 31, 2026 02:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the Iceberg-to-Arrow schema conversion path so that when nanoarrow conversion fails after partially initializing an ArrowSchema, the output is released/cleared to avoid leaving callers with an apparently-live schema.

Changes:

  • Ensure ToArrowSchema(const Schema&, ArrowSchema*) releases the output schema when nanoarrow conversion returns an error.
  • Extend arrow_test coverage to validate ArrowSchema::release is cleared on both unsupported-type validation failures and nanoarrow conversion failures (via fixed(0)).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/iceberg/schema_internal.cc Releases the output ArrowSchema on internal conversion failure to prevent partially-initialized outputs from escaping.
src/iceberg/test/arrow_test.cc Adds regression coverage verifying ArrowSchema::release is null after conversion failures.

Comment thread src/iceberg/schema_internal.cc
Copilot AI review requested due to automatic review settings July 31, 2026 09:12
@WZhuo
WZhuo force-pushed the fix-to-arrow-schema-resource-leak branch from 3b99c34 to 8a10338 Compare July 31, 2026 09:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants