You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/05/12 06:21:00 UTC

[jira] [Commented] (PARQUET-2299) Use `true` instead of `1` as default value for `is_compressed bool` field

    [ https://issues.apache.org/jira/browse/PARQUET-2299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17722023#comment-17722023 ] 

ASF GitHub Bot commented on PARQUET-2299:
-----------------------------------------

wgtmac merged PR #210:
URL: https://github.com/apache/parquet-format/pull/210




> Use `true` instead of `1` as default value for `is_compressed bool` field
> -------------------------------------------------------------------------
>
>                 Key: PARQUET-2299
>                 URL: https://issues.apache.org/jira/browse/PARQUET-2299
>             Project: Parquet
>          Issue Type: Improvement
>          Components: parquet-format
>            Reporter: Matthijs Brobbel
>            Priority: Minor
>
> 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:
> - https://github.com/apache/thrift/blob/3880a09565a9a1dad028b3679746eafac268c819/compiler/cpp/src/thrift/thriftl.ll#L208-L209
> - 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.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)