Open oneonestar opened 5 years ago
This is a known, long-standing issue. Unfortunately, we screwed up and encoded maps as normal JSON maps, which only allow strings as the keys. They need to be encoded as a list of entry pairs, but that would break existing clients, and it’s never been a priority to figure out how to solve this in a compatible way.
This is one of the things to be fixed by the v2 protocol, which had been stalled for a while, but just last week we had a long meeting and finally resolved most of the blocking design issues.
Yeah, this is a long-standing issue for maps that contain keys of complex types. Unfortunately, there's no easy way to fix this without breaking backward compatibility, so we've been pushing it until we start work on the V2 protocol. We had good discussions with the folks at TreasureData during the conference in Japan, and they have expressed interest in working on that project. cc @xerial @Lewuathe
We also encountered a similar problem:
Then we found that it can be fixed by some modification of source codes mentioned in this issue: https://github.com/trinodb/trino/issues/4589
Presto CLI failed to parse the query result if the key of a map is a complex type. I think this is somehow related to the serialization and deserialization of JSON.
Table:
Query:
Pretty Print Json Dump: