diff --git a/cpp/src/parquet/encoding.cc b/cpp/src/parquet/encoding.cc index e7e824896b191..ca7b8d594a3e5 100644 --- a/cpp/src/parquet/encoding.cc +++ b/cpp/src/parquet/encoding.cc @@ -499,7 +499,10 @@ 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_; }