goldmedal opened a new issue, #11437: URL: https://github.com/apache/datafusion/issues/11437
### Is your feature request related to a problem or challenge? In most databases, the map type only allows unique keys. Refer to the behavior of DuckDB: ``` D select map {'1':1, '1':2}; Invalid Input Error: Map keys must be unique. ``` However, the specification of [MapArray](https://github.com/apache/arrow/blob/5e451d85d7269d3fb9c7eaab06caece5718c40e5/format/Schema.fbs#L117-L145) states: ``` /// In this layout, the keys and values are each respectively contiguous. We do /// not constrain the key and value types, so the application is responsible /// for ensuring that the keys are hashable and unique. Whether the keys are sorted /// may be set in the metadata for this field. ``` MapArray is not responsible for ensuring the uniqueness of keys. Therefore, we should ensure the keys are unique on the application side (DataFusion). ### Describe the solution you'd like We can check the keys are distinct when invoking the `map` and `make_map` functions. ### Describe alternatives you've considered _No response_ ### Additional context _No response_ -- 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: github-unsubscr...@datafusion.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org