Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

czgu
Copy link
Collaborator

@czgu czgu commented Sep 27, 2022

This is a fix for #991
example query that fails:

select MAP(ARRAY[ARRAY['foo' ], ARRAY['bar']], ARRAY[CAST(ROW(1, 2.0) AS ROW(x BIGINT, y DOUBLE)), CAST(ROW(3, 4.0) AS ROW(x BIGINT, y DOUBLE))])

The reason is that MAP is converted to Python dict, but Python dict cannot have keys with type list (which is what ARRAY gets translated to).

When Presto output rows in JSON, the keys are already serialized to strings, which means they are not parsable anyway, in this case, we just do not translate the keys at all.

Also added testing

@czgu czgu marked this pull request as ready for review September 27, 2022 00:38
@czgu
Copy link
Collaborator Author

czgu commented Sep 27, 2022

@froukees FYI, let us know if you have alternative suggestions

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.

2 participants