-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datafusion can't seem to cast evolving structs #14757
Comments
cc @alamb @zhuqi-lucas many of my users can't query their data because of this evolution. any chance you can take a look to see if there's any workaround I can do for now? |
I don't know of a workaround here. This seems like a feature we would have to implement (likely in arrow-rs 's We had some discussion on the semantics of struct casting recently |
@alamb perhaps a subtask is making Schema::try_merge consistent with datafusion's ability to query these merged schemas. |
Can't find a workaround for this, and i think the Schema::try_merge passed before this error. So when we map_schema at the end, we should still check the cast error why it not passed. I am not familiar with the checking logic. Need help from other folks. |
@alamb how do y'all handle this at influx? This one comes as quite a shocker to me. Does no one else using datafusion support struct evolution? |
InfluxData doesnt have a struct datatype so it doesn't come up Basically I think extending the schema merging and casting logic to handle struct evolution sounds like a good idea to me. Eventually the code probably belongs in arrow-rs but we could try to implement it first in DataFusion and then port it upstream Can someone file / find a ticket upstream in arrow-rs to get the conversation started there? |
@alamb given that the arrow folks don't seem super motivated to fix this in a timely manner, can we do a fix on the datafusion side? Maybe the fix is we can try to do an arrow cast, but if it fails we fallback to a datafusion cast specialized to this struct use case? |
Yes, of course!
Yes I think that would be a good idea! Can you perhaps work on a PR? I think it will be related to #14396 as well so maybe it would be good to give that a look, help @Lordworms with it |
I forgot to rebase the main branch, but I can refactor it to use arrow-cast + specialized case |
Describe the bug
I'd expect as I add fields to structs, I should be able to cast one into another. You can see in the repro below this doesn't seem to be allowed:
To Reproduce
produces
Expected behavior
i expected that test to pass
Additional context
No response
The text was updated successfully, but these errors were encountered: