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

Feat(optimizer): improve type annotation for nested types #2061

Merged
merged 2 commits into from
Aug 15, 2023

Conversation

georgesittas
Copy link
Collaborator

@georgesittas georgesittas commented Aug 15, 2023

@eric-zhu
Copy link

eric-zhu commented Aug 15, 2023

@georgesittas Thank you so much for the quick fix. It works for both array_agg() and filter now. 👍

Could you add support of array_cat() for postgres please? Following are the schema and sql. Thanks a lot.

schema = {
    "order": {
        "item_group1": "text[]",
        "item_group2": "text[]",
    }
}

# item_group1: ARRAY<TEXT>
# item_group2: ARRAY<TEXT>
sql = """
    select order.item_group1, order.item_group2 from order
"""

# test: UNKNOWN
sql = """
    select array_cat(order.item_group1, order.item_group2) as test from order
"""

@georgesittas
Copy link
Collaborator Author

Sure, will add that too

@georgesittas
Copy link
Collaborator Author

@eric-zhu added both ARRAY and ARRAY_CAT.

Feel free to use this PR as an example and add annotation logic for other functions that you need in the future.

@tobymao tobymao merged commit d92a5b7 into main Aug 15, 2023
@tobymao tobymao deleted the jo/type_annotation_array_fixes branch August 15, 2023 15:41
@eric-zhu
Copy link

Verified it works. Thanks a lot and really appreciate it. 👍

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

Successfully merging this pull request may close these issues.

Cannot annotate types on array_agg() and filter
3 participants