2010YOUY01 commented on code in PR #27604:
URL: https://github.com/apache/datafusion/pull/27604#discussion_r4657304987


##########
datafusion/fuzz/tests/suites/memory.rs:
##########
@@ -0,0 +1,89 @@
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-FileCopyrightText: See the NOTICE file distributed with this work for 
additional information regarding copyright ownership
+// SPDX-FileContributor: Licensed to the Apache Software Foundation (ASF) 
under one or more contributor license agreements
+
+//! Checks incremental memory accounting against recounting the retained arrays
+//! after each operation, including arrays that share buffers.
+
+use std::future::Future;
+use std::sync::Arc;
+
+use arrow::array::{
+    ArrayRef, BooleanArray, DictionaryArray, Int32Array, StringArray, 
StringViewArray,
+};
+use arrow::datatypes::Int32Type;
+use datafusion_common::Result;
+use datafusion_common::utils::memory::{
+    RecordBatchMemoryCounter, RecordBatchMemoryTracker,
+};
+use rand::rngs::StdRng;
+use rand::{Rng, SeedableRng};
+use test_utils::fuzz::FuzzTest;
+
+pub(crate) struct RecordBatchMemoryFuzzer;
+
+impl FuzzTest for RecordBatchMemoryFuzzer {
+    type Dataset = Vec<ArrayRef>;
+
+    fn name(&self) -> &str {
+        "record_batch_memory_tracker"
+    }
+
+    fn prepare_dataset(&self, _seed: u64) -> impl Future<Output = 
Result<Self::Dataset>> {

Review Comment:
   we could do it in follow-up. The current version keeps the previous 
behavior, and I believe there are other similar ways to improve test coverage, 
and also `FuzzTest` trait make them easier to extend.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to