Skip to content

Wrong cast between structs with different field order #3694

@aroig

Description

@aroig

Environment

Delta-rs version: python-1.1.4

Binding: python

Environment:

  • Cloud provider: local
  • OS: linux
  • Other:

Bug

What happened: Casting a struct {"b": 3, "a": 4} to schema {"a": Int, "b": Int} (different order) results in wrong values: {"a": 3, "b": 4}, as if it happens positionally, instead of by field name.

What you expected to happen: I would expect the fields get the expected values by field name {"a": 4, "b": 3}.

How to reproduce it: I added a test-case that makes the problem manifest here: https://github.com/aroig/delta-rs/tree/struct_cast_bug

More details:
I did some initial debugging, and I suspect the issue comes from datafusion. I filled a bug report here: apache/datafusion#17285

Metadata

Metadata

Assignees

Labels

binding/rustIssues for the Rust cratebugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions