Skip to content

Field Metadata Lost on UNION #12735

@alamb

Description

@alamb

Describe the bug

During upgrade of DataFusion in InfluxDB @itsjunetime found that somewhere Field level metadata (aka Field::with_metadata is being lost during DataFusion logical planning

This manifests itself as an error during the physical planning

Internal Error: Physical input schema should be the same as the one converted from logical input schema

To Reproduce

Run this query in metadata.slt

# Regression test: missing field metadata, from the NULL field on the left side of the union
query ITT
(SELECT id, NULL::string as name, l_name FROM "table_with_metadata")
  UNION
(SELECT id, name, NULL::string as l_name FROM "table_with_metadata")
ORDER BY id, name, l_name;

Expected behavior

No error during physical planning

Additional context

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions