You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Daniel Becker (Jira)" <ji...@apache.org> on 2023/01/16 10:14:00 UTC

[jira] [Resolved] (IMPALA-11778) Printing maps may produce invalid json

     [ https://issues.apache.org/jira/browse/IMPALA-11778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Becker resolved IMPALA-11778.
------------------------------------
    Resolution: Implemented

> Printing maps may produce invalid json
> --------------------------------------
>
>                 Key: IMPALA-11778
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11778
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Backend
>            Reporter: Daniel Becker
>            Assignee: Daniel Becker
>            Priority: Major
>
> Impala allows non-string types, for example numbers, to be keys in maps. We print maps as json objects, but json objects only allow string keys. If the Impala map has for example an INT key, the printed json is invalid.
> For example, in Impala the following two maps are not the same:
> {code:java}
> {1: "a", 2: "b"}{code}
> {code:java}
> {"1": "a", "2": "b"}{code}
> The first map has INT keys, the second has STRING keys. Only the second one is valid json.
> Hive has the same issue.
> Converting all keys to strings is not good because that causes loss of information. On the other hand sometimes we may need valid json, so we could introduce a query option that, when set to true, would convert non-string keys to strings.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org