LuciferYang commented on code in PR #40610:
URL: https://github.com/apache/spark/pull/40610#discussion_r1168175875


##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/connect/client/SparkResult.scala:
##########
@@ -46,7 +46,13 @@ private[sql] class SparkResult[T](
   private[this] var numRecords: Int = 0
   private[this] var structType: StructType = _
   private[this] var boundEncoder: ExpressionEncoder[T] = _
-  private[this] val batches = mutable.Buffer.empty[ColumnarBatch]
+  private[this] var nextBatchIndex: Int = 0
+  private[this] val idxToBatches = mutable.Map.empty[Int, ColumnarBatch]
+
+  // Exposed only for UT.
+  private[sql] def existingBatches(): Seq[ColumnarBatch] = {
+    idxToBatches.values.toSeq

Review Comment:
   On the other hand, I prefer to use `PrivateMethodTester` instead of exposed 
a new function
   
   



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