apache / apache/parquet-java

ParquetMetadata.fromJSON method doesn't work

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

Description

I wrote a simple testCase to test the fromJSON method below and it fails because ParquetMetadata does not implement default constructors.

```

@Test public void testFromJSON() {
MessageType schema = parseMessageType("message test { optional binary some_null_field; }");
parquet.hadoop.metadata.FileMetaData fileMetaData =
new parquet.hadoop.metadata.FileMetaData(schema, new HashMap(), null);
List blockMetaDataList = new ArrayList();
BlockMetaData blockMetaData = new BlockMetaData();
blockMetaData.addColumn(createColumnChunkMetaData());
blockMetaDataList.add(blockMetaData);
ParquetMetadata metadata = new ParquetMetadata(fileMetaData, blockMetaDataList);

String metadataStr = ParquetMetadata.toJSON(metadata);
System.out.println(ParquetMetadata.toPrettyJSON(metadata));
ParquetMetadata m2 = ParquetMetadata.fromJSON(metadataStr);
}
```

**Reporter**: [Vihang Karajgaonkar](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=vihangk1)

**Note**: *This issue was originally created as [PARQUET-851](https://issues.apache.org/jira/browse/PARQUET-851). 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

Research direction

Start at ParquetMetadata.fromJSON and the related ParquetMetadata.toJSON call shown in the reproduction, then run the supplied test case with FileMetaData and BlockMetaData. Done means metadata serialized by toJSON can be passed to fromJSON without failing because of missing default constructors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data-engineering
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.