Github user ueshin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19872#discussion_r160616235
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/PythonUDF.scala
 ---
    @@ -15,12 +15,30 @@
      * limitations under the License.
      */
     
    -package org.apache.spark.sql.execution.python
    +package org.apache.spark.sql.catalyst.expressions
     
    -import org.apache.spark.api.python.PythonFunction
    -import org.apache.spark.sql.catalyst.expressions.{Expression, 
NonSQLExpression, Unevaluable, UserDefinedExpression}
    +import org.apache.spark.api.python.{PythonEvalType, PythonFunction}
    +import org.apache.spark.sql.catalyst.util.toPrettySQL
     import org.apache.spark.sql.types.DataType
     
    +/**
    + * Helper functions for PythonUDF
    + */
    +object PythonUDF {
    +  def isScalarPythonUDF(e: Expression): Boolean = {
    +    e.isInstanceOf[PythonUDF] &&
    +      Set(
    --- End diff --
    
    Let's make this set `private[this] val ...` in `PythonUDF` object to avoid 
creating the set every time we use this method.
      


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to