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:
I noticed that the default value for the optional boolean
is_compressed
field of theDataPageHeaderV2
struct has a default value of1
. According to the Thrift docs a boolean value is eithertrue
orfalse
.This currently works because the Apache Thrift compiler internally handles bools as ints:
https://github.com/apache/thrift/blob/3880a09565a9a1dad028b3679746eafac268c819/compiler/cpp/src/thrift/main.cc#L748
It may however not work with other Thrift compilers that are more strict about this.
Based on the docs and a test (https://github.com/apache/thrift/blob/3880a09565a9a1dad028b3679746eafac268c819/test/ThriftTest.thrift#L406) in the Thrift repository it seems that using
true
here is the correct way of defining a default for an optional bool field.Reporter: Matthijs Brobbel / @mbrobbel Assignee: Matthijs Brobbel / @mbrobbel
Externally tracked issue: https://github.com/apache/parquet-format/pull/210
Note: This issue was originally created as PARQUET-2299. Please see the migration documentation for further details.