From 46e7ed11c2e0ef62ccbbe23e6a35a4988884e450 Mon Sep 17 00:00:00 2001 From: avogar Date: Tue, 26 Mar 2024 14:59:35 +0000 Subject: [PATCH] Don't throw in ~DictEncoderImpl() --- cpp/src/parquet/encoding.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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_; }