Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-17133

[Go][Parquet] PlainFixedLenByteArrayEncoder behaves differently from DictFixedLenByteArrayEncoder with null values where schema has Nullable: false

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 8.0.0
    • None
    • Go, Parquet
    • None

    Description

      I have created a small repro to illustrate this bug: https://gist.github.com/phillipleblanc/5e3e2d0e6914d276cf9fd79e019581de

      When writing a Decimal128 array to a Parquet file the pqarrow package will prefer to use DictFixedLenByteArrayEncoder. If the size of the array goes over some threshold, it will switch to using PlainFixedLenByteArrayEncoder.

      The DictFixedLenByteArrayEncoder tolerates null values in a Decimal128 array with the arrow schema set to Nullable: false, however the PlainFixedLenByteArrayEncoder will not tolerate null values and will panic.

      Having null values in an array marked as non-nullable is an issue in the user code - however, it was surprising that my buggy code was working some times and not working other times. I would expect the PlainFixedLen encoder to handle nulls the same way as the DictFixedLen encoder or for the DictFixedLen encoder to panic.

      An observation is that most other array types handle nulls with the schema marked as non-nullable when writing to Parquet; this was the first instance I found in the pqarrow package where having the Arrow schema marked as Nullable was necessary for Parquet writing arrays with null values. Again, debatable if this is desirable or not.

      Attachments

        Activity

          People

            Unassigned Unassigned
            phillip Phillip LeBlanc
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: