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

support map_from_entries(subquery) like array(subquery) #20067

Open
xxchan opened this issue Jan 8, 2025 · 0 comments
Open

support map_from_entries(subquery) like array(subquery) #20067

xxchan opened this issue Jan 8, 2025 · 0 comments
Labels
Milestone

Comments

@xxchan
Copy link
Member

xxchan commented Jan 8, 2025

          Wow I didn't expect a resolution as fast, thank you @xxchan !

So the problem is not in map_from_entries, but array subquery

Indeed, sorry as the map feature was quite new I thought it was likely the cause. I have a small question though, as the function is called map_from_entries, I expected that we could use it without having to wrap the subquery with array() but it doesn't seem possible:

select
    map_from_entries(
        select row(1, 1)
        from bar
        where bar.foo_id = foo.id
    )
from foo;

Or wrapped by parenthesis:

select
    map_from_entries((
        select row(1, 1)
        from bar
        where bar.foo_id = foo.id
    ))
from foo;

Originally posted by @maingoh in #19835 (comment)

@github-actions github-actions bot added this to the release-2.3 milestone Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant