In some situations, Impala accepts a semantically incorrect query that references nested collections. The returned results are arbitrary.
Example and repro
In Hive create and populate this table:
Impala will incorrectly execute this invalid query:
The above query is semantically not correct because "l.key" and "l.value" are fields in the nested map in "l" but the map itself is not referenced in the FROM clause. The query should fail semantic analysis.
The correct query references the nested map in the FROM clause: