zhengruifeng commented on code in PR #53150:
URL: https://github.com/apache/spark/pull/53150#discussion_r2555720325
##########
mllib/src/main/scala/org/apache/spark/ml/util/DatasetUtils.scala:
##########
@@ -212,4 +213,51 @@ private[spark] object DatasetUtils extends Logging {
dataset.select(columnToVector(dataset,
vectorCol)).head().getAs[Vector](0).size
}
}
+
+ private[ml] def toArrowBatchRDD(
+ dataFrame: DataFrame,
+ timeZoneId: String): RDD[Array[Byte]] = {
+ dataFrame match {
+ case df: org.apache.spark.sql.classic.DataFrame =>
+ val spark = df.sparkSession
+ val schema = df.schema
+ val maxRecordsPerBatch =
spark.sessionState.conf.arrowMaxRecordsPerBatch
+ df.queryExecution.executedPlan.execute().mapPartitionsInternal { iter
=>
Review Comment:
we can reuse it, with some change
--
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]