apache / parquet-format

Apache Parquet Format
https://parquet.apache.org/
Apache License 2.0
1.69k stars 422 forks source link

PARQUET-2299: Use `true` instead of `1` as default value for `is_compressed` bool field #210

Closed mbrobbel closed 1 year ago

mbrobbel commented 1 year ago

I noticed that the default value for the optional boolean is_compressed field of the DataPageHeaderV2 struct has a default value of 1. According to the Thrift docs a boolean value is either true or false.

This currently works because the Apache Thrift compiler internally handles bools as ints:

It may however not work with other Thrift compilers that are more strict about this.

Based on the docs and a test in the Thrift repository it seems that using true here is the correct way of defining a default for an optional bool field.

wgtmac commented 1 year ago

Thanks! Would you mind creating a JIRA for this?

wgtmac commented 1 year ago

Thanks @mbrobbel! I have also added you as a contributor to the Apache Parquet JIRA project and assigned this to you.