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
Different parquet implementations use different field names for internal fields of ListType and MapType, which can sometimes cause silly conflicts. For example, we use item as the field name for list, but Spark uses element. Fortunately, we can automatically cast between List and Map Types with different field names. Unfortunately, it only works at the top level. We should get it to work at arbitrary levels of nesting.
Will Jones / @wjones127:
What's actually going on is we don't have any cast kernel for Map. Casting from a map to map works, because we early return if types are equal, and our equals method doesn't care about map field names. But it does care about list field names, so if the map contains a list then it will look for a cast function.
I'll create a separate ticket for implementing Cast for Map, but for this particular issue, I think it would be nice to have a fast path for renaming fields in cast.
Will Jones / @wjones127:
Yes, I've updated the title. Casting lists only was broken if it was inside a map. The only reason casting maps looked as if it was working was because of the early return if types are "equal" (and maps are "equal" even if they have different field names).
Different parquet implementations use different field names for internal fields of ListType and MapType, which can sometimes cause silly conflicts. For example, we use
item
as the field name for list, but Spark useselement
. Fortunately, we can automatically cast between List and Map Types with different field names. Unfortunately, it only works at the top level. We should get it to work at arbitrary levels of nesting.This was discovered in delta-rs: delta-io/delta-rs#684 (comment)
Here's a reproduction in Python:
Reporter: Will Jones / @wjones127
Assignee: Will Jones / @wjones127
PRs and other links:
Note: This issue was originally created as ARROW-17349. Please see the migration documentation for further details.
The text was updated successfully, but these errors were encountered: