You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PhysicalExprAdapter should use SchemaAdapter logic for casting structs #18957
If we try and rewrite an expression that operates over a struct column, currently the DefaultPhysicalExprRewriter will fail b/c the arrow cast kernel uses an overly strict check for Struct castability, namely that the two structs have identical types.
I don't think using SchemaAdapter is the right move. Instead I think we need to extract the logic from it into a generalized cast operator that does the right thing and can be used from PhysicalExprAdapter. Even outside of this context it would be nice to be able to do cast(struct_col, struct_type) in sql, etc. As per #16800 the plan is to essentially get rid of SchemaAdapter long term.
Even outside of this context it would be nice to be able to do cast(struct_col, struct_type) in sql, etc.
Is it? I would argue it's too easy to accidentally use that API incorrectly and cast will silently backfill nulls when really all you've done is a typo (for example).
I actually think this is better off in the adapter/scan area.
I think it’s reasonable to want to do. And either way for it to go in the adapter it has to be an expression, and I think getting it in the adapter is the important part.
Activity
jatinkumarsingh commentedon Nov 27, 2025
take
jatinkumarsingh commentedon Nov 27, 2025
@a10y
would love to work on this issue
plz asssign me this
thnku
adriangb commentedon Nov 27, 2025
I don't think using
SchemaAdapteris the right move. Instead I think we need to extract the logic from it into a generalized cast operator that does the right thing and can be used fromPhysicalExprAdapter. Even outside of this context it would be nice to be able to docast(struct_col, struct_type)in sql, etc. As per #16800 the plan is to essentially get rid ofSchemaAdapterlong term.brancz commentedon Nov 27, 2025
Is it? I would argue it's too easy to accidentally use that API incorrectly and cast will silently backfill nulls when really all you've done is a typo (for example).
I actually think this is better off in the adapter/scan area.
adriangb commentedon Nov 27, 2025
I think it’s reasonable to want to do. And either way for it to go in the adapter it has to be an expression, and I think getting it in the adapter is the important part.
adriangb commentedon Dec 7, 2025
I think this was resolved by https://github.com/apache/datafusion/pull/18998/files
a10y commentedon Dec 14, 2025
I can confirm from Vortex land that this got fixed in #18998 👍