xitongsys / parquet-go

pure golang library for reading/writing parquet file
Apache License 2.0
1.27k stars 293 forks source link

update example/type.go to make schema compatible with java parquet-tools #383

Closed hangxie closed 3 years ago

hangxie commented 3 years ago

Java parquet-tools cannot read type.parquet generated by type.go, here are errors:

java.io.IOException: Could not read footer: java.lang.IllegalStateException: INTERVAL can only annotate FIXED_LEN_BYTE_ARRAY(12)

java.lang.IllegalArgumentException: Decimal scale should match with the scale of the logical type

java.lang.IllegalArgumentException: Decimal precision should match with the precision of the logical type

java.lang.IllegalStateException: INT32 cannot store 10 digits (max 9)

Ref https://github.com/apache/parquet-format/blob/master/LogicalTypes.md for more details.

hangxie commented 3 years ago

It'll be great if parquet-go can reject invalid types.