HyukjinKwon commented on a change in pull request #27901: [SPARK-31146][SQL] 
Leverage the helper method for aliasing in built-in SQL expressions        
URL: https://github.com/apache/spark/pull/27901#discussion_r392746619
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/CallMethodViaReflection.scala
 ##########
 @@ -55,7 +55,7 @@ import org.apache.spark.util.Utils
 case class CallMethodViaReflection(children: Seq[Expression])
   extends Expression with CodegenFallback {
 
-  override def prettyName: String = "reflect"
+  override def prettyName: String = 
getTagValue(FunctionRegistry.FUNC_ALIAS).getOrElse("reflect")
 
 Review comment:
   @viirya, it changes from `reflect` to `java_method` when `java_method` is 
used, which I believe is correct. It will still show `reflect` when `reflect` 
is used.
   
   ```scala
   scala> spark.range(1).selectExpr("java_method('java.util.UUID', 
'randomUUID')").show()
   +---------------------------------------+
   |java_method(java.util.UUID, randomUUID)|
   +---------------------------------------+
   |                   c1b2961e-ccc4-4ad...|
   +---------------------------------------+
   
   
   scala> spark.range(1).selectExpr("reflect('java.util.UUID', 
'randomUUID')").show()
   +-----------------------------------+
   |reflect(java.util.UUID, randomUUID)|
   +-----------------------------------+
   |               587b9a03-63f1-424...|
   +-----------------------------------+
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to