Skip to content
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

[Go] Allow duplicate field names in schemas and nested types #24243

Closed
asfimport opened this issue Mar 7, 2020 · 7 comments
Closed

[Go] Allow duplicate field names in schemas and nested types #24243

asfimport opened this issue Mar 7, 2020 · 7 comments

Comments

@asfimport
Copy link

Go's implementation of Schema panics if field names are duplicated within a schema. This is not guaranteed by the standard, so Go will not be able to handle valid record batches produced by other implementations which contain these.

https://github.com/apache/arrow/blob/084549a/go/arrow/schema.go#L117

Reporter: Ben Kietzman / @bkietz
Assignee: Sebastien Binet / @sbinet

PRs and other links:

Note: This issue was originally created as ARROW-8028. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
cc @sbinet

@asfimport
Copy link
Author

Sebastien Binet / @sbinet:
I must say I fail to see the use case for a schema with multiple fields with the same name (and possibly with different data types).
and it seems more like an error that should be caught very early on.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
The project has so far taken the position that downstream applications are responsible for the enforcement of these kinds of metadata constraints. From the perspective of the Arrow protocol "data is data". In my experience duplicate field names do arise in practice and it's a slippery slope if Arrow implementations start making arbitrary (or otherwise opinionated) decisions about what to do with such data (whether disallowing them or otherwise disambiguating them by modifying the field names). APIs that presume field name uniqueness can raise an exception, though

@asfimport
Copy link
Author

Sebastien Binet / @sbinet:
ok. I usually try to make defined behaviours very constrained (and then relaxing those if needed) as the opposite is a bit more convoluted to put in place.

@asfimport
Copy link
Author

Francois Saint-Jacques / @fsaintjacques:

SELECT 1 AS one, 1 AS one;

@asfimport
Copy link
Author

Sebastien Binet / @sbinet:
Issue resolved by pull request 6580
#6580

@asfimport
Copy link
Author

Wes McKinney / @wesm:
Here's an example from the wild grafana/grafana-plugin-sdk-go#137 (comment)

@asfimport asfimport added this to the 0.17.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants