comphead commented on code in PR #6361:
URL: https://github.com/apache/datafusion-comet/pull/6361#discussion_r4645584343


##########
spark/src/test/scala/org/apache/spark/sql/comet/execution/shuffle/CometDiskBlockWriterSuite.scala:
##########
@@ -223,6 +227,65 @@ class CometDiskBlockWriterSuite extends AnyFunSuite {
     }
   }
 
+  private def newWriter(
+      file: File,
+      allocator: CometShuffleMemoryAllocatorTrait,
+      taskContext: TaskContextImpl,
+      conf: SparkConf): CometDiskBlockWriter = {
+    new CometDiskBlockWriter(
+      file,
+      allocator,
+      pageSize,
+      pageSize,
+      taskContext,
+      new UnsafeRowSerializer(1).newInstance(),
+      schema,
+      new ShuffleWriteMetrics,
+      conf,
+      false,
+      new JLinkedList[CometDiskBlockWriter]())

Review Comment:
   `newWriter` is called from one test body only, and it fixes `pageSize` for 
both page arguments and creates its own `ShuffleWriteMetrics` and writer list. 
The other tests in this file (lines 98, 113, 369 and 431) build 
`CometDiskBlockWriter` inline. Inlining the constructor call here, as they do, 
would drop the helper and the new `CometShuffleMemoryAllocatorTrait` import. If 
a helper is wanted, it would be better to make the existing tests use it too, 
so the file does not end up with two ways to construct a writer.



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