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