gerashegalov commented on code in PR #49503:
URL: https://github.com/apache/spark/pull/49503#discussion_r1917791020


##########
sql/connect/server/src/main/scala/org/apache/spark/sql/connect/ml/MLUtils.scala:
##########
@@ -228,39 +225,66 @@ private[ml] object MLUtils {
     instance
   }
 
+  /**
+   * Replace the operator with the value provided by the backend.
+   */
+  private def replaceOperator(sessionHolder: SessionHolder, name: String): 
String = {
+    SparkConnectPluginRegistry
+      .mlBackendRegistry(sessionHolder.session.sessionState.conf)
+      .view
+      .map(p => p.transform(name))
+      .find(_.isPresent) // First come, first served
+      .getOrElse(Optional.of(name))
+      .get()

Review Comment:
   nit: Could use `import scala.jdk.OptionConverters._`
   
   ```suggestion
         .flatMap(p => p.transform(name).toScala)
         .headOption // First come, first served
         .getOrElse(name)
   ```



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

Reply via email to