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

    https://github.com/apache/spark/pull/10757#discussion_r53012673
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/python/PythonUDF.scala 
---
    @@ -36,9 +36,12 @@ case class PythonUDF(
         broadcastVars: java.util.List[Broadcast[PythonBroadcast]],
         accumulator: Accumulator[java.util.List[Array[Byte]]],
         dataType: DataType,
    -    children: Seq[Expression]) extends Expression with Unevaluable with 
Logging {
    +    children: Seq[Expression])
    +  extends Expression with Unevaluable with NonSQLExpression with Logging {
     
    -  override def toString: String = 
s"PythonUDF#$name(${children.mkString(",")})"
    +  override def toString: String = s"PythonUDF#$name(${children.mkString(", 
")})"
     
       override def nullable: Boolean = true
    +
    +  override def sql: String = s"$name(${children.mkString(", ")})"
    --- End diff --
    
    `Expression.sql` is also called when generating column names. 
`NonSQLExpressoin.sql` calls `PythonUDF.toString` here, which returns 
`PythonUDF#...`. We probably don't want to have `#` appear in column names.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to