Skip to content

VectorSchemaRoot loses columns with equal Fields in JSON files, and syncSchema() drops the schema metadata #1473

Closed

Description

@jbonofre

Describe the bug, including details regarding any error messages, version, and platform.

Two problems in VectorSchemaRoot, found while reviewing #1389:

  • VectorSchemaRoot keys its vector lookup by Field, and Field equality is structural, so columns with equal Fields (for example, two int columns both named x) share one entry. That entry holds the last of the columns, while getVector(String) documents that it returns the first. JsonFileWriter and JsonFileReader look each column up through getVector(Field), so they write and read the same vector for both columns: a JSON round trip of x: [1], x: [2] reads back x: [null], x: [2].
  • syncSchema() rebuilds the schema with new Schema(newFields), which drops the custom metadata of the schema.

Both problems predate #1389.

Activity

  1. added this to the 20.0.0 milestone on Nov 14, 2026
  2. added a commit that references this issue on Nov 15, 2026
  3. added a commit that references this issue on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions