Skip to content

ProjectionExec Loses Field Metadata #1361

@tustvold

Description

@tustvold

Describe the bug

ProjectionExec does not preserve field metadata when generating the projected schema. I believe this will also cause it to lose dictionary information for the field.

I think fixing this will require extending PhysicalExpr with a fn field(&self, input_schema: &Schema) -> Result<Field>; or similar to replace the current logic that just constructs a new Field

To Reproduce

Create a RecordBatch with a schema with field metadata and pass it through ProjectionExec.

Expected behavior

There is potentially discussion to be had w.r.t schema-level metadata, but I would expect field-level metadata to be preserved for the fields that are projected

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions