bharadwaj-pendyala commented on issue #11575: URL: https://github.com/apache/arrow-rs/issues/11575#issuecomment-6354098278
I checked this on main. `try_merge` can't produce duplicate type ids today. When `other` brings a new field whose id is already taken, the `try_new` pass rejects it with `duplicate type id: 0`, which doesn't say which union members clashed. I'd do the check inline instead. When the incoming field is new and its id is already in `output`, return a `SchemaError` that names both fields, then build `UnionFields` from `output` directly and drop both TODOs. It's a few lines in `fields.rs`, plus an assertion in the `Schema::try_merge` union test. One side effect is that the error variant goes from `InvalidArgumentError` to `SchemaError`, the same variant the type id mismatch above it already returns. Does that direction work for you? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
