diff --git a/cpp/src/parquet/encoding.cc b/cpp/src/parquet/encoding.cc index e7e824896b191..7ad0ee1725a4f 100644 --- a/cpp/src/parquet/encoding.cc +++ b/cpp/src/parquet/encoding.cc @@ -499,7 +499,11 @@ class DictEncoderImpl : public EncoderImpl, virtual public DictEncoder { dict_encoded_size_(0), memo_table_(pool, kInitialHashTableSize) {} - ~DictEncoderImpl() override { DCHECK(buffered_indices_.empty()); } + ~DictEncoderImpl() override { + if (!buffered_indices_.empty()) { + ClearIndices(); + } + } int dict_encoded_size() const override { return dict_encoded_size_; }