Skip to content

Sort discards field metadata on the output schema #1476

Description

@alamb

Describe the bug

The following code in Sort skips the field level metadata when when it constructs the output batch.

    let schema = Arc::new(Schema::new(
        schema
            .fields()
            .iter()
            .zip(batch.columns().iter().map(|col| col.data_type()))
            .map(|(field, ty)| Field::new(field.name(), ty.clone(), field.is_nullable()))
            .collect::<Vec<_>>(),
    ));

It also seems to be unecessary (at least all the existing tests pass without it, so maybe @maxburke can comment on its), and so if any schema adjustment is needed it should have been done as part of the creation of Sort.

To Reproduce
Will add reproducer on ticket

Expected behavior
Metadata is preserverd

Additional context
Introduced in #1455

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions