StructArray field names should be unique
#6010
Unanswered
connortsui20
asked this question in
Issue Triage
Replies: 1 comment 4 replies
-
|
Checking this end up being expensive anytime you have to construct a struct array. We have expanded cast to support by name casting but the fix could be doing this with two expressions where one is ordinal and the other one is name based |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue Description
We have this in our doc comment for
StructArray:vortex/vortex-array/src/arrays/struct_/array.rs
Lines 71 to 97 in a30298b
To me, this is insane behavior, and not at all expected.
I am guessing that we have this behavior because the Arrow specification does not enforce this at all.
Here are relevant links:
Also, looking at other Arrow issues like apache/arrow-rs#4908, it doesn't seem like they have considered things like casting and schema evolution in the context of having duplicate field names.
Edit: Arrow-rs issue apache/arrow-rs#9205
Expected Behavior
I would expect field name uniqueness to be enforced.
I cannot think of any good reason to have duplicate names, and can think of many reasons not to have this behavior...
Actual Behavior
Field names can be duplicated (and all duplicates can have DIFFERENT TYPES). When looking up fields with a given name, we (arbitrarily) get the first one.
Reproduction Steps
This is likely one of the reasons for this fuzzer crash: #5865
Technically this is not a bug but a feature, but this is so unexpected that I would consider this similar...
I acknowledge that:
```) on separate lines.Beta Was this translation helpful? Give feedback.
All reactions