wgtmac commented on code in PR #38118:
URL: https://github.com/apache/arrow/pull/38118#discussion_r1349537716


##########
cpp/src/parquet/encoding.cc:
##########
@@ -442,7 +442,13 @@ class DictEncoderImpl : public EncoderImpl, virtual public 
DictEncoder<DType> {
         dict_encoded_size_(0),
         memo_table_(pool, kInitialHashTableSize) {}
 
-  ~DictEncoderImpl() override { DCHECK(buffered_indices_.empty()); }
+  ~DictEncoderImpl() override {
+#ifndef NDEBUG
+    if (!buffered_indices_.empty()) {
+      ARROW_LOG(WARNING) << "DictEncoderImpl destroyed without flushing or 
closing";

Review Comment:
   IIUC, the behavior has changed under debug mode, which calls abort() in the 
past.



##########
cpp/src/parquet/encoding.cc:
##########
@@ -442,7 +442,13 @@ class DictEncoderImpl : public EncoderImpl, virtual public 
DictEncoder<DType> {
         dict_encoded_size_(0),
         memo_table_(pool, kInitialHashTableSize) {}
 
-  ~DictEncoderImpl() override { DCHECK(buffered_indices_.empty()); }
+  ~DictEncoderImpl() override {
+#ifndef NDEBUG
+    if (!buffered_indices_.empty()) {
+      ARROW_LOG(WARNING) << "DictEncoderImpl destroyed without flushing or 
closing";

Review Comment:
   ```suggestion
         ARROW_LOG(WARNING) << "DictEncoderImpl is destroyed without flushing 
or closing";
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to