aroig opened a new issue, #17285: URL: https://github.com/apache/datafusion/issues/17285
### Describe the bug We have observed that casting a struct with fields of the same type, to a schema that re-orders the fields, miss-assigns the values. It appears like the values are assigned positionally, instead of by field name. ### To Reproduce I've prepared a reproducing example here: https://github.com/aroig/datafusion-cast-bug Just do `cargo run` to reproduce. ### Expected behavior I would expect that casting `{"b": 3, "a": 4}`, to schema `{"a": Int, "b": Int}` would produce `{"a": 4, "b": 3}`, however the obtained result is `{"a": 3, "b": 4}`, as if the values are assigned positionally instead of by field name. ### Additional context _No response_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org