zhengruifeng commented on code in PR #50013:
URL: https://github.com/apache/spark/pull/50013#discussion_r1964614803
##########
sql/connect/server/src/main/scala/org/apache/spark/sql/connect/ml/MLHandler.scala:
##########
@@ -125,6 +127,15 @@ private[connect] object MLHandler extends Logging {
val dataset = MLUtils.parseRelationProto(fitCmd.getDataset,
sessionHolder)
val estimator =
MLUtils.getEstimator(sessionHolder, estimatorProto,
Some(fitCmd.getParams))
+
+ // pre-training model size check
+ val maxSize =
conf.getConf(Connect.CONNECT_SESSION_ML_CACHE_SINGLE_ITEM_SIZE)
+ if (maxSize > 0) {
+ val estimatedSize = estimator.estimateModelSize(dataset)
+ if (estimatedSize > maxSize) {
+ throw MlItemSizeExceededException("fit", estimator.uid,
estimatedSize, maxSize)
Review Comment:
I think we should not stop the session in this case
--
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]