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.
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:
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.