kosiew commented on code in PR #22991:
URL: https://github.com/apache/datafusion/pull/22991#discussion_r3433076781


##########
datafusion/physical-plan/src/topk/mod.rs:
##########
@@ -1101,86 +1208,111 @@ mod tests {
         assert_eq!(record_batch_store.batches_size, 0);
     }
 
-    /// Builds an `(a Int32, b Float64)` schema and a `TopK` with full sort
-    /// `(a ASC, b ASC)`, input prefix `[a]`, `k = 3`, `batch_size = 2`. Used 
by
-    /// the prefix-completion tests below to keep their per-scenario logic in 
focus.
-    fn build_ab_prefix_topk() -> Result<(Arc<Schema>, TopK)> {
-        let schema = Arc::new(Schema::new(vec![
-            Field::new("a", DataType::Int32, false),
+    fn make_ab_schema() -> SchemaRef {
+        make_ab_schema_with_nullable_a(false)
+    }
+
+    fn make_ab_schema_with_nullable_a(a_nullable: bool) -> SchemaRef {
+        Arc::new(Schema::new(vec![
+            Field::new("a", DataType::Int32, a_nullable),
             Field::new("b", DataType::Float64, false),
-        ]));
+        ]))
+    }
+
+    fn make_topk_filter() -> Arc<RwLock<TopKDynamicFilters>> {

Review Comment:
   Small cleanup suggestion: `make_topk_filter` and `make_shared_topk_filter` 
currently build the same wrapper. It might be a little easier to maintain if 
the single-emitter helper delegates to the shared helper so any future fixture 
changes only need to be made in one place.
   
   ```rust
   fn make_topk_filter() -> Arc<RwLock<TopKDynamicFilters>> {
       make_shared_topk_filter(1)
   }
   ```



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