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

Issue found on page 'Map Functions': element_at, map_extract, and map[entry] return an array #4449

Open
rpbouman opened this issue Dec 30, 2024 · 3 comments

Comments

@rpbouman
Copy link
Contributor

rpbouman commented Dec 30, 2024

The map retrieval functions:

return an array.
This is described in https://duckdb.org/docs/sql/data_types/map#retrieving-from-maps.

But the description of these functions do not mention that, and the given examples suggesting they return the value directly, not an array containing the value.

Page URL: https://duckdb.org/docs/sql/functions/map.html

@soerenwolfers
Copy link
Collaborator

This was changed on HEAD in duckdb/duckdb#14175. The documentation PR at #4201 was merged prematurely.

You can already try it out the new behavior in the nightly build via pip install duckdb --upgrade --pre or via the instructions at https://duckdb.org/docs/installation/?version=main&environment=cli&platform=linux&download_method=direct&architecture=x86_64

@szarnyasg Let me know if you think it's worth reverting and reinstating after 1.2.0 is released.

@rpbouman
Copy link
Contributor Author

Hi @soerenwolfers , thanks! Ok - I guess I'll close this one then?

(BTW I much prefer MAP extraction methods to not wrap the value in an array.)

@vlulla
Copy link

vlulla commented Dec 30, 2024

I too stumbled upon this just now! It appears that the Map functions docs page states that the stable version of duckdb 1.1.3 (listed on top right of the docs page) will return a value whereas the cli returns the array with one element. It appears to me that the doc is out of sync with the stable version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants