ivoson commented on code in PR #40610: URL: https://github.com/apache/spark/pull/40610#discussion_r1171415246
########## 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: Thanks, sorted the results by key. And `PrivateMethodTester` works for private method. Do you think shall we mark the new funciton as `private` and use `PrivateMethodTester` to invoke it? -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org