Skip to content

[C++][Parquet] Fix DeltaLengthByteArrayEncoder memory pool tracking and zero-length UnsafeAppend #55685

Open

Description

@ryanvickr

Describe the bug, including details regarding any error messages, version, and platform.

DeltaLengthByteArrayEncoder in cpp/src/parquet/encoder.cc has two bugs:

  1. Its constructor writes EncoderImpl(descr, Encoding::DELTA_LENGTH_BYTE_ARRAY, pool = ::arrow::default_memory_pool()), overwriting the caller-provided MemoryPool* before initializing sink_ and length_encoder_ (this also affects DeltaByteArrayEncoder::suffix_encoder_).
  2. DeltaLengthByteArrayEncoder::Put(const T* src, int num_values) calls sink_.UnsafeAppend(src[idx].ptr, src[idx].len) unconditionally, passing nullptr to memcpy under UBSan on zero-length ByteArray(0, nullptr) values.

Split out from #55487 / #55488 so these fixes can be reviewed separately from the PutBinaryArray performance optimization.

Component(s)

C++, Parquet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions