Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

strip_metadata_from_schema fails on list and map columns

Open Beginner friendly
#3,297 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

Start at iceberg::arrow::strip_metadata_from_schema and inspect MetadataStripVisitor, especially the list and map visitor hooks. Run the provided nested-list reproduction and review the existing doctest. Done means list elements and map keys and values are handled without stack-underflow errors and metadata is removed at every level.

Written by the indexing model from the issue text.

Description

datafusion
Apache Iceberg Rust version

main (8cb2adedd), 0.10.1

Describe the bug

iceberg::arrow::strip_metadata_from_schema returns an error for any Arrow schema that contains a list or map column:

Unexpected => Field stack underflow in list

MetadataStripVisitor remembers each field's name and nullability by pushing onto field_stack in before_field, and pops it when rebuilding the field in list, map, struct and primitive. But visit_list and the map arm of visit_type call before_list_element, before_map_key and before_map_value for the inner fields, not before_field. The visitor doesn't override those hooks, so rebuilding a list element or a map key or value pops from an empty stack.

The only test of this function is the doctest, which uses a flat schema, so this wasn't caught.

Downstream, datafusion-iceberg calls this function to validate INSERTs into partitioned tables, so an INSERT into a partitioned table with a list or map column fails (found in apache/datafusion-iceberg#19).

To Reproduce
use std::sync::Arc;

use arrow_schema::{DataType, Field, Schema};
use iceberg::arrow::strip_metadata_from_schema;

let schema = Schema::new(vec![Field::new(
    "l",
    DataType::List(Arc::new(Field::new("element", DataType::Int32, true))),
    true,
)]);
strip_metadata_from_schema(&schema).unwrap(); // Field stack underflow in list
Expected behavior

It returns the same schema with metadata removed at every level, including list elements and map keys and values.

Willingness to contribute

I can contribute a fix for this bug independently

Dominant language
Rust
Stars
1.4k
Forks
574
Avg merge
1d 16h
Merged PRs (30d)
70

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/iceberg-rust

All issues in apache/iceberg-rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.