Uploaded image for project: 'Parquet'
  1. Parquet
  2. PARQUET-2299

Use `true` instead of `1` as default value for `is_compressed bool` field

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • format-2.10.0
    • parquet-format
    • None

    Description

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

       

      Attachments

        Activity

          People

            mbrobbel Matthijs Brobbel
            mbrobbel Matthijs Brobbel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: