apache / apache/parquet-java

AvroReadSupport.setRequestedProjection in 1.11.1+ not backwards compatible with MAPS

Open
#2,610 2 comments 0 reactions 0 assignees View on GitHub
Component: Avro Component: Java Component: Parquet Priority: Minor Type: bug
Dominant language
Java
Stars
3.1k
Forks
1.6k
Avg merge
3d 12h
Merged PRs (30d)
33

Description

 

using AvroReadSupport.setRequestedProjection in 1.11.1 reading a 1.10.0 generated parquet file sets MAP fields to null (and vice versa 1.10.0 reader against a 1.11.1 generated file) 

- Not using a projected schema works, the map fields are converted correctly.
In my case. Parquet file is generated by hive 
```java

CREATE TABLE parquetmaptest (
a string,
b MAP
)
STORED AS PARQUET
tblproperties(
"parquet.compression"="SNAPPY"
);
insert into parquetmaptest select "a",map("k1","v1","k2","v2");
```

Using parquet-avro 1.11.1 (and appropriate dependencies) result in field "b" being null. 
```java

data:null
row:{"a": "a", "b": null}
```
Using parquet-avro 1.11.0 (and appropriate dependencies) result in field "b" being  the right map value.  
```java

data:{k1=v1, k2=v2}
row:{"a": "a", "b": {"k1": "v1", "k2": "v2"}}
```
 

**Reporter**: [Bil Bingham](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=bilbingham)
#### Original Issue Attachments:
- [PQMapTest.java](https://issues.apache.org/jira/secure/attachment/13024749/PQMapTest.java)

**Note**: *This issue was originally created as [PARQUET-2039](https://issues.apache.org/jira/browse/PARQUET-2039). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.