[ https://issues.apache.org/jira/browse/HIVE-11625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14708885#comment-14708885 ]
Cheng Lian commented on HIVE-11625: ----------------------------------- I meant to open this issue as a Parquet bug, but it seems that the Parquet support in Hive code base diverges a lot from parquet-hive. Fixes made in Hive were not backported to parquet-hive. For example, [the most recent master version of parquet-hive|https://github.com/apache/parquet-mr/blob/04f524d5ad91b1cdda66dfde4089f2f83f4528aa/parquet-hive/parquet-hive-storage-handler/src/main/java/org/apache/hadoop/hive/ql/io/parquet/write/DataWritableWriter.java] doesn't support writing maps, decimals, or timestamps, while all these data types are [supported in Hive 1.2.1|https://github.com/apache/hive/blob/release-1.2.1/ql/src/java/org/apache/hadoop/hive/ql/io/parquet/write/DataWritableWriter.java#L223-L237] and earlier versions. > Map instances with null keys are not written to Parquet tables > -------------------------------------------------------------- > > Key: HIVE-11625 > URL: https://issues.apache.org/jira/browse/HIVE-11625 > Project: Hive > Issue Type: Bug > Affects Versions: 0.14.0, 0.13.1, 1.0.1, 1.1.1, 1.2.1 > Reporter: Cheng Lian > > Hive allows maps with null keys: > {code:sql} > hive> select map(null, 'foo', 1, 'bar', null, 'baz'); > {null:"baz",1:"bar"} > {code} > However, when written into Parquet tables, map entries with null as keys are > dropped: > {code:sql} > hive> CREATE TABLE map_test STORED AS PARQUET > > AS SELECT MAP(null, 'foo', 1, 'bar', null, 'baz'); > ... > hive> SELECT * from map_test; > {1:"bar"} > {code} > This is because entries with null keys are explicitly skipped in > {{DataWritableWriter}}, [see > here|https://github.com/apache/hive/blob/release-1.2.1/ql/src/java/org/apache/hadoop/hive/ql/io/parquet/write/DataWritableWriter.java#L223-L237]. -- This message was sent by Atlassian JIRA (v6.3.4#6332)