HyukjinKwon commented on a change in pull request #28164: [SPARK-31393][SQL] 
Show the correct alias in a more elegant way that override the prettyName 
URL: https://github.com/apache/spark/pull/28164#discussion_r407828550
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala
 ##########
 @@ -43,6 +43,8 @@ case class UnaryMinus(child: Expression) extends 
UnaryExpression
 
   override def toString: String = s"-$child"
 
+  override def prettyName: String = "-"
 
 Review comment:
   I think it should be `negative` but should show `-` when it's used as the 
sql operator. You should be able to do this with if-else. e.g.)
   
   ```
   getTagValue(FunctionRegistry.FUNC_ALIAS).getOrElse("-")
   ```
   
   You might need to override `sql` IIRC.

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